From ce968641b42be85e0b308ecb95a435d7b2b97b3d Mon Sep 17 00:00:00 2001 From: DoKM Date: Sat, 21 Aug 2021 18:16:11 +0200 Subject: Fix experimentation table timer detection not working if you finished all experimentations for the day --- .../notenoughupdates/overlays/TimersOverlay.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java index 39bc0b60..baa407c9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java @@ -1,5 +1,6 @@ package io.github.moulberry.notenoughupdates.overlays; +import io.github.moulberry.notenoughupdates.NEUManager; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.config.Position; import io.github.moulberry.notenoughupdates.options.NEUConfig; @@ -13,6 +14,8 @@ import net.minecraft.init.Items; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; @@ -190,11 +193,22 @@ public class TimersOverlay extends TextOverlay { if (stack.getItem() == Items.blaze_powder) { if (hidden.experimentsCompleted == 0) { hidden.experimentsCompleted = currentTime; + return; } - } else { - hidden.experimentsCompleted = 0; } } + ItemStack stackSuperPairs = lower.getStackInSlot(22); + if(stackSuperPairs != null && stackSuperPairs.getItem() == Items.skull && stackSuperPairs.getTagCompound() != null){ + String[] lore = NotEnoughUpdates.INSTANCE.manager.getLoreFromNBT(stackSuperPairs.getTagCompound()); + String text = lore[lore.length-1]; + String cleanText = Utils.cleanColour(text); + if(cleanText.equals("Experiments on cooldown!")){ + hidden.experimentsCompleted = currentTime; + return; + } + } + hidden.experimentsCompleted = 0; + return; } } -- cgit