diff --git a/src/main/java/com/glodblock/github/client/gui/GuiBaseFluidPatternTerminal.java b/src/main/java/com/glodblock/github/client/gui/GuiBaseFluidPatternTerminal.java index eb531e40d..544b45cba 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiBaseFluidPatternTerminal.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiBaseFluidPatternTerminal.java @@ -61,7 +61,7 @@ protected void actionPerformed( final GuiButton btn ) } else if( this.encodeBtn == btn ) { - FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Encode", isShiftKeyDown() ? "2" : "1" ) ); + FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Encode", isShiftKeyDown() ? (isCtrlKeyDown() ? "3" : "2") : "1" ) ); } else if( this.clearBtn == btn ) { diff --git a/src/main/java/com/glodblock/github/client/gui/GuiBaseFluidPatternTerminalEx.java b/src/main/java/com/glodblock/github/client/gui/GuiBaseFluidPatternTerminalEx.java index d0068f3f1..8656e46ff 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiBaseFluidPatternTerminalEx.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiBaseFluidPatternTerminalEx.java @@ -47,7 +47,7 @@ protected void actionPerformed( final GuiButton btn ) if( this.encodeBtn == btn ) { - FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Encode", isShiftKeyDown() ? "2" : "1" ) ); + FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Encode", isShiftKeyDown() ? (isCtrlKeyDown() ? "3" : "2") : "1" ) ); } else if( this.clearBtn == btn ) { 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 aba1bf4be..96e8f64fd 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiDualInterface.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiDualInterface.java @@ -68,7 +68,7 @@ public void drawFG( final int offsetX, final int offsetY, final int mouseX, fina this.interfaceMode.setState( ( (ContainerInterface) this.cvb ).getInterfaceTerminalMode() == YesNo.YES ); } - this.fontRendererObj.drawString( StatCollector.translateToLocal(NameConst.GUI_FLUID_INTERFACE), 8, 6, 4210752 ); + this.fontRendererObj.drawString( getGuiDisplayName( StatCollector.translateToLocal(NameConst.GUI_FLUID_INTERFACE) ), 8, 6, 4210752 ); } @Override diff --git a/src/main/java/com/glodblock/github/client/gui/GuiFluidIO.java b/src/main/java/com/glodblock/github/client/gui/GuiFluidIO.java index f14099e65..15e610ad8 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiFluidIO.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiFluidIO.java @@ -6,6 +6,8 @@ import com.glodblock.github.client.gui.container.ContainerFluidIO; import com.glodblock.github.common.parts.PartFluidImportBus; import com.glodblock.github.common.parts.PartSharedFluidBus; +import com.glodblock.github.util.NameConst; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; public class GuiFluidIO extends GuiUpgradeable @@ -18,6 +20,32 @@ public GuiFluidIO(InventoryPlayer inventoryPlayer, PartSharedFluidBus te ) this.bus = te; } + @Override + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) + { + this.fontRendererObj.drawString( this.getGuiDisplayName(this.bus instanceof PartFluidImportBus ? I18n.format(NameConst.GUI_FLUID_IMPORT) : I18n.format(NameConst.GUI_FLUID_EXPORT)), 8, 6, 4210752 ); + this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); + + if( this.redstoneMode != null ) + { + this.redstoneMode.set( this.cvb.getRedStoneMode() ); + } + + if( this.fuzzyMode != null ) + { + this.fuzzyMode.set( this.cvb.getFuzzyMode() ); + } + + if( this.craftMode != null ) + { + this.craftMode.set( this.cvb.getCraftingMode() ); + } + + if( this.schedulingMode != null ) + { + this.schedulingMode.set( this.cvb.getSchedulingMode() ); + } + } @Override protected GuiText getName() @@ -26,7 +54,7 @@ protected GuiText getName() } public void update(int id, IAEFluidStack stack) { - ((ContainerFluidIO)this.cvb).getBus().setFluidInSlot(id, stack); + ((ContainerFluidIO) this.cvb).getBus().setFluidInSlot(id, stack); } } diff --git a/src/main/java/com/glodblock/github/client/gui/GuiItemAmountChange.java b/src/main/java/com/glodblock/github/client/gui/GuiItemAmountChange.java index efabcbdca..79748dc1d 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiItemAmountChange.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiItemAmountChange.java @@ -1,7 +1,6 @@ package com.glodblock.github.client.gui; import appeng.api.storage.ITerminalHost; -import appeng.core.localization.GuiText; import com.glodblock.github.FluidCraft; import com.glodblock.github.client.gui.container.ContainerItemAmountChange; import com.glodblock.github.network.CPacketPatternValueSet; diff --git a/src/main/java/com/glodblock/github/client/gui/container/ContainerFluidConfigurable.java b/src/main/java/com/glodblock/github/client/gui/container/ContainerFluidConfigurable.java index 76f1585aa..ef79dcc7b 100644 --- a/src/main/java/com/glodblock/github/client/gui/container/ContainerFluidConfigurable.java +++ b/src/main/java/com/glodblock/github/client/gui/container/ContainerFluidConfigurable.java @@ -142,4 +142,12 @@ protected void standardDetectAndSendChanges() super.standardDetectAndSendChanges(); } + @Override + public boolean isSlotEnabled( final int idx ) { + if (idx == 0) { + return true; + } + return super.isSlotEnabled(idx); + } + } diff --git a/src/main/java/com/glodblock/github/client/gui/container/ContainerFluidPatternTerminal.java b/src/main/java/com/glodblock/github/client/gui/container/ContainerFluidPatternTerminal.java index bbc35d7be..fa41b194c 100644 --- a/src/main/java/com/glodblock/github/client/gui/container/ContainerFluidPatternTerminal.java +++ b/src/main/java/com/glodblock/github/client/gui/container/ContainerFluidPatternTerminal.java @@ -158,6 +158,9 @@ public void doAction(EntityPlayerMP player, InventoryAction action, int slotId, } Slot slot = getSlot(slotId); ItemStack stack = player.inventory.getItemStack(); + if (action == InventoryAction.SPLIT_OR_PLACE_SINGLE && slot.getStack() != null && stack == null && slot.getStack().stackSize == 1) { + return; + } if (Util.getFluidFromItem(stack) == null || Util.getFluidFromItem(stack).amount <= 0) { super.doAction(player, action, slotId, id); return; diff --git a/src/main/java/com/glodblock/github/client/gui/container/ContainerFluidPatternTerminalEx.java b/src/main/java/com/glodblock/github/client/gui/container/ContainerFluidPatternTerminalEx.java index 100c7381f..9db83c64c 100644 --- a/src/main/java/com/glodblock/github/client/gui/container/ContainerFluidPatternTerminalEx.java +++ b/src/main/java/com/glodblock/github/client/gui/container/ContainerFluidPatternTerminalEx.java @@ -14,6 +14,7 @@ import com.glodblock.github.inventory.PatternConsumer; import com.glodblock.github.loader.ItemAndBlockHolder; import com.glodblock.github.util.FluidPatternDetails; +import com.glodblock.github.util.ModAndClassUtil; import com.glodblock.github.util.Util; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -34,7 +35,7 @@ public ContainerFluidPatternTerminalEx(InventoryPlayer ip, ITerminalHost monitor @Override public void encode() { - if (!checkHasFluidPattern()) { + if (!checkHasFluidPattern() && ModAndClassUtil.isExPatternTerminal) { super.encode(); return; } @@ -151,12 +152,14 @@ public void doAction(EntityPlayerMP player, InventoryAction action, int slotId, } Slot slot = getSlot(slotId); ItemStack stack = player.inventory.getItemStack(); + if (action == InventoryAction.SPLIT_OR_PLACE_SINGLE && slot.getStack() != null && stack == null && slot.getStack().stackSize == 1) { + return; + } if (Util.getFluidFromItem(stack) == null || Util.getFluidFromItem(stack).amount <= 0) { super.doAction(player, action, slotId, id); return; } - if ((slot instanceof SlotFakeCraftingMatrix || slot instanceof SlotPatternOutputs) && stack != null - && (stack.getItem() instanceof IFluidContainerItem || FluidContainerRegistry.isContainer(stack))) { + if ((slot instanceof SlotFakeCraftingMatrix || slot instanceof SlotPatternOutputs) && (stack.getItem() instanceof IFluidContainerItem || FluidContainerRegistry.isContainer(stack))) { FluidStack fluid = null; switch (action) { case PICKUP_OR_SET_DOWN: diff --git a/src/main/java/com/glodblock/github/client/gui/container/FCBasePartContainer.java b/src/main/java/com/glodblock/github/client/gui/container/FCBasePartContainer.java index 366882722..9c740c321 100644 --- a/src/main/java/com/glodblock/github/client/gui/container/FCBasePartContainer.java +++ b/src/main/java/com/glodblock/github/client/gui/container/FCBasePartContainer.java @@ -159,6 +159,19 @@ public void onChangeInventory(final IInventory inv, final int slot, final InvOpe } + public void encodeAllItemAndMoveToInventory() { + encode(); + ItemStack output = this.patternSlotOUT.getStack(); + if(output != null) { + if(this.patternSlotIN.getStack() != null) output.stackSize += this.patternSlotIN.getStack().stackSize; + if (!getPlayerInv().addItemStackToInventory(output)) { + getPlayerInv().player.entityDropItem(output, 0); + } + this.patternSlotOUT.putStack(null); + this.patternSlotIN.putStack(null); + } + } + public void encodeAndMoveToInventory() { encode(); diff --git a/src/main/java/com/glodblock/github/client/gui/container/FCBasePartContainerEx.java b/src/main/java/com/glodblock/github/client/gui/container/FCBasePartContainerEx.java index 4378c5ad5..fd9a93d4a 100644 --- a/src/main/java/com/glodblock/github/client/gui/container/FCBasePartContainerEx.java +++ b/src/main/java/com/glodblock/github/client/gui/container/FCBasePartContainerEx.java @@ -101,6 +101,19 @@ public void onChangeInventory(final IInventory inv, final int slot, final InvOpe } + public void encodeAllItemAndMoveToInventory() { + encode(); + ItemStack output = this.patternSlotOUT.getStack(); + if(output != null) { + if(this.patternSlotIN.getStack() != null) output.stackSize += this.patternSlotIN.getStack().stackSize; + if (!getPlayerInv().addItemStackToInventory(output)) { + getPlayerInv().player.entityDropItem(output, 0); + } + this.patternSlotOUT.putStack(null); + this.patternSlotIN.putStack(null); + } + } + public void encodeAndMoveToInventory() { encode(); @@ -180,6 +193,7 @@ else if( output == null ) encodedValue.setTag( "in", tagIn ); encodedValue.setTag( "out", tagOut ); encodedValue.setBoolean( "substitute", this.isSubstitute() ); + encodedValue.setBoolean( "crafting", false ); output.setTagCompound( encodedValue ); } diff --git a/src/main/java/com/glodblock/github/common/item/ItemFluidEncodedPattern.java b/src/main/java/com/glodblock/github/common/item/ItemFluidEncodedPattern.java index 0e777d2e0..bb30860c2 100644 --- a/src/main/java/com/glodblock/github/common/item/ItemFluidEncodedPattern.java +++ b/src/main/java/com/glodblock/github/common/item/ItemFluidEncodedPattern.java @@ -28,4 +28,8 @@ public ItemFluidEncodedPattern register() { return this; } + public ItemStack stack() { + return new ItemStack(this, 1); + } + } diff --git a/src/main/java/com/glodblock/github/coremod/hooker/CoreModHooks.java b/src/main/java/com/glodblock/github/coremod/hooker/CoreModHooks.java index 9dff4263e..380f8bb28 100644 --- a/src/main/java/com/glodblock/github/coremod/hooker/CoreModHooks.java +++ b/src/main/java/com/glodblock/github/coremod/hooker/CoreModHooks.java @@ -52,6 +52,17 @@ public static IAEItemStack wrapFluidPacketStack(IAEItemStack stack) { return stack; } + public static ItemStack removeFluidPackets(InventoryCrafting inv, int index) { + ItemStack stack = inv.getStackInSlot(index); + if (stack != null && stack.getItem() instanceof ItemFluidPacket) { + FluidStack fluid = ItemFluidPacket.getFluidStack(stack); + return ItemFluidDrop.newStack(fluid); + } + else { + return stack; + } + } + @Nullable public static InventoryAdaptor wrapInventory(@Nullable TileEntity tile, ForgeDirection face) { return tile != null ? FluidConvertingInventoryAdaptor.wrap(tile, Util.from(face)) : null; diff --git a/src/main/java/com/glodblock/github/coremod/transform/CraftingCpuTransformer.java b/src/main/java/com/glodblock/github/coremod/transform/CraftingCpuTransformer.java index 2c3c8a74d..21c8c25b4 100644 --- a/src/main/java/com/glodblock/github/coremod/transform/CraftingCpuTransformer.java +++ b/src/main/java/com/glodblock/github/coremod/transform/CraftingCpuTransformer.java @@ -83,6 +83,15 @@ public void visitMethodInsn(int opcode, String owner, String name, String desc, return; } } + if (opcode == Opcodes.INVOKEVIRTUAL + && owner.equals("net/minecraft/inventory/InventoryCrafting") && (name.equals("getStackInSlot") || name.equals("func_70301_a"))) { + super.visitMethodInsn(Opcodes.INVOKESTATIC, + "com/glodblock/github/coremod/hooker/CoreModHooks", + "removeFluidPackets", + "(Lnet/minecraft/inventory/InventoryCrafting;I)Lnet/minecraft/item/ItemStack;", + false); + return; + } super.visitMethodInsn(opcode, owner, name, desc, itf); if (gotInventory) { if (opcode == Opcodes.INVOKESTATIC diff --git a/src/main/java/com/glodblock/github/inventory/FluidConvertingInventoryAdaptor.java b/src/main/java/com/glodblock/github/inventory/FluidConvertingInventoryAdaptor.java index 0eba2edcd..5428a9ba9 100644 --- a/src/main/java/com/glodblock/github/inventory/FluidConvertingInventoryAdaptor.java +++ b/src/main/java/com/glodblock/github/inventory/FluidConvertingInventoryAdaptor.java @@ -1,15 +1,19 @@ package com.glodblock.github.inventory; import appeng.api.config.FuzzyMode; +import appeng.tile.misc.TileInterface; import appeng.tile.networking.TileCableBus; import appeng.util.InventoryAdaptor; import appeng.util.inv.IInventoryDestination; import appeng.util.inv.ItemSlot; +import cofh.api.transport.IItemDuct; import com.glodblock.github.common.Config; import com.glodblock.github.common.item.ItemFluidPacket; import com.glodblock.github.common.parts.PartFluidInterface; import com.glodblock.github.common.tile.TileFluidInterface; import com.glodblock.github.util.Ae2Reflect; +import com.glodblock.github.util.BlockPos; +import com.glodblock.github.util.ModAndClassUtil; import com.glodblock.github.util.Util; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -34,17 +38,31 @@ public static InventoryAdaptor wrap(TileEntity capProvider, EnumFacing face) { return InventoryAdaptor.getAdaptor(capProvider, f); InventoryAdaptor item = InventoryAdaptor.getAdaptor(capProvider, f); IFluidHandler fluid = capProvider instanceof IFluidHandler ? (IFluidHandler) capProvider : null; - return new FluidConvertingInventoryAdaptor(item, fluid, face); + boolean onmi = false; + if (inter instanceof TileInterface) { + onmi = ((TileInterface) inter).getTargets().size() > 1; + } + Object conduct = null; + if (ModAndClassUtil.COFH && capProvider instanceof IItemDuct) { + conduct = capProvider; + } + return new FluidConvertingInventoryAdaptor(item, fluid, face, new BlockPos(inter), onmi, conduct); } private final InventoryAdaptor invItems; private final IFluidHandler invFluids; private final ForgeDirection side; + private final BlockPos posInterface; + private final Object eioDuct; + private final boolean onmi; - public FluidConvertingInventoryAdaptor(@Nullable InventoryAdaptor invItems, @Nullable IFluidHandler invFluids, EnumFacing facing) { + public FluidConvertingInventoryAdaptor(@Nullable InventoryAdaptor invItems, @Nullable IFluidHandler invFluids, EnumFacing facing, BlockPos pos, boolean isOnmi, Object eioConduct) { this.invItems = invItems; this.invFluids = invFluids; this.side = Util.from(facing); + this.posInterface = pos; + this.eioDuct = eioConduct; + this.onmi = isOnmi; } @Override @@ -62,12 +80,34 @@ public ItemStack addItems(ItemStack toBeAdded) { } return toBeAdded; } + if (eioDuct != null) { + return ((IItemDuct) eioDuct).insertItem(side, toBeAdded); + } return invItems != null ? invItems.addItems(toBeAdded) : toBeAdded; } @Override public ItemStack simulateAdd(ItemStack toBeSimulated) { if (toBeSimulated.getItem() instanceof ItemFluidPacket) { + if (onmi) { + boolean sus = false; + FluidStack fluid = ItemFluidPacket.getFluidStack(toBeSimulated); + if (fluid != null) { + for (ForgeDirection dir : ForgeDirection.values()) { + TileEntity te = posInterface.getOffSet(dir).getTileEntity(); + if (te instanceof IFluidHandler) { + int filled = ((IFluidHandler) te).fill(dir.getOpposite(), fluid, false); + if (filled > 0) { + sus = true; + break; + } + } + } + } else { + sus = true; + } + return sus ? null : toBeSimulated; + } if (invFluids != null) { FluidStack fluid = ItemFluidPacket.getFluidStack(toBeSimulated); if (fluid != null) { @@ -80,6 +120,10 @@ public ItemStack simulateAdd(ItemStack toBeSimulated) { } return toBeSimulated; } + //Assert EIO conduct can hold all item, as it is the origin practice in AE2 + if (eioDuct != null) { + return null; + } return invItems != null ? invItems.simulateAdd(toBeSimulated) : toBeSimulated; } diff --git a/src/main/java/com/glodblock/github/inventory/gui/MouseRegionManager.java b/src/main/java/com/glodblock/github/inventory/gui/MouseRegionManager.java index 8e4b99128..549e4518c 100644 --- a/src/main/java/com/glodblock/github/inventory/gui/MouseRegionManager.java +++ b/src/main/java/com/glodblock/github/inventory/gui/MouseRegionManager.java @@ -1,5 +1,6 @@ package com.glodblock.github.inventory.gui; +import appeng.client.gui.AEBaseGui; import com.glodblock.github.util.Ae2ReflectClient; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.inventory.GuiContainer; @@ -40,6 +41,7 @@ public void render(int mX, int mY) { if (region.containsMouse(mX, mY)) { List tooltip = region.handler.getTooltip(); if (tooltip != null) { + ((AEBaseGui) gui).drawTooltip(mX, mY, 0, String.join("\n", tooltip)); return; } } diff --git a/src/main/java/com/glodblock/github/loader/RecipeLoader.java b/src/main/java/com/glodblock/github/loader/RecipeLoader.java index 05b1bfd12..5ddbb4f05 100644 --- a/src/main/java/com/glodblock/github/loader/RecipeLoader.java +++ b/src/main/java/com/glodblock/github/loader/RecipeLoader.java @@ -49,6 +49,7 @@ public void run() { GameRegistry.addShapelessRecipe(FLUID_TERMINAL_EX.stack(), FLUID_TERMINAL.stack(), AE2_PROCESS_CAL, AE2_PROCESS_ENG, AE2_PROCESS_LOG); GameRegistry.addRecipe(new ShapedOreRecipe(BUFFER.stack(), "ILI", "AGF", "IBI", 'I', "ingotIron", 'G', AE2_QUARTZ_GLASS, 'L', AE2_CELL_1K, 'A', AE2_CORE_ANN, 'F', AE2_CORE_FOM, 'B', BUCKET)); GameRegistry.addRecipe(new ShapedOreRecipe(LARGE_BUFFER.stack(), "BGB", "GEG", "BGB", 'B', BUFFER.stack(), 'G', AE2_QUARTZ_GLASS, 'E', AE2_PROCESS_ENG)); + GameRegistry.addShapelessRecipe(AE2_BLANK_PATTERN, PATTERN.stack()); if (Config.fluidCells) { OreDictionary.registerOre("anyCertusCrystal", AE2_PURE_CERTUS); diff --git a/src/main/java/com/glodblock/github/network/CPacketFluidPatternTermBtns.java b/src/main/java/com/glodblock/github/network/CPacketFluidPatternTermBtns.java index c88b681c9..36c99cb11 100644 --- a/src/main/java/com/glodblock/github/network/CPacketFluidPatternTermBtns.java +++ b/src/main/java/com/glodblock/github/network/CPacketFluidPatternTermBtns.java @@ -66,7 +66,9 @@ public IMessage onMessage(CPacketFluidPatternTermBtns message, MessageContext ct cpt.getPatternTerminal().setCraftingRecipe(Value.equals("1")); break; case "PatternTerminal.Encode": - if (Value.equals("2")) + if (Value.equals("3")) + cpt.encodeAllItemAndMoveToInventory(); + else if (Value.equals("2")) cpt.encodeAndMoveToInventory(); else cpt.encode(); @@ -89,7 +91,9 @@ public IMessage onMessage(CPacketFluidPatternTermBtns message, MessageContext ct final ContainerFluidPatternTerminalEx cpt = (ContainerFluidPatternTerminalEx) c; switch (Name) { case "PatternTerminal.Encode": - if (Value.equals("2")) + if (Value.equals("3")) + cpt.encodeAllItemAndMoveToInventory(); + else if (Value.equals("2")) cpt.encodeAndMoveToInventory(); else cpt.encode(); diff --git a/src/main/java/com/glodblock/github/util/BlockPos.java b/src/main/java/com/glodblock/github/util/BlockPos.java index d0f706ea6..1aa02d1d8 100644 --- a/src/main/java/com/glodblock/github/util/BlockPos.java +++ b/src/main/java/com/glodblock/github/util/BlockPos.java @@ -1,30 +1,42 @@ package com.glodblock.github.util; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import javax.annotation.Nonnull; +import java.util.Objects; public class BlockPos { private final int x; private final int y; private final int z; + private final World w; public BlockPos(int x, int y, int z) { this.x = x; this.y = y; this.z = z; + this.w = null; } public BlockPos(@Nonnull TileEntity te) { this.x = te.xCoord; this.y = te.yCoord; this.z = te.zCoord; + this.w = te.getWorldObj(); + } + + public BlockPos(int x, int y, int z, World w) { + this.x = x; + this.y = y; + this.z = z; + this.w = w; } public BlockPos getOffSet(ForgeDirection face) { - return new BlockPos(this.x + face.offsetX, this.y + face.offsetY, this.z + face.offsetZ); + return new BlockPos(this.x + face.offsetX, this.y + face.offsetY, this.z + face.offsetZ, this.w); } public int getX() { @@ -39,11 +51,22 @@ public int getZ() { return z; } + public World getWorld() { + return w; + } + + public TileEntity getTileEntity() { + if (w != null) { + return w.getTileEntity(x, y, z); + } + return null; + } + @Override public boolean equals(Object obj) { if (obj instanceof BlockPos) { BlockPos pos = (BlockPos) obj; - return pos.x == x && pos.y == y && pos.z == z; + return pos.x == x && pos.y == y && pos.z == z && Objects.equals(pos.w, w); } return false; } diff --git a/src/main/java/com/glodblock/github/util/ModAndClassUtil.java b/src/main/java/com/glodblock/github/util/ModAndClassUtil.java index 38c6de8f1..7798e9f89 100644 --- a/src/main/java/com/glodblock/github/util/ModAndClassUtil.java +++ b/src/main/java/com/glodblock/github/util/ModAndClassUtil.java @@ -6,6 +6,7 @@ import appeng.core.AEConfig; import appeng.core.localization.ButtonToolTips; import appeng.core.localization.GuiText; +import appeng.items.parts.PartType; import cpw.mods.fml.common.Loader; import java.lang.reflect.Field; @@ -22,6 +23,7 @@ public final class ModAndClassUtil { public static boolean WCT = false; public static boolean IC2 = false; public static boolean NEI = false; + public static boolean COFH = false; public static boolean isDoubleButton; public static boolean isSaveText; @@ -30,12 +32,21 @@ public final class ModAndClassUtil { public static boolean isSearchBar; public static boolean isShiftTooltip; public static boolean isBigInterface; + public static boolean isExPatternTerminal; public static Class essentiaGas; @SuppressWarnings("all") public static void init() { + try { + Field d = PartType.class.getDeclaredField("PatternTerminalEx"); + if (d == null) isExPatternTerminal = false; + isExPatternTerminal = true; + } catch (NoSuchFieldException e) { + isExPatternTerminal = false; + } + try { Field d = Upgrades.class.getDeclaredField("PATTERN_CAPACITY"); if (d == null) isBigInterface = false; @@ -118,6 +129,8 @@ public static void init() { IC2 = true; if (Loader.isModLoaded("NotEnoughItems")) NEI = true; + if (Loader.isModLoaded("CoFHCore")) + COFH = true; } } diff --git a/src/main/java/com/glodblock/github/util/NameConst.java b/src/main/java/com/glodblock/github/util/NameConst.java index 58eabc03f..ae0c30616 100644 --- a/src/main/java/com/glodblock/github/util/NameConst.java +++ b/src/main/java/com/glodblock/github/util/NameConst.java @@ -41,5 +41,7 @@ public class NameConst { public static final String GUI_LARGE_INGREDIENT_BUFFER = GUI_KEY + BLOCK_LARGE_INGREDIENT_BUFFER; public static final String GUI_FLUID_INTERFACE = GUI_KEY + BLOCK_FLUID_INTERFACE; public static final String GUI_OC_PATTERN_EDITOR = GUI_KEY + BLOCK_OC_PATTERN_EDITOR; + public static final String GUI_FLUID_IMPORT = GUI_KEY + ITEM_PART_FLUID_IMPORT; + public static final String GUI_FLUID_EXPORT = GUI_KEY + ITEM_PART_FLUID_EXPORT; } diff --git a/src/main/resources/assets/ae2fc/lang/en_US.lang b/src/main/resources/assets/ae2fc/lang/en_US.lang index 7d5929344..87b80604a 100644 --- a/src/main/resources/assets/ae2fc/lang/en_US.lang +++ b/src/main/resources/assets/ae2fc/lang/en_US.lang @@ -55,5 +55,7 @@ ae2fc.gui.fluid_interface.4=W ae2fc.gui.fluid_interface.5=E ae2fc.gui.oc_pattern_editor=OC Pattern Editor ae2fc.gui.set=Set +ae2fc.gui.part_fluid_import=ME Fluid Import Bus +ae2fc.gui.part_fluid_export=ME Fluid Export Bus itemGroup.ae2fc=Fluid Craft For AE2