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); + } } } 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 38dc2b18..04538628 100644 --- a/src/main/java/com/glodblock/github/proxy/CommonProxy.java +++ b/src/main/java/com/glodblock/github/proxy/CommonProxy.java @@ -120,6 +120,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);