From 0bf904f2a4e8a3c8d818fae5a5ff3d47e08450ea Mon Sep 17 00:00:00 2001 From: asdflj <33802162+asdflj@users.noreply.github.com> Date: Tue, 2 Jan 2024 18:45:23 +0800 Subject: [PATCH 1/2] hold the shift to stop sort items (#188) Co-authored-by: zy <854865755@163.com> --- dependencies.gradle | 2 +- .../github/client/gui/base/FCGuiMonitor.java | 11 +++++ .../github/client/me/EssentiaRepo.java | 36 +++++++------- .../glodblock/github/client/me/FluidRepo.java | 48 ++++++++++++------- 4 files changed, 64 insertions(+), 33 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index fd8d7780b..905ec6a75 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -35,7 +35,7 @@ */ dependencies { api('com.github.GTNewHorizons:NotEnoughItems:2.4.13-GTNH:dev') - api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-306-GTNH:dev') + api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-307-GTNH:dev') api('curse.maven:cofh-core-69162:2388751') api('com.github.GTNewHorizons:waila:1.6.5: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 0919d0225..f331106b0 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 @@ -101,6 +101,7 @@ public abstract class FCGuiMonitor> extends FCBaseMEGui protected GuiImgButton terminalStyleBox; protected GuiImgButton searchStringSave; protected GuiImgButton typeFilter; + protected boolean hasShiftKeyDown = false; @SuppressWarnings("unchecked") public FCGuiMonitor(final InventoryPlayer inventoryPlayer, final ITerminalHost te, final FCContainerMonitor c) { @@ -772,4 +773,14 @@ 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 fe8496cdf..aadfd4f88 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() { - this.view.clear(); + if (needUpdateView()) this.view.clear(); this.dsp.clear(); this.view.ensureCapacity(this.list.size()); @@ -58,7 +58,7 @@ public void updateView() { } } - for (IAEItemStack is : this.list) { + for (IAEItemStack is : needUpdateView() ? this.list : this.cache) { if (this.myPartitionList != null) { if (!this.myPartitionList.isListed(is)) { continue; @@ -87,26 +87,30 @@ public void updateView() { this.view.add(is); } } - - 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); + 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); + } } else { - this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_NAME); + this.cache.clear(); } 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 02b5405d6..a3acb4f5d 100644 --- a/src/main/java/com/glodblock/github/client/me/FluidRepo.java +++ b/src/main/java/com/glodblock/github/client/me/FluidRepo.java @@ -10,6 +10,8 @@ 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; @@ -45,12 +47,14 @@ 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; @@ -86,11 +90,19 @@ 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); @@ -99,7 +111,7 @@ public void setViewCell(final ItemStack[] list) { @Override public void updateView() { - this.view.clear(); + if (needUpdateView()) this.view.clear(); this.dsp.clear(); this.view.ensureCapacity(this.list.size()); @@ -130,7 +142,7 @@ public void updateView() { } } - for (IAEItemStack is : this.list) { + for (IAEItemStack is : needUpdateView() ? this.list : this.cache) { if (this.myPartitionList != null) { if (!this.myPartitionList.isListed(is)) { continue; @@ -167,26 +179,30 @@ public void updateView() { } } } - - 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); + 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); + } } else { - this.view.sort(FluidSorters.CONFIG_BASED_SORT_BY_NAME); + this.cache.clear(); } for (final IAEItemStack is : this.view) { this.dsp.add(is.getItemStack()); } + this.lastSearchString = this.searchString; } protected void updateNEI(final String filter) { From 9fc2160965a242d6d51d3bacc1614222e697ac83 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Tue, 2 Jan 2024 11:46:12 +0100 Subject: [PATCH 2/2] update deps+bs --- build.gradle | 31 +++++++++++++------------------ dependencies.gradle | 10 +++++----- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index 50c3291c8..f4f81bd7e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1702141377 +//version: 1704135167 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -31,8 +31,7 @@ buildscript { maven { // GTNH RetroFuturaGradle and ASM Fork name "GTNH Maven" - url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" - allowInsecureProtocol = true + url "https://nexus.gtnewhorizons.com/repository/public/" } mavenLocal() } @@ -49,7 +48,7 @@ plugins { id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle id 'com.github.johnrengelman.shadow' version '8.1.1' apply false id 'com.palantir.git-version' version '3.0.0' apply false - id 'de.undercouch.download' version '5.4.0' + id 'de.undercouch.download' version '5.5.0' id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version id 'com.modrinth.minotaur' version '2.+' apply false @@ -118,7 +117,7 @@ propertyDefaultIfUnset("forceEnableMixins", false) propertyDefaultIfUnset("channel", "stable") propertyDefaultIfUnset("mappingsVersion", "12") propertyDefaultIfUnset("usesMavenPublishing", true) -propertyDefaultIfUnset("mavenPublishUrl", "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases") +propertyDefaultIfUnset("mavenPublishUrl", "https://nexus.gtnewhorizons.com/repository/releases/") propertyDefaultIfUnset("modrinthProjectId", "") propertyDefaultIfUnset("modrinthRelations", "") propertyDefaultIfUnset("curseForgeProjectId", "") @@ -573,13 +572,15 @@ afterEvaluate { repositories { maven { - name 'Overmind forge repo mirror' - url 'https://gregtech.overminddl1.com/' + name = "GTNH Maven" + url = "https://nexus.gtnewhorizons.com/repository/public/" + // Links for convenience: + // Simple HTML browsing: https://nexus.gtnewhorizons.com/service/rest/repository/browse/releases/ + // Rich web UI browsing: https://nexus.gtnewhorizons.com/#browse/browse:releases } maven { - name = "GTNH Maven" - url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" - allowInsecureProtocol = true + name 'Overmind forge repo mirror' + url 'https://gregtech.overminddl1.com/' } maven { name 'sonatype' @@ -960,8 +961,7 @@ if (usesShadowedDependencies.toBoolean()) { configurations.runtimeElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) configurations.apiElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) tasks.named("jar", Jar) { - enabled = false - finalizedBy(tasks.shadowJar) + archiveClassifier.set('dev-preshadow') } tasks.named("reobfJar", ReobfuscatedJar) { inputJar.set(tasks.named("shadowJar", ShadowJar).flatMap({it.archiveFile})) @@ -970,11 +970,6 @@ if (usesShadowedDependencies.toBoolean()) { javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) { skip() } - for (runTask in ["runClient", "runServer", "runClient17", "runServer17"]) { - tasks.named(runTask).configure { - dependsOn("shadowJar") - } - } } ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar ext.publishableObfJar = tasks.reobfJar @@ -1178,7 +1173,7 @@ publishing { if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) { maven { url = mavenPublishUrl - allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven + allowInsecureProtocol = mavenPublishUrl.startsWith("http://") credentials { username = System.getenv("MAVEN_USER") ?: "NONE" password = System.getenv("MAVEN_PASSWORD") ?: "NONE" diff --git a/dependencies.gradle b/dependencies.gradle index 905ec6a75..606d82dd7 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -43,16 +43,16 @@ dependencies { compileOnly('com.github.GTNewHorizons:Baubles:1.0.3:dev') compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.34:dev') { transitive = false } - compileOnly('com.github.GTNewHorizons:ForestryMC:4.7.1:dev') - compileOnly('com.github.GTNewHorizons:EnderIO:2.6.1:dev') - compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.13:dev') { + compileOnly('com.github.GTNewHorizons:ForestryMC:4.8.1:dev') + compileOnly('com.github.GTNewHorizons:EnderIO:2.6.2:dev') + compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.15: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.0-GTNH:dev') { transitive = false } + compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.1-GTNH:dev') { transitive = false } compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.1-GTNH:dev') { transitive = false } - compileOnly("com.github.GTNewHorizons:Hodgepodge:2.4.4:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:Hodgepodge:2.4.5:dev") { transitive = false } runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.1.7:dev") }