diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-07 07:12:36 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-07 07:12:36 +0100 |
commit | e7f3e850c9cf5ddf0f4d93a25c92d3e45a279bf6 (patch) | |
tree | c5d8cbff44428f97276eb7bd22568c3f9b02bba3 /src/main/java/at/hannibal2/skyhanni/features/misc | |
parent | 6b253a8ac2cdb03a67f111725c263dd84532f989 (diff) | |
download | skyhanni-e7f3e850c9cf5ddf0f4d93a25c92d3e45a279bf6.tar.gz skyhanni-e7f3e850c9cf5ddf0f4d93a25c92d3e45a279bf6.tar.bz2 skyhanni-e7f3e850c9cf5ddf0f4d93a25c92d3e45a279bf6.zip |
Add Brewing Stand Overlay.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/BrewingStandOverlay.kt | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/BrewingStandOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/BrewingStandOverlay.kt new file mode 100644 index 000000000..6496e3d4c --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/BrewingStandOverlay.kt @@ -0,0 +1,39 @@ +package at.hannibal2.skyhanni.features.misc + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent +import at.hannibal2.skyhanni.utils.ItemUtils.name +import at.hannibal2.skyhanni.utils.LorenzUtils +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class BrewingStandOverlay { + + @SubscribeEvent + fun onRenderItemTip(event: RenderInventoryItemTipEvent) { + if (!LorenzUtils.inSkyBlock) return + if (!SkyHanniMod.feature.misc.brewingStandOverlay) return + + if (event.inventoryName != "Brewing Stand") return + + val stack = event.stack + val name = stack.name ?: return + + when (event.slot.slotNumber) { + 13, // Ingredient input + 21, // Progress + 42, // Output right side + -> { + } + + else -> return + } + + // Hide the progress slot when not active + if (name.contains(" or ")) return + + event.stackTip = name + event.offsetX = 3 + event.offsetY = -5 + event.alignLeft = false + } +}
\ No newline at end of file |