diff options
author | nea <romangraef@gmail.com> | 2022-02-08 13:28:46 +0100 |
---|---|---|
committer | nea <romangraef@gmail.com> | 2022-02-08 13:28:46 +0100 |
commit | e5067247aea96304d02875ebe1cb348eb7173360 (patch) | |
tree | 55ad5f847ce910b045bcc255c0956e42cc69cc1e | |
parent | 73d441245e33461f5ee9e2f44bfc15891f50f9c1 (diff) | |
download | NotEnoughUpdates-e5067247aea96304d02875ebe1cb348eb7173360.tar.gz NotEnoughUpdates-e5067247aea96304d02875ebe1cb348eb7173360.tar.bz2 NotEnoughUpdates-e5067247aea96304d02875ebe1cb348eb7173360.zip |
Fix Enchanting GUIfix-enchanting_gui
im sowwy
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java | 16 | ||||
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java | 6 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index d7061c22..80795044 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -20,7 +20,6 @@ import io.github.moulberry.notenoughupdates.miscgui.*; import io.github.moulberry.notenoughupdates.options.NEUConfig; import io.github.moulberry.notenoughupdates.overlays.*; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; -import io.github.moulberry.notenoughupdates.recipes.CraftingOverlay; import io.github.moulberry.notenoughupdates.util.*; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.*; @@ -53,14 +52,15 @@ import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; -import javax.swing.*; -import java.awt.*; +import javax.swing.JOptionPane; +import javax.swing.JTextField; +import java.awt.Color; +import java.awt.Toolkit; import java.awt.datatransfer.StringSelection; import java.io.File; import java.io.IOException; import java.text.DecimalFormat; import java.text.NumberFormat; -import java.util.List; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -1141,9 +1141,13 @@ public class NEUEventListener { String containerName = null; GuiScreen guiScreen = Minecraft.getMinecraft().currentScreen; + if (guiScreen instanceof GuiChest) { + GuiChest eventGui = (GuiChest) guiScreen; + ContainerChest cc = (ContainerChest) eventGui.inventorySlots; + containerName = cc.getLowerChestInventory().getDisplayName().getUnformattedText(); - if (GuiCustomEnchant.getInstance().shouldOverride(containerName)) { - return; + if (GuiCustomEnchant.getInstance().shouldOverride(containerName)) + return; } boolean tradeWindowActive = TradeWindow.tradeWindowActive(containerName); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java index 71915b8d..c68f02fc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java @@ -1,7 +1,6 @@ package io.github.moulberry.notenoughupdates.miscgui; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; @@ -200,9 +199,8 @@ public class GuiCustomEnchant extends Gui { public boolean shouldOverride(String containerName) { shouldOverrideFast = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI && - containerName != null && - NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() && - containerName.equalsIgnoreCase("Enchant Item"); + Objects.equals("Enchant Item", containerName) && + NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard(); if (!shouldOverrideFast) { currentState = EnchantState.NO_ITEM; applicable.clear(); |