diff options
author | DoKM <mcazzyman@gmail.com> | 2021-08-21 18:16:11 +0200 |
---|---|---|
committer | DoKM <mcazzyman@gmail.com> | 2021-08-21 18:16:11 +0200 |
commit | ce968641b42be85e0b308ecb95a435d7b2b97b3d (patch) | |
tree | 7d243adfbdb617e870a66d7da959da6a75a9db43 /src | |
parent | fefed35f9af4e2abdedf9d1788d83662171089c8 (diff) | |
download | NotEnoughUpdates-ce968641b42be85e0b308ecb95a435d7b2b97b3d.tar.gz NotEnoughUpdates-ce968641b42be85e0b308ecb95a435d7b2b97b3d.tar.bz2 NotEnoughUpdates-ce968641b42be85e0b308ecb95a435d7b2b97b3d.zip |
Fix experimentation table timer detection not working
if you finished all experimentations for the day
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java | 18 |
1 files changed, 16 insertions, 2 deletions
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; } } |