-
-
Notifications
You must be signed in to change notification settings - Fork 216
/
Copy pathBrewingStandOverlay.kt
45 lines (35 loc) · 1.23 KB
/
BrewingStandOverlay.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package at.hannibal2.skyhanni.features.misc
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.LorenzUtils
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@SkyHanniModule
object 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
val slotNumber = event.slot.slotNumber
when (slotNumber) {
13, // Ingredient input
21, // Progress
42, // Output right side
-> Unit
else -> return
}
if (slotNumber == 21) {
event.offsetX = 55
}
// Hide the progress slot when not active
if (name.contains(" or ")) return
event.stackTip = name
event.offsetX += 3
event.offsetY = -5
event.alignLeft = false
}
}