From 4ef743bb299b7b23fed92ade7313f0abb3170c61 Mon Sep 17 00:00:00 2001 From: Caedis Date: Wed, 1 May 2024 08:58:42 -0500 Subject: [PATCH] Revert "hold the shift to stop sort items (#188)" + update deps (#206) * Revert "hold the shift to stop sort items (#188)" This reverts commit 0bf904f2a4e8a3c8d818fae5a5ff3d47e08450ea. * update deps * remove extra file --- dependencies.gradle | 14 +++--- .../github/client/gui/base/FCGuiMonitor.java | 10 ---- .../github/client/me/EssentiaRepo.java | 36 +++++++------- .../glodblock/github/client/me/FluidRepo.java | 48 +++++++------------ 4 files changed, 39 insertions(+), 69 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index f01b12dd8..6463660b9 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -34,8 +34,8 @@ * For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph */ dependencies { - api('com.github.GTNewHorizons:NotEnoughItems:2.5.25-GTNH:dev') - api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-349-GTNH:dev') + api('com.github.GTNewHorizons:NotEnoughItems:2.5.27-GTNH:dev') + api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-352-GTNH:dev') api('curse.maven:cofh-core-69162:2388751') api('com.github.GTNewHorizons:waila:1.7.3:dev') @@ -45,15 +45,15 @@ dependencies { compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.34:dev') { transitive = false } compileOnly('com.github.GTNewHorizons:ForestryMC:4.8.9:dev') - compileOnly('com.github.GTNewHorizons:EnderIO:2.7.3:dev') - compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.153:dev') { + compileOnly('com.github.GTNewHorizons:EnderIO:2.7.4:dev') + compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.00:dev') { exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework' } compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false } - compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.10-GTNH:dev') { transitive = false } - compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.4-GTNH:dev') { transitive = false } - compileOnly("com.github.GTNewHorizons:Hodgepodge:2.4.42:dev") { transitive = false } + compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.11-GTNH:dev') { transitive = false } + compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.5-GTNH:dev') { transitive = false } + compileOnly("com.github.GTNewHorizons:Hodgepodge:2.4.43:dev") { transitive = false } runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.2.3:dev") } diff --git a/src/main/java/com/glodblock/github/client/gui/base/FCGuiMonitor.java b/src/main/java/com/glodblock/github/client/gui/base/FCGuiMonitor.java index 1e3dad161..a83be84ed 100644 --- a/src/main/java/com/glodblock/github/client/gui/base/FCGuiMonitor.java +++ b/src/main/java/com/glodblock/github/client/gui/base/FCGuiMonitor.java @@ -778,14 +778,4 @@ public boolean hideItemPanelSlot(int tx, int ty, int tw, int th) { public boolean isOverTextField(int mousex, int mousey) { return searchField.isMouseIn(mousex, mousey); } - - @Override - public void handleKeyboardInput() { - super.handleKeyboardInput(); - hasShiftKeyDown |= isShiftKeyDown(); - if (hasShiftKeyDown && !Keyboard.getEventKeyState()) { // keyup - this.repo.updateView(); - hasShiftKeyDown = false; - } - } } diff --git a/src/main/java/com/glodblock/github/client/me/EssentiaRepo.java b/src/main/java/com/glodblock/github/client/me/EssentiaRepo.java index aadfd4f88..fe8496cdf 100644 --- a/src/main/java/com/glodblock/github/client/me/EssentiaRepo.java +++ b/src/main/java/com/glodblock/github/client/me/EssentiaRepo.java @@ -29,7 +29,7 @@ public EssentiaRepo(final IScrollSource src, final ISortSource sortSrc) { @Override public void updateView() { - if (needUpdateView()) this.view.clear(); + this.view.clear(); this.dsp.clear(); this.view.ensureCapacity(this.list.size()); @@ -58,7 +58,7 @@ public void updateView() { } } - for (IAEItemStack is : needUpdateView() ? this.list : this.cache) { + for (IAEItemStack is : this.list) { if (this.myPartitionList != null) { if (!this.myPartitionList.isListed(is)) { continue; @@ -87,30 +87,26 @@ public void updateView() { this.view.add(is); } } - if (needUpdateView()) { - final Enum SortBy = this.sortSrc.getSortBy(); - final Enum SortDir = this.sortSrc.getSortDir(); - - FluidSorters.setDirection((appeng.api.config.SortDir) SortDir); - FluidSorters.init(); - - if (SortBy == SortOrder.MOD) { - this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_MOD); - } else if (SortBy == SortOrder.AMOUNT) { - this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_SIZE); - } else if (SortBy == SortOrder.INVTWEAKS) { - this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_INV_TWEAKS); - } else { - this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_NAME); - } + + final Enum SortBy = this.sortSrc.getSortBy(); + final Enum SortDir = this.sortSrc.getSortDir(); + + FluidSorters.setDirection((appeng.api.config.SortDir) SortDir); + FluidSorters.init(); + + if (SortBy == SortOrder.MOD) { + this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_MOD); + } else if (SortBy == SortOrder.AMOUNT) { + this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_SIZE); + } else if (SortBy == SortOrder.INVTWEAKS) { + this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_INV_TWEAKS); } else { - this.cache.clear(); + this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_NAME); } for (final IAEItemStack is : this.view) { this.dsp.add(is.getItemStack()); } - this.lastSearchString = this.searchString; Iterator it1 = this.view.iterator(); while (it1.hasNext()) { IAEFluidStack fluid = ItemFluidDrop.getAeFluidStack(it1.next()); diff --git a/src/main/java/com/glodblock/github/client/me/FluidRepo.java b/src/main/java/com/glodblock/github/client/me/FluidRepo.java index a3acb4f5d..02b5405d6 100644 --- a/src/main/java/com/glodblock/github/client/me/FluidRepo.java +++ b/src/main/java/com/glodblock/github/client/me/FluidRepo.java @@ -10,8 +10,6 @@ package com.glodblock.github.client.me; -import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown; - import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.ArrayList; @@ -47,14 +45,12 @@ public class FluidRepo implements IDisplayRepo { protected final IItemList list = AEApi.instance().storage().createItemList(); protected final ArrayList view = new ArrayList<>(); protected final ArrayList dsp = new ArrayList<>(); - protected final ArrayList cache = new ArrayList<>(); protected final IScrollSource src; protected final ISortSource sortSrc; protected int rowSize = 9; protected String searchString = ""; - protected String lastSearchString = ""; protected IPartitionList myPartitionList; private String NEIWord = null; private boolean hasPower; @@ -90,19 +86,11 @@ public void postUpdate(final IAEItemStack is) { if (st != null) { st.reset(); st.add(is); - if (isShiftKeyDown() && this.view.contains(st)) { - this.view.get(this.view.indexOf(st)).setStackSize(st.getStackSize()); - } } else { - if (isShiftKeyDown()) this.cache.add(is); this.list.add(is); } } - protected boolean needUpdateView() { - return !isShiftKeyDown() || !this.lastSearchString.equals(this.searchString); - } - @Override public void setViewCell(final ItemStack[] list) { this.myPartitionList = ItemViewCell.createFilter(list); @@ -111,7 +99,7 @@ public void setViewCell(final ItemStack[] list) { @Override public void updateView() { - if (needUpdateView()) this.view.clear(); + this.view.clear(); this.dsp.clear(); this.view.ensureCapacity(this.list.size()); @@ -142,7 +130,7 @@ public void updateView() { } } - for (IAEItemStack is : needUpdateView() ? this.list : this.cache) { + for (IAEItemStack is : this.list) { if (this.myPartitionList != null) { if (!this.myPartitionList.isListed(is)) { continue; @@ -179,30 +167,26 @@ public void updateView() { } } } - if (needUpdateView()) { - final Enum SortBy = this.sortSrc.getSortBy(); - final Enum SortDir = this.sortSrc.getSortDir(); - - FluidSorters.setDirection((appeng.api.config.SortDir) SortDir); - FluidSorters.init(); - - if (SortBy == SortOrder.MOD) { - this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_MOD); - } else if (SortBy == SortOrder.AMOUNT) { - this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_SIZE); - } else if (SortBy == SortOrder.INVTWEAKS) { - this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_INV_TWEAKS); - } else { - this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_NAME); - } + + final Enum SortBy = this.sortSrc.getSortBy(); + final Enum SortDir = this.sortSrc.getSortDir(); + + FluidSorters.setDirection((appeng.api.config.SortDir) SortDir); + FluidSorters.init(); + + if (SortBy == SortOrder.MOD) { + this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_MOD); + } else if (SortBy == SortOrder.AMOUNT) { + this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_SIZE); + } else if (SortBy == SortOrder.INVTWEAKS) { + this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_INV_TWEAKS); } else { - this.cache.clear(); + this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_NAME); } for (final IAEItemStack is : this.view) { this.dsp.add(is.getItemStack()); } - this.lastSearchString = this.searchString; } protected void updateNEI(final String filter) {