diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-08-17 09:38:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-17 09:38:24 +0200 |
| commit | 5d2aa40fdee044c0579f426bff279b9d631e306f (patch) | |
| tree | 9596afb42da307f874b0bb06ae5aeeae04465aea /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java | |
| parent | 1d23d88488f1266538275e3c069916c1fec58281 (diff) | |
| download | notenoughupdates-5d2aa40fdee044c0579f426bff279b9d631e306f.tar.gz notenoughupdates-5d2aa40fdee044c0579f426bff279b9d631e306f.tar.bz2 notenoughupdates-5d2aa40fdee044c0579f426bff279b9d631e306f.zip | |
Probably fixing Lag spikes (#229)
* using method getOpenChestName instead of field lastOpenContainerName
* probably fixing lag spikes in power stone stats display
* using new getOpenChestName in EnchantingSolvers
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java index 1032fe16..b1ffcb2d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java @@ -96,20 +96,14 @@ public class EnchantingSolvers { return; } - if (event.gui instanceof GuiChest) { - GuiChest chest = (GuiChest) event.gui; - ContainerChest container = (ContainerChest) chest.inventorySlots; - String containerName = container.getLowerChestInventory().getDisplayName().getUnformattedText(); - String lower = containerName.toLowerCase(); - - if (!lower.contains("stakes")) { - if (lower.startsWith("chronomatron")) { - currentSolver = SolverType.CHRONOMATRON; - } else if (lower.startsWith("ultrasequencer")) { - currentSolver = SolverType.ULTRASEQUENCER; - } else if (lower.startsWith("superpairs")) { - currentSolver = SolverType.SUPERPAIRS; - } + String openChestName = Utils.getOpenChestName(); + if (!openChestName.contains("stakes")) { + if (openChestName.startsWith("chronomatron")) { + currentSolver = SolverType.CHRONOMATRON; + } else if (openChestName.startsWith("ultrasequencer")) { + currentSolver = SolverType.ULTRASEQUENCER; + } else if (openChestName.startsWith("superpairs")) { + currentSolver = SolverType.SUPERPAIRS; } } } |
