From 2f19144a28cfc0fa23cc11d5c2a979072461b220 Mon Sep 17 00:00:00 2001 From: "Sanjay S." Date: Mon, 26 May 2025 17:13:17 -0400 Subject: [PATCH 1/9] Complete implementation of complement PR's changes to main AE2 --- .../common/parts/PartFluidP2PInterface.java | 76 ++++++++++++++++++- .../glodblock/github/proxy/CommonProxy.java | 3 + 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java index 36ff9cb0..27320b85 100644 --- a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java +++ b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java @@ -85,7 +85,6 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic drops) { + if (!isOutput()) { + super.addDrops(drops); + try { + for (PartFluidP2PInterface p2p : getOutputs()) p2p.duality.addDrops(drops); + } catch (GridAccessException e) { + + } + } else { + if (this.getWaitingToSend() != null) { + for (final ItemStack is : this.getWaitingToSend()) { + if (is != null) { + drops.add(is); + } + } + } + + for (final ItemStack is : this.getUpgrades()) { + if (is != null) { + drops.add(is); + } + } + + for (final ItemStack is : this.getPatterns()) { + if (is != null) { + drops.add(is); + } + } + } + } + @Override public int getInstalledUpgrades(Upgrades u) { if (isOutput() && u == Upgrades.PATTERN_CAPACITY) return -1; return super.getInstalledUpgrades(u); } + + @Override + public int getConfigSize() { + if (isOutput()) return -1; + return super.getConfigSize(); + } }; private final DualityFluidInterface dualityFluid = new DualityFluidInterface(this.getProxy(), this); private final AppEngInternalAEInventory config = new AppEngInternalAEInventory(this, 6); diff --git a/src/main/java/com/glodblock/github/proxy/CommonProxy.java b/src/main/java/com/glodblock/github/proxy/CommonProxy.java index f26d32e2..a63661de 100644 --- a/src/main/java/com/glodblock/github/proxy/CommonProxy.java +++ b/src/main/java/com/glodblock/github/proxy/CommonProxy.java @@ -63,6 +63,9 @@ public class CommonProxy { Upgrades.LOCK_CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE), 1); Upgrades.LOCK_CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.INTERFACE), 1); Upgrades.LOCK_CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE_P2P), 1); + Upgrades.FUZZY.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE), 3); + Upgrades.FUZZY.registerItem(new ItemStack(ItemAndBlockHolder.INTERFACE), 3); + Upgrades.FUZZY.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE_P2P), 3); Upgrades.CAPACITY.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_STORAGE_BUS), 5); Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_STORAGE_BUS), 1); Upgrades.STICKY.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_STORAGE_BUS), 1); From a3d5a727376bddde0dbe60bdba7b99f4b20279a9 Mon Sep 17 00:00:00 2001 From: "Sanjay S." Date: Mon, 26 May 2025 17:39:57 -0400 Subject: [PATCH 2/9] Brought `GuiDualInterface` up to date with dependent PR --- .../github/client/gui/GuiDualInterface.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glodblock/github/client/gui/GuiDualInterface.java b/src/main/java/com/glodblock/github/client/gui/GuiDualInterface.java index 4ddc1231..34cb4dbb 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiDualInterface.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiDualInterface.java @@ -17,6 +17,7 @@ import com.glodblock.github.util.ModAndClassUtil; import com.glodblock.github.util.NameConst; import appeng.api.config.AdvancedBlockingMode; +import appeng.api.config.FuzzyMode; import appeng.api.config.InsertionMode; import appeng.api.config.LockCraftingMode; import appeng.api.config.Settings; @@ -43,6 +44,7 @@ public class GuiDualInterface extends GuiUpgradeable { private GuiTabButton switcher; private GuiImgButton BlockMode; private GuiImgButton SmartBlockMode; + private GuiImgButton fuzzyMode; private GuiToggleButton interfaceMode; private GuiImgButton insertionMode; private GuiImgButton sidelessMode; @@ -152,6 +154,16 @@ public class GuiDualInterface extends GuiUpgradeable { LockCraftingMode.NONE); this.lockCraftingMode.visible = this.bc.getInstalledUpgrades(Upgrades.LOCK_CRAFTING) > 0; this.buttonList.add(lockCraftingMode); + + offset += 18; + + this.fuzzyMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + offset, + Settings.FUZZY_MODE, + FuzzyMode.IGNORE_ALL); + this.fuzzyMode.visible = this.bc.getInstalledUpgrades(Upgrades.FUZZY) > 0; + this.buttonList.add(fuzzyMode); } @Override @@ -187,6 +199,9 @@ public class GuiDualInterface extends GuiUpgradeable { if (this.lockCraftingMode != null) { this.lockCraftingMode.set(((ContainerInterface) this.cvb).getLockCraftingMode()); } + if (this.fuzzyMode != null) { + this.fuzzyMode.set(((ContainerInterface) this.cvb).getFuzzyMode()); + } this.fontRendererObj.drawString( getGuiDisplayName(StatCollector.translateToLocal(NameConst.GUI_FLUID_INTERFACE)), 8, @@ -198,7 +213,7 @@ public class GuiDualInterface extends GuiUpgradeable { protected String getBackground() { if (!ModAndClassUtil.isBigInterface) return "guis/interface.png"; return switch (((ContainerInterface) this.cvb).getPatternCapacityCardsInstalled()) { - case -1 -> "guis/interfacenone.png"; + case -1 -> "guis/interfacenonenoconfig.png"; case 1 -> "guis/interface2.png"; case 2 -> "guis/interface3.png"; case 3 -> "guis/interface4.png"; @@ -240,6 +255,8 @@ public class GuiDualInterface extends GuiUpgradeable { .sendToServer(new PacketConfigButton(this.advancedBlockingMode.getSetting(), backwards)); } else if (btn == this.lockCraftingMode) { NetworkHandler.instance.sendToServer(new PacketConfigButton(this.lockCraftingMode.getSetting(), backwards)); + } else if (btn == this.fuzzyMode) { + NetworkHandler.instance.sendToServer(new PacketConfigButton(this.fuzzyMode.getSetting(), backwards)); } } @@ -256,5 +273,8 @@ public class GuiDualInterface extends GuiUpgradeable { if (this.lockCraftingMode != null) { this.lockCraftingMode.setVisibility(this.bc.getInstalledUpgrades(Upgrades.LOCK_CRAFTING) > 0); } + if (this.fuzzyMode != null) { + this.fuzzyMode.setVisibility(this.bc.getInstalledUpgrades(Upgrades.FUZZY) > 0); + } } } From 3542351217fb52c1d03397aa8cb5dc1f9c94d174 Mon Sep 17 00:00:00 2001 From: "Sanjay S." Date: Sat, 14 Jun 2025 09:01:05 -0400 Subject: [PATCH 3/9] Brought `PartFluidP2PInterface` up to date with dependent PR --- .../common/parts/PartFluidP2PInterface.java | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java index 27320b85..575afe22 100644 --- a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java +++ b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java @@ -77,12 +77,12 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic Date: Sat, 14 Jun 2025 09:01:05 -0400 Subject: [PATCH 4/9] Brought `PartFluidP2PInterface` up to date with dependent PR --- .../common/parts/PartFluidP2PInterface.java | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java index 27320b85..d840c27a 100644 --- a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java +++ b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java @@ -97,8 +97,11 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic Date: Sat, 14 Jun 2025 09:19:10 -0400 Subject: [PATCH 5/9] Brought `PartFluidP2PInterface` up to date with dependent PR --- .../common/parts/PartFluidP2PInterface.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java index 4be09f41..67902f53 100644 --- a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java +++ b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java @@ -65,6 +65,7 @@ import appeng.tile.inventory.IAEAppEngInventory; import appeng.tile.inventory.InvOperation; import appeng.util.Platform; import appeng.util.inv.IInventoryDestination; +import appeng.util.inv.WrapperInvSlot; public class PartFluidP2PInterface extends PartP2PTunnelStatic implements IGridTickable, IStorageMonitorable, IInventoryDestination, IDualHost, ISidedInventory, @@ -77,12 +78,12 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic Date: Fri, 20 Jun 2025 09:49:23 -0400 Subject: [PATCH 6/9] Brought 'PartFluidP2PInterface' up to date with dependent PR --- .../common/parts/PartFluidP2PInterface.java | 52 +++++++++++++++---- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java index 67902f53..19f77e0e 100644 --- a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java +++ b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java @@ -103,8 +103,6 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic drops = new ArrayList<>(); for (int i = 0; i < patterns.getSizeInventory(); i++) { if (patterns.getStackInSlot(i) == null) continue; drops.add(patterns.getStackInSlot(i)); } + for (int i = 0; i < DualityInterface.NUMBER_OF_STORAGE_SLOTS; i++) { + if (storageAppEng.getStackInSlot(i) == null) continue; + drops.add(storageAppEng.getStackInSlot(i)); + } final IPart tile = this.getHost().getPart(this.getSide()); if (tile instanceof PartFluidP2PInterface dualTile) { DualityInterface newDuality = dualTile.duality; @@ -276,6 +282,22 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic Date: Fri, 20 Jun 2025 09:55:35 -0400 Subject: [PATCH 7/9] Brought `PartFluidP2PInterface` up to date with dependent PR --- .../github/common/parts/PartFluidP2PInterface.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java index 19f77e0e..d873aefa 100644 --- a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java +++ b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java @@ -231,7 +231,7 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic drops = new ArrayList<>(); for (int i = 0; i < patterns.getSizeInventory(); i++) { if (patterns.getStackInSlot(i) == null) continue; @@ -360,7 +360,7 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic Date: Fri, 20 Jun 2025 10:22:48 -0400 Subject: [PATCH 8/9] Fixed crash caused by missing `AppEngInternalInventory` cast to `duality.getStorage()` call in `onPartActivate(...)` --- .../glodblock/github/common/parts/PartFluidP2PInterface.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java index d873aefa..2882622d 100644 --- a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java +++ b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java @@ -251,8 +251,8 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic Date: Fri, 20 Jun 2025 10:22:48 -0400 Subject: [PATCH 9/9] Fixed crash caused by missing `IInventory` cast to `duality.getStorage()` call in `onPartActivate(...)` --- .../glodblock/github/common/parts/PartFluidP2PInterface.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java index 2882622d..76e0d228 100644 --- a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java +++ b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java @@ -251,8 +251,8 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic