diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt index 4df8fc90a..2f65a9906 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt @@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.utils.ItemBlink import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.SoundUtils import io.github.moulberry.notenoughupdates.util.MinecraftExecutor @@ -17,6 +18,8 @@ import kotlin.time.Duration.Companion.seconds class WildStrawberryDyeNotification { var lastCloseTime = 0L + val item by lazy { "DYE_WILD_STRAWBERRY".asInternalName() } + @SubscribeEvent fun onCloseWindow(event: GuiContainerEvent.CloseWindowEvent) { lastCloseTime = System.currentTimeMillis() @@ -34,7 +37,7 @@ class WildStrawberryDyeNotification { if (diff < 1_000) return@execute val internalName = event.itemStack.getInternalName() - if (internalName.equals("DYE_WILD_STRAWBERRY")) { + if (internalName == item) { val name = event.itemStack.name!! LorenzUtils.sendTitle(name, 5.seconds) LorenzUtils.chat("§e[SkyHanni] You found a $name§e!") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt index 39482850b..11318553c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt @@ -9,7 +9,7 @@ import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils.chat -import at.hannibal2.skyhanni.utils.NEUItems +import at.hannibal2.skyhanni.utils.NEUItems.getItemStack import io.github.moulberry.notenoughupdates.events.ReplaceItemEvent import io.github.moulberry.notenoughupdates.events.SlotClickEvent import io.github.moulberry.notenoughupdates.util.Utils @@ -47,7 +47,7 @@ object GardenPlotIcon { val plotList = plotList ?: return for ((index, internalName) in plotList) { val old = originalStack[index]!! - val new = NEUItems.getItemStack(internalName) + val new = internalName.getItemStack() cachedStack[index] = Utils.editItemStackInfo(new, old.displayName, true, *old.getLore().toTypedArray()) } } @@ -118,7 +118,7 @@ object GardenPlotIcon { return } val copyStack = copyStack ?: return - plotList[event.slotId] = copyStack.getInternalName().asString() + plotList[event.slotId] = copyStack.getInternalName() cachedStack[event.slotId] = copyStack } } |