Skip to content

Commit

Permalink
Merge branch 'beta' of https://github.com/hannibal002/SkyHanni into i…
Browse files Browse the repository at this point in the history
…tem-stack-size-player-advanced
  • Loading branch information
RayDeeUx committed Dec 22, 2023
2 parents 37a9ec3 + acbc0df commit d031bb4
Show file tree
Hide file tree
Showing 32 changed files with 374 additions and 170 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@
+ Added an option to not show cooldown when ability is ready. - Obsidian
+ Added an option to highlight dungeon perm/vc parties. - Cad
+ Added Glowing Mush Mixin support to the Non-God Pod display. - jani
+ Added options to hide cheap items in item profit trackers. - hannibal2
+ Bazaar Best Sell Method now warns if an unknown bazaar item is detected. - hannibal2
+ SkyHanni position editor hotkey now work outside SkyBlock as well. - hannibal2
+ Dungeon party finder highlight features now works outside Dungeon Hub as well. - hannibal2

### Fixes

Expand Down Expand Up @@ -214,6 +218,7 @@
+ Fixed sixth visitor warning title showing when disabled. - alexia
+ Show not revealed brackets in the Jacob Contest time needed display. - hannibal2
+ Fixed wrong Rancher Boots item stack size color in combination with Black Cat or Racing Helmet.- hannibal2
+ Fixed showing medal icons in Jacob inventory. - hannibal2

#### Bingo Fixes

Expand All @@ -233,6 +238,7 @@
+ Fixed Water Hydra warning showing up multiple times. - Cad
+ Fixed Shark Message missing a color code. - jani
+ Fixed /shresetfishingtracker description - absterge
+ Fixed barn fishing reset hotkey triggering while inside a GUI. - hannibal2

#### Diana Fixes

Expand All @@ -245,6 +251,10 @@
+ Fixed an error message on /pt. - nea
+ Fixed the fire sale filter when a rune is selling. - j10a1n15

#### Dungeon Fixes

+ Fixed Hide Healer Fairy. - hannibal2

#### Misc Fixes

+ Fixed Item Tracker not ignoring manual sack movements. - hannibal2
Expand All @@ -264,6 +274,8 @@
+ Fixed kick alert triggering instantly. - alexia
+ Fixed daily boss kill detection in Crimson Isle Reputation Helper. - hannibal2
+ Fixed Estimated Item Value error in Jerry's Island Deliveries menu. - hannibal2
+ Fixed the /gfs command counting in the Slayer Profit Tracker. - hannibal2
+ Fixed the Fire Veil effect and item ability cooldown not working when clicking in the air. - hannibal2

#### Config Fixes

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ our [Discord](https://discord.gg/skyhanni-997079228510117908).
If you are interested in the technical side of SkyHanni, read
the [Contributing Guide](https://github.com/hannibal002/SkyHanni/blob/beta/CONTRIBUTING.md).

Please support me on [Patreon](https://www.patreon.com/hannibal2).
(*Guys I need money to eat* ~Forrick)


*Check out some other really cool 1.8.9 mods [here](https://sbmw.ca/mod-lists/skyblock-mod-list/)*
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
}

group = "at.hannibal2.skyhanni"
version = "0.22.Beta.15"
version = "0.22.Beta.16"

val gitHash by lazy {
val baos = ByteArrayOutputStream()
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import at.hannibal2.skyhanni.data.SlayerAPI
import at.hannibal2.skyhanni.data.TitleData
import at.hannibal2.skyhanni.data.TitleManager
import at.hannibal2.skyhanni.data.ToolTipData
import at.hannibal2.skyhanni.data.TrackerManager
import at.hannibal2.skyhanni.data.jsonobjects.local.FriendsJson
import at.hannibal2.skyhanni.data.jsonobjects.local.JacobContestsJson
import at.hannibal2.skyhanni.data.jsonobjects.local.KnownFeaturesJson
Expand Down Expand Up @@ -361,7 +362,7 @@ import org.apache.logging.log4j.Logger
clientSideOnly = true,
useMetadata = true,
guiFactory = "at.hannibal2.skyhanni.config.ConfigGuiForgeInterop",
version = "0.22.Beta.15",
version = "0.22.Beta.16",
)
class SkyHanniMod {
@Mod.EventHandler
Expand Down Expand Up @@ -416,6 +417,7 @@ class SkyHanniMod {
loadModule(AdvancedPlayerList)
loadModule(ItemAddManager())
loadModule(BingoCardReader())
loadModule(TrackerManager)

// APIs
loadModule(BazaarApi())
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/at/hannibal2/skyhanni/config/Features.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
public class Features extends Config {
public static final ResourceLocation DISCORD = new ResourceLocation("notenoughupdates:social/discord.png");
public static final ResourceLocation GITHUB = new ResourceLocation("notenoughupdates:social/github.png");
public static final ResourceLocation PATREON = new ResourceLocation("notenoughupdates:social/patreon.png");

@Override
public boolean shouldAutoFocusSearchbar() {
Expand All @@ -45,8 +46,9 @@ public boolean shouldAutoFocusSearchbar() {
@Override
public List<Social> getSocials() {
return Arrays.asList(
Social.forLink("Join our Discord", DISCORD, "https://discord.com/invite/skyhanni-997079228510117908"),
Social.forLink("Look at the code", GITHUB, "https://github.com/hannibal002/SkyHanni")
Social.forLink("Discord", DISCORD, "https://discord.com/invite/skyhanni-997079228510117908"),
Social.forLink("GitHub", GITHUB, "https://github.com/hannibal002/SkyHanni"),
Social.forLink("Patreon", PATREON, "https://www.patreon.com/hannibal2")
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/at/hannibal2/skyhanni/config/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ public static class GardenStorage {
public Map<CropType, Boolean> toolWithBountiful = new HashMap<>();

@Expose
public String composterCurrentOrganicMatterItem = "";
public NEUInternalName composterCurrentOrganicMatterItem = NEUInternalName.Companion.getNONE();

@Expose
public String composterCurrentFuelItem = "";
public NEUInternalName composterCurrentFuelItem = NEUInternalName.Companion.getNONE();

@Expose
public int uniqueVisitors = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ public class InventoryConfig {
@FeatureToggle
public boolean highlightAuctions = true;

@Expose
@ConfigOption(name = "Highlight Underbid Auctions",
desc = "Highlight underbid own lowest BIN auctions that are outbid.")
@ConfigEditorBoolean
@FeatureToggle
public boolean highlightAuctionsUnderbid = false;

@Expose
@ConfigOption(name = "Copy Underbid Price",
desc = "Copies the price of an item in the \"Create BIN Auction\" minus 1 coin into the clipboard for faster under-bidding.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ public String toString() {
@Expose
@ConfigOption(name = "Item Warnings", desc = "Item Warnings")
@Accordion
public TrackerWarningConfig warnings = new TrackerWarningConfig();
public TrackerItemWarningsConfig warnings = new TrackerItemWarningsConfig();

public static class TrackerWarningConfig {
public static class TrackerItemWarningsConfig {

@Expose
@ConfigOption(name = "Price in Chat", desc = "Show an extra chat message when you pick up an expensive item. " +
Expand All @@ -96,4 +96,28 @@ public static class TrackerWarningConfig {
@ConfigEditorSlider(minValue = 1, maxValue = 50_000_000, minStep = 1)
public int minimumTitle = 5_000_000;
}

@Expose
@ConfigOption(name = "Hide Cheap Items", desc = "Hide cheap items.")
@Accordion
public HideCheapItemsConfig hideCheapItems = new HideCheapItemsConfig();

public static class HideCheapItemsConfig {

@Expose
@ConfigOption(name = "Enabled", desc = "Limit how many items should be shown.")
@ConfigEditorBoolean
public Property<Boolean> enabled = Property.of(true);

@Expose
@ConfigOption(name = "Show Expensive #", desc = "Always show the # most expensive items.")
@ConfigEditorSlider(minValue = 1, maxValue = 40, minStep = 1)
public Property<Integer> alwaysShowBest = Property.of(8);

@Expose
@ConfigOption(name = "Still Show Above", desc = "Always show items above this §6price in 1k §7even when not in the top # of items.")
@ConfigEditorSlider(minValue = 5, maxValue = 500, minStep = 5)
public Property<Integer> minPrice = Property.of(100);

}
}
2 changes: 1 addition & 1 deletion src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GuiEditManager {

@SubscribeEvent
fun onKeyClick(event: LorenzKeyPressEvent) {
if (!LorenzUtils.inSkyBlock) return
if (!LorenzUtils.onHypixel) return
if (event.keyCode != SkyHanniMod.feature.gui.keyBindOpen) return
if (isInGui()) return

Expand Down
14 changes: 7 additions & 7 deletions src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import at.hannibal2.skyhanni.utils.toLorenzVec
import net.minecraft.client.Minecraft
import net.minecraft.network.play.client.C07PacketPlayerDigging
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement
import net.minecraft.network.play.client.C0APacketAnimation
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.InputEvent
import org.lwjgl.input.Mouse
Expand All @@ -20,17 +19,18 @@ class ItemClickData {
@SubscribeEvent
fun onItemClickSend(event: PacketEvent.SendEvent) {
val packet = event.packet
if (packet is C08PacketPlayerBlockPlacement && packet.placedBlockDirection != 255) {
val position = packet.position.toLorenzVec()
BlockClickEvent(ClickType.RIGHT_CLICK, position, packet.stack).postAndCatch()
if (packet is C08PacketPlayerBlockPlacement) {
if (packet.placedBlockDirection != 255) {
val position = packet.position.toLorenzVec()
BlockClickEvent(ClickType.RIGHT_CLICK, position, packet.stack).postAndCatch()
} else {
ItemClickEvent(InventoryUtils.getItemInHand(), ClickType.RIGHT_CLICK).postAndCatch()
}
}
if (packet is C07PacketPlayerDigging && packet.status == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) {
val position = packet.position.toLorenzVec()
BlockClickEvent(ClickType.LEFT_CLICK, position, InventoryUtils.getItemInHand()).postAndCatch()
}
if (packet is C0APacketAnimation) {
ItemClickEvent(InventoryUtils.getItemInHand()).postAndCatch()
}
}

@SubscribeEvent
Expand Down
21 changes: 20 additions & 1 deletion src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.data

import at.hannibal2.skyhanni.events.GuiContainerEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.OwnInventoryItemUpdateEvent
Expand All @@ -9,10 +10,13 @@ import at.hannibal2.skyhanni.events.entity.ItemAddInInventoryEvent
import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull
import at.hannibal2.skyhanni.utils.ItemUtils.getItemName
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.addOrPut
import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import net.minecraft.client.Minecraft
import net.minecraft.network.play.server.S0DPacketCollectItem
import net.minecraft.network.play.server.S2FPacketSetSlot
Expand All @@ -24,6 +28,10 @@ import kotlin.time.Duration.Companion.milliseconds
class OwnInventoryData {
private var itemAmounts = mapOf<NEUInternalName, Int>()
private var dirty = false
private val sackToInventoryChatPattern by RepoPattern.pattern(
"data.owninventory.chat.movedsacktoinventory",
"§aMoved §r§e\\d* (?<name>.*)§r§a from your Sacks to your inventory."
)

@SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true)
fun onChatPacket(event: PacketEvent.ReceiveEvent) {
Expand Down Expand Up @@ -96,6 +104,14 @@ class OwnInventoryData {
ignoreItem(500.milliseconds) { true }
}

@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
sackToInventoryChatPattern.matchMatcher(event.message) {
val name = group("name")
ignoreItem(500.milliseconds) { it.getItemName().contains(name) }
}
}

private fun ignoreItem(duration: Duration, condition: (NEUInternalName) -> Boolean) {
ignoredItemsUntil.add(IgnoredItem(condition, SimpleTimeMark.now() + duration))
}
Expand All @@ -109,7 +125,10 @@ class OwnInventoryData {
if (diffWorld < 3_000) return

ignoredItemsUntil.removeIf { it.blockedUntil.isInPast() }
if (ignoredItemsUntil.any { it.condition(internalName) }) return
if (ignoredItemsUntil.any { it.condition(internalName) }) {
// println("ignored: $internalName")
return
}

if (internalName.startsWith("MAP-")) return

Expand Down
37 changes: 37 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/data/TrackerManager.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package at.hannibal2.skyhanni.data

import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.ConfigLoadEvent
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.utils.LorenzUtils
import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent

object TrackerManager {

private var hasChanged = false
var dirty = false

@SubscribeEvent
fun onConfigLoad(event: ConfigLoadEvent) {
val config = SkyHanniMod.feature.misc.tracker.hideCheapItems
LorenzUtils.onToggle(config.alwaysShowBest, config.minPrice, config.enabled) {
hasChanged = true
}
}

@SubscribeEvent(priority = EventPriority.HIGHEST)
fun onRenderOverlayFirst(event: GuiRenderEvent) {
if (hasChanged) {
dirty = true
}
}

@SubscribeEvent(priority = EventPriority.LOWEST)
fun onRenderOverlayLast(event: GuiRenderEvent) {
if (hasChanged) {
dirty = false
hasChanged = false
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.data.jsonobjects.repo;

import at.hannibal2.skyhanni.features.garden.CropType;
import at.hannibal2.skyhanni.utils.NEUInternalName;
import at.hannibal2.skyhanni.utils.LorenzRarity;
import at.hannibal2.skyhanni.utils.LorenzVec;
import com.google.gson.annotations.Expose;
Expand All @@ -23,10 +24,10 @@ public class GardenJson {
public Map<String, GardenVisitor> visitors;

@Expose
public Map<String, Double> organic_matter;
public Map<NEUInternalName, Double> organic_matter;

@Expose
public Map<String, Double> fuel;
public Map<NEUInternalName, Double> fuel;

public static class GardenVisitor {
@Expose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package at.hannibal2.skyhanni.events

import at.hannibal2.skyhanni.utils.NEUInternalName

class BazaarOpenedProductEvent(val openedProduct: NEUInternalName, val inventoryOpenEvent: InventoryFullyOpenedEvent) :
LorenzEvent()
class BazaarOpenedProductEvent(val openedProduct: NEUInternalName?, val inventoryOpenEvent: InventoryFullyOpenedEvent) :
LorenzEvent()
3 changes: 2 additions & 1 deletion src/main/java/at/hannibal2/skyhanni/events/ItemClickEvent.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.events

import at.hannibal2.skyhanni.data.ClickType
import net.minecraft.item.ItemStack

class ItemClickEvent(val itemInHand: ItemStack?) : LorenzEvent()
class ItemClickEvent(val itemInHand: ItemStack?, val clickType: ClickType) : LorenzEvent()
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ class BazaarApi {
fun onInventoryOpen(event: InventoryFullyOpenedEvent) {
inBazaarInventory = checkIfInBazaar(event)
if (inBazaarInventory) {
val openedProduct = getOpenedProduct(event.inventoryItems) ?: return
val itemName = getOpenedProduct(event.inventoryItems) ?: return
val openedProduct = NEUItems.getInternalNameOrNull(itemName)
currentlyOpenedProduct = openedProduct
BazaarOpenedProductEvent(openedProduct, event).postAndCatch()
}
}

private fun getOpenedProduct(inventoryItems: Map<Int, ItemStack>): NEUInternalName? {
private fun getOpenedProduct(inventoryItems: Map<Int, ItemStack>): String? {
val buyInstantly = inventoryItems[10] ?: return null

if (buyInstantly.displayName != "§aBuy Instantly") return null
val bazaarItem = inventoryItems[13] ?: return null

val itemName = bazaarItem.displayName
return NEUItems.getInternalNameOrNull(itemName)
return bazaarItem.displayName
}

@SubscribeEvent
Expand Down
Loading

0 comments on commit d031bb4

Please sign in to comment.