diff --git a/src/main/java/com/glodblock/github/client/gui/container/ContainerDualInterface.java b/src/main/java/com/glodblock/github/client/gui/container/ContainerDualInterface.java index 77baccaf..181381dd 100644 --- a/src/main/java/com/glodblock/github/client/gui/container/ContainerDualInterface.java +++ b/src/main/java/com/glodblock/github/client/gui/container/ContainerDualInterface.java @@ -6,6 +6,7 @@ import appeng.api.util.IConfigManager; import appeng.container.guisync.GuiSync; import appeng.container.implementations.ContainerInterface; import appeng.helpers.IInterfaceHost; +import com.glodblock.github.common.tile.TileFluidInterface; import net.minecraft.entity.player.InventoryPlayer; public class ContainerDualInterface extends ContainerInterface { @@ -13,9 +14,12 @@ public class ContainerDualInterface extends ContainerInterface { @GuiSync(10) public SidelessMode sidelessMode; + private final boolean isTile; + public ContainerDualInterface(InventoryPlayer ip, IInterfaceHost te) { super(ip, te); this.sidelessMode = SidelessMode.SIDELESS; + this.isTile = te instanceof TileFluidInterface; } public SidelessMode getSidelessMode() { @@ -25,6 +29,6 @@ public class ContainerDualInterface extends ContainerInterface { @Override protected void loadSettingsFromHost(IConfigManager cm) { super.loadSettingsFromHost(cm); - this.sidelessMode = (SidelessMode) cm.getSetting(Settings.SIDELESS_MODE); + this.sidelessMode = this.isTile ? (SidelessMode) cm.getSetting(Settings.SIDELESS_MODE) : SidelessMode.SIDELESS; } } diff --git a/src/main/java/com/glodblock/github/inventory/gui/GuiType.java b/src/main/java/com/glodblock/github/inventory/gui/GuiType.java index d700f1d7..693bab1d 100644 --- a/src/main/java/com/glodblock/github/inventory/gui/GuiType.java +++ b/src/main/java/com/glodblock/github/inventory/gui/GuiType.java @@ -4,6 +4,7 @@ import appeng.api.storage.ITerminalHost; import appeng.container.implementations.ContainerCraftAmount; import appeng.container.implementations.ContainerCraftingStatus; import appeng.container.implementations.ContainerPriority; +import appeng.helpers.IInterfaceHost; import appeng.helpers.IPriorityHost; import com.glodblock.github.client.gui.*; import com.glodblock.github.client.gui.container.*; @@ -12,6 +13,7 @@ import com.glodblock.github.common.parts.PartFluidStorageBus; import com.glodblock.github.common.parts.base.FCPart; import com.glodblock.github.common.parts.base.FCSharedFluidBus; import com.glodblock.github.common.tile.*; +import com.glodblock.github.inventory.IDualHost; import com.glodblock.github.inventory.item.IFluidPortableCell; import com.google.common.collect.ImmutableList; import java.util.List; @@ -55,26 +57,26 @@ public enum GuiType { } }), - DUAL_INTERFACE(new TileOrPartGuiFactory(TileFluidInterface.class) { + DUAL_INTERFACE(new TileOrPartGuiFactory(IInterfaceHost.class) { @Override - protected Object createServerGui(EntityPlayer player, TileFluidInterface inv) { + protected Object createServerGui(EntityPlayer player, IInterfaceHost inv) { return new ContainerDualInterface(player.inventory, inv); } @Override - protected Object createClientGui(EntityPlayer player, TileFluidInterface inv) { + protected Object createClientGui(EntityPlayer player, IInterfaceHost inv) { return new GuiDualInterface(player.inventory, inv); } }), - DUAL_INTERFACE_FLUID(new TileOrPartGuiFactory(TileFluidInterface.class) { + DUAL_INTERFACE_FLUID(new TileOrPartGuiFactory(IDualHost.class) { @Override - protected Object createServerGui(EntityPlayer player, TileFluidInterface inv) { + protected Object createServerGui(EntityPlayer player, IDualHost inv) { return new ContainerFluidInterface(player.inventory, inv); } @Override - protected Object createClientGui(EntityPlayer player, TileFluidInterface inv) { + protected Object createClientGui(EntityPlayer player, IDualHost inv) { return new GuiFluidInterface(player.inventory, inv); } }), diff --git a/src/main/java/com/glodblock/github/loader/RecipeLoader.java b/src/main/java/com/glodblock/github/loader/RecipeLoader.java index e0e01166..f23e4282 100644 --- a/src/main/java/com/glodblock/github/loader/RecipeLoader.java +++ b/src/main/java/com/glodblock/github/loader/RecipeLoader.java @@ -61,11 +61,24 @@ public class RecipeLoader implements Runnable { new ItemStack(GameRegistry.findItem("appliedenergistics2", "tile.BlockCraftingUnit"), 1, 1); public static final ItemStack AE2_PATTERN_CAPACITY_CARD = new ItemStack(GameRegistry.findItem("appliedenergistics2", "item.ItemMultiMaterial"), 1, 54); + public static final ItemStack AE2_ME_CHEST = + GameRegistry.findItemStack("appliedenergistics2", "tile.BlockChest", 1); + public static final ItemStack AE2_ENERGY_CELL = + GameRegistry.findItemStack("appliedenergistics2", "tile.BlockEnergyCell", 1); public static final ItemStack BUCKET = new ItemStack(Items.bucket, 1); public static final ItemStack IRON_BAR = new ItemStack(Blocks.iron_bars, 1); @Override public void run() { + GameRegistry.addRecipe(new ShapedOreRecipe( + PORTABLE_FLUID_CELL.stack(), + "ABC", + 'A', + AE2_ME_CHEST, + 'B', + CellType.Cell1kPart.stack(1), + 'C', + AE2_ENERGY_CELL)); GameRegistry.addRecipe(new ShapedOreRecipe( INTERFACE.stack(), "IPI",