diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-03 00:53:18 +0100 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-03 00:53:18 +0100 |
| commit | aeca29914fd8995c575d847c97376a49b0481e10 (patch) | |
| tree | 4f9c26e44bcac9c77c9c0ff57e1eca654f44d997 /src/main/java/at/hannibal2/skyhanni/features | |
| parent | 859f837fa0573c335c5249da5c08eac13968a6df (diff) | |
| download | skyhanni-aeca29914fd8995c575d847c97376a49b0481e10.tar.gz skyhanni-aeca29914fd8995c575d847c97376a49b0481e10.tar.bz2 skyhanni-aeca29914fd8995c575d847c97376a49b0481e10.zip | |
Highlight stuff that is missing in the skyblock level guide inventory.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/SkyBLockLevelGuideHelper.kt | 40 | ||||
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt | 6 |
2 files changed, 46 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyBLockLevelGuideHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyBLockLevelGuideHelper.kt new file mode 100644 index 000000000..634aa5758 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyBLockLevelGuideHelper.kt @@ -0,0 +1,40 @@ +package at.hannibal2.skyhanni.features.inventory + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.ItemUtils.name +import at.hannibal2.skyhanni.utils.LorenzColor +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.RenderUtils.highlight +import net.minecraft.client.gui.inventory.GuiChest +import net.minecraft.inventory.ContainerChest +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class SkyBLockLevelGuideHelper { + + @SubscribeEvent + fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { + if (!LorenzUtils.inSkyBlock) return + if (!SkyHanniMod.feature.inventory.highlightMissingSkyBlockLevelGuide) return + + if (InventoryUtils.openInventoryName().contains("Guide ➜")) { + + if (event.gui !is GuiChest) return + val guiChest = event.gui + val chest = guiChest.inventorySlots as ContainerChest + + for (slot in chest.inventorySlots) { + if (slot == null) continue + if (slot.slotNumber != slot.slotIndex) continue + val name = slot.stack?.name ?: continue + + if (name.startsWith("§a✔")) { +// slot highlight LorenzColor.GREEN + } else if (name.startsWith("§c✖")) { + slot highlight LorenzColor.RED + } + } + } + } +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt index 088836401..275e7173d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.ProfileApiDataLoadedEvent +import at.hannibal2.skyhanni.events.ProfileJoinEvent import at.hannibal2.skyhanni.features.bazaar.BazaarApi import at.hannibal2.skyhanni.features.bazaar.BazaarData import at.hannibal2.skyhanni.utils.InventoryUtils @@ -157,6 +158,11 @@ class CollectionCounter { } @SubscribeEvent + fun onProfileJoin(event: ProfileJoinEvent) { + apiCollectionData.clear() + } + + @SubscribeEvent fun onProfileDataLoad(event: ProfileApiDataLoadedEvent) { val profileData = event.profileData |
