diff --git a/dependencies.gradle b/dependencies.gradle index 69e3f3eb..5bba400f 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -34,10 +34,10 @@ * 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.7.57-GTNH:dev') - api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-643-GTNH:dev') + api('com.github.GTNewHorizons:NotEnoughItems:2.7.59-GTNH:dev') + api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-649-GTNH:dev') api('curse.maven:cofh-core-69162:2388751') - api('com.github.GTNewHorizons:waila:1.8.8:dev') + api('com.github.GTNewHorizons:waila:1.8.10:dev') api("com.github.GTNewHorizons:GTNHLib:0.6.32:dev") implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.6:dev") { @@ -48,7 +48,7 @@ dependencies { compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false } compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.13:dev') compileOnly('com.github.GTNewHorizons:EnderIO:2.9.18:dev') - compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.353:dev') { + compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.362:dev') { exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework' exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial' } @@ -56,8 +56,8 @@ dependencies { 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.11.16-GTNH:dev') { transitive = false } - compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.7-GTNH:dev') { transitive = false } - compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.79:dev") { transitive = false } + compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.8-GTNH:dev') { transitive = false } + compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.83:dev") { transitive = false } runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev") } 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..9139a3ae 100644 --- a/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java +++ b/src/main/java/com/glodblock/github/common/parts/PartFluidP2PInterface.java @@ -1,5 +1,7 @@ package com.glodblock.github.common.parts; +import static appeng.helpers.DualityInterface.NUMBER_OF_STORAGE_SLOTS; + import java.util.ArrayList; import java.util.EnumSet; import java.util.List; @@ -15,6 +17,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.Vec3; import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; @@ -33,6 +36,7 @@ import com.google.common.collect.ImmutableSet; import appeng.api.config.Actionable; import appeng.api.config.Upgrades; +import appeng.api.implementations.items.IMemoryCard; import appeng.api.implementations.tiles.ITileStorageMonitorable; import appeng.api.networking.IGridNode; import appeng.api.networking.crafting.ICraftingLink; @@ -65,11 +69,15 @@ 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, IAEAppEngInventory, ITileStorageMonitorable, IPriorityHost, IInterfaceHost { + boolean needUpdateOnNetworkBooted = false; + boolean lastPowerStart = false; + private final DualityInterface duality = new DualityInterface(this.getProxy(), this) { @Override @@ -85,7 +93,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); @@ -109,16 +199,39 @@ 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)); } + + if (!duality.sharedInventory && !wasActive) { + AppEngInternalInventory storageAppEng = this.duality.getStorage(); + for (int i = 0; i < 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; @@ -151,11 +289,15 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic newDuality.getConfigManager().putSetting(setting, config.getSetting(setting))); @@ -261,8 +403,8 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic