diff options
| author | BuildTools <james.jenour@protonmail.com> | 2021-07-22 15:40:21 +0800 |
|---|---|---|
| committer | BuildTools <james.jenour@protonmail.com> | 2021-07-22 15:40:21 +0800 |
| commit | c1c4562b42d53ec2e8885c48f97249d7768fe1c7 (patch) | |
| tree | 407c4dccbc2c9f0b89e3b211f102e48fc8af1bfa /src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java | |
| parent | ff2829153c14e0f7ca655bfd4ef64bffae3212b2 (diff) | |
| download | notenoughupdates-c1c4562b42d53ec2e8885c48f97249d7768fe1c7.tar.gz notenoughupdates-c1c4562b42d53ec2e8885c48f97249d7768fe1c7.tar.bz2 notenoughupdates-c1c4562b42d53ec2e8885c48f97249d7768fe1c7.zip | |
PRE29.05
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java | 16 |
1 files changed, 10 insertions, 6 deletions
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 d32d74af..2707c7ab 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java @@ -10,6 +10,7 @@ import io.github.moulberry.notenoughupdates.core.GuiElementTextField; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingFloat; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingInteger; import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking; +import io.github.moulberry.notenoughupdates.options.NEUConfig; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; @@ -199,10 +200,8 @@ public class GuiCustomEnchant extends Gui { } public boolean shouldOverride(String containerName) { - shouldOverrideFast = false; - if(true) return shouldOverrideFast; - - shouldOverrideFast = containerName != null && + shouldOverrideFast = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI && + containerName != null && NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() && containerName.equalsIgnoreCase("Enchant Item"); if(!shouldOverrideFast) { @@ -467,8 +466,13 @@ public class GuiCustomEnchant extends Gui { } } } - removable.sort(Comparator.comparingInt(e -> e.xpCost)); - applicable.sort(Comparator.comparingInt(e -> e.xpCost)); + NEUConfig cfg = NotEnoughUpdates.INSTANCE.config; + int mult = cfg.enchantingSolvers.enchantOrdering == 0 ? 1 : -1; + Comparator<Enchantment> comparator = cfg.enchantingSolvers.enchantSorting == 0 ? + Comparator.comparingInt(e -> mult*e.xpCost) : + (c1, c2) -> mult*c1.enchId.toLowerCase().compareTo(c2.enchId.toLowerCase()); + removable.sort(comparator); + applicable.sort(comparator); } } } |
