diff --git a/buildcraft_server/buildcraft/builders/CraftingTemplate.java b/buildcraft_server/buildcraft/builders/CraftingTemplate.java deleted file mode 100644 index e0b8d488..00000000 --- a/buildcraft_server/buildcraft/builders/CraftingTemplate.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.builders; - -import net.minecraft.src.ICrafting; -import net.minecraft.src.IInventory; - -class CraftingTemplate extends CraftingTemplateRoot { - - public CraftingTemplate(IInventory playerInventory, TileArchitect template) { - super(playerInventory, template); - } - - @Override - public void onCraftGuiOpened(ICrafting icrafting) { - super.onCraftGuiOpened(icrafting); - icrafting.updateCraftingInventoryInfo(this, 0, template.computingTime); - } - - @Override - public void updateCraftingResults() { - super.updateCraftingResults(); - for (int i = 0; i < crafters.size(); i++) { - ICrafting icrafting = (ICrafting) crafters.get(i); - if (computingTime != template.computingTime) - icrafting.updateCraftingInventoryInfo(this, 0, template.computingTime); - } - - computingTime = template.computingTime; - } - -} \ No newline at end of file diff --git a/buildcraft_server/buildcraft/core/network/ConnectionHandler.java b/buildcraft_server/buildcraft/core/network/ConnectionHandler.java deleted file mode 100644 index d496d382..00000000 --- a/buildcraft_server/buildcraft/core/network/ConnectionHandler.java +++ /dev/null @@ -1,22 +0,0 @@ -package buildcraft.core.network; - -import buildcraft.core.DefaultProps; -import net.minecraft.src.NetworkManager; -import net.minecraft.src.Packet1Login; -import net.minecraft.src.forge.IConnectionHandler; -import net.minecraft.src.forge.MessageManager; - -public class ConnectionHandler implements IConnectionHandler { - - @Override - public void onConnect(NetworkManager network) { - MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME); - } - - @Override - public void onLogin(NetworkManager network, Packet1Login login) {} - - @Override - public void onDisconnect(NetworkManager network, String message, Object[] args) {} - -} diff --git a/buildcraft_server/buildcraft/energy/ContainerEngine.java b/buildcraft_server/buildcraft/energy/ContainerEngine.java deleted file mode 100644 index e9cf3400..00000000 --- a/buildcraft_server/buildcraft/energy/ContainerEngine.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.energy; - -import net.minecraft.src.ICrafting; -import net.minecraft.src.InventoryPlayer; - -public class ContainerEngine extends ContainerEngineRoot { - - public ContainerEngine(InventoryPlayer inventoryplayer, TileEngine tileEngine) { - super(inventoryplayer, tileEngine); - // TODO Auto-generated constructor stub - } - - @Override - public void onCraftGuiOpened(ICrafting icrafting) { - super.onCraftGuiOpened(icrafting); - // icrafting.updateCraftingInventoryInfo(this, 0, - // engine.scaledBurnTime); - } - - @Override - public void updateCraftingResults() { - super.updateCraftingResults(); - - for (int i = 0; i < crafters.size(); i++) - engine.engine.sendGUINetworkData(this, (ICrafting) crafters.get(i)); - } - -} diff --git a/buildcraft_server/buildcraft/factory/BlockMachineRoot.java b/buildcraft_server/buildcraft/factory/BlockMachineRoot.java deleted file mode 100644 index 71773115..00000000 --- a/buildcraft_server/buildcraft/factory/BlockMachineRoot.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.factory; - -import net.minecraft.src.BlockContainer; -import net.minecraft.src.Material; - -public abstract class BlockMachineRoot extends BlockContainer { - - protected BlockMachineRoot(int i, Material material) { - super(i, material); - // TODO Auto-generated constructor stub - } - -} diff --git a/buildcraft_server/buildcraft/factory/network/ConnectionHandler.java b/buildcraft_server/buildcraft/factory/network/ConnectionHandler.java deleted file mode 100644 index 492cb6e2..00000000 --- a/buildcraft_server/buildcraft/factory/network/ConnectionHandler.java +++ /dev/null @@ -1,22 +0,0 @@ -package buildcraft.factory.network; - -import buildcraft.core.DefaultProps; -import net.minecraft.src.NetworkManager; -import net.minecraft.src.Packet1Login; -import net.minecraft.src.forge.IConnectionHandler; -import net.minecraft.src.forge.MessageManager; - -public class ConnectionHandler implements IConnectionHandler { - - @Override - public void onConnect(NetworkManager network) { - MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME); - } - - @Override - public void onLogin(NetworkManager network, Packet1Login login) {} - - @Override - public void onDisconnect(NetworkManager network, String message, Object[] args) {} - -} diff --git a/buildcraft_server/buildcraft/silicon/network/ConnectionHandler.java b/buildcraft_server/buildcraft/silicon/network/ConnectionHandler.java deleted file mode 100644 index 150993f5..00000000 --- a/buildcraft_server/buildcraft/silicon/network/ConnectionHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -package buildcraft.silicon.network; - -import buildcraft.core.DefaultProps; -import net.minecraft.src.NetworkManager; -import net.minecraft.src.Packet1Login; -import net.minecraft.src.forge.IConnectionHandler; -import net.minecraft.src.forge.MessageManager; - -public class ConnectionHandler implements IConnectionHandler { - - @Override - public void onConnect(NetworkManager network) { - MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME); - } - - @Override - public void onLogin(NetworkManager network, Packet1Login login) { - // TODO Auto-generated method stub - - } - - @Override - public void onDisconnect(NetworkManager network, String message, Object[] args) { - // TODO Auto-generated method stub - - } - -} diff --git a/buildcraft_server/buildcraft/transport/network/ConnectionHandler.java b/buildcraft_server/buildcraft/transport/network/ConnectionHandler.java deleted file mode 100644 index f006a345..00000000 --- a/buildcraft_server/buildcraft/transport/network/ConnectionHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -package buildcraft.transport.network; - -import buildcraft.core.DefaultProps; -import net.minecraft.src.NetworkManager; -import net.minecraft.src.Packet1Login; -import net.minecraft.src.forge.IConnectionHandler; -import net.minecraft.src.forge.MessageManager; - -public class ConnectionHandler implements IConnectionHandler { - - @Override - public void onConnect(NetworkManager network) { - MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME); - } - - @Override - public void onLogin(NetworkManager network, Packet1Login login) { - // TODO Auto-generated method stub - - } - - @Override - public void onDisconnect(NetworkManager network, String message, Object[] args) { - // TODO Auto-generated method stub - - } - -} diff --git a/common/buildcraft/builders/gui/CraftingTemplate.java b/common/buildcraft/builders/gui/CraftingTemplate.java index 33f8896e..989d3641 100644 --- a/common/buildcraft/builders/gui/CraftingTemplate.java +++ b/common/buildcraft/builders/gui/CraftingTemplate.java @@ -1,8 +1,8 @@ -/** +/** * Copyright (c) SpaceToad, 2011 * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ @@ -10,15 +10,47 @@ package buildcraft.builders.gui; import buildcraft.builders.TileArchitect; +import buildcraft.core.gui.BuildCraftContainer; +import net.minecraft.src.EntityPlayer; import net.minecraft.src.ICrafting; import net.minecraft.src.IInventory; +import net.minecraft.src.Slot; -class CraftingTemplate extends CraftingTemplateRoot { +public class CraftingTemplate extends BuildCraftContainer { + + protected IInventory playerIInventory; + protected TileArchitect template; + protected int computingTime = 0; public CraftingTemplate(IInventory playerInventory, TileArchitect template) { - super(playerInventory, template); + super(template.getSizeInventory()); + this.playerIInventory = playerInventory; + this.template = template; + + addSlotToContainer(new Slot(template, 0, 55, 35)); + addSlotToContainer(new Slot(template, 1, 114, 35)); + + for (int l = 0; l < 3; l++) { + for (int k1 = 0; k1 < 9; k1++) { + addSlotToContainer(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, 84 + l * 18)); + } + + } + + for (int i1 = 0; i1 < 9; i1++) { + addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 142)); + } } + // FIXME: This is not called anymore + /* + @Override + public void onCraftGuiOpened(ICrafting icrafting) { + super.onCraftGuiOpened(icrafting); + icrafting.updateCraftingInventoryInfo(this, 0, template.computingTime); + } + */ + @Override public void updateCraftingResults() { super.updateCraftingResults(); @@ -36,4 +68,10 @@ class CraftingTemplate extends CraftingTemplateRoot { if (i == 0) template.computingTime = j; } + + @Override + public boolean canInteractWith(EntityPlayer entityplayer) { + return template.isUseableByPlayer(entityplayer); + } + } \ No newline at end of file diff --git a/common/buildcraft/builders/gui/CraftingTemplateRoot.java b/common/buildcraft/builders/gui/CraftingTemplateRoot.java deleted file mode 100644 index 753cf9bc..00000000 --- a/common/buildcraft/builders/gui/CraftingTemplateRoot.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.builders.gui; - -import buildcraft.builders.TileArchitect; -import buildcraft.core.gui.BuildCraftContainer; -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.IInventory; -import net.minecraft.src.Slot; - -public class CraftingTemplateRoot extends BuildCraftContainer { - - protected IInventory playerIInventory; - protected TileArchitect template; - protected int computingTime = 0; - - public CraftingTemplateRoot(IInventory playerInventory, TileArchitect template) { - super(template.getSizeInventory()); - this.playerIInventory = playerInventory; - this.template = template; - - addSlotToContainer(new Slot(template, 0, 55, 35)); - addSlotToContainer(new Slot(template, 1, 114, 35)); - - for (int l = 0; l < 3; l++) { - for (int k1 = 0; k1 < 9; k1++) { - addSlotToContainer(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, 84 + l * 18)); - } - - } - - for (int i1 = 0; i1 < 9; i1++) { - addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 142)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer entityplayer) { - return template.isUseableByPlayer(entityplayer); - } - -} \ No newline at end of file diff --git a/common/buildcraft/energy/gui/ContainerEngine.java b/common/buildcraft/energy/gui/ContainerEngine.java index 710ea8e0..d4d234e4 100644 --- a/common/buildcraft/energy/gui/ContainerEngine.java +++ b/common/buildcraft/energy/gui/ContainerEngine.java @@ -1,46 +1,68 @@ -/** +/** * Copyright (c) SpaceToad, 2011 * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.energy.gui; +import buildcraft.core.gui.BuildCraftContainer; +import buildcraft.energy.EngineStone; import buildcraft.energy.TileEngine; +import net.minecraft.src.EntityPlayer; +import net.minecraft.src.ICrafting; import net.minecraft.src.InventoryPlayer; +import net.minecraft.src.Slot; -public class ContainerEngine extends ContainerEngineRoot { +public class ContainerEngine extends BuildCraftContainer { + + protected TileEngine engine; public ContainerEngine(InventoryPlayer inventoryplayer, TileEngine tileEngine) { - super(inventoryplayer, tileEngine); - // TODO Auto-generated constructor stub + super(tileEngine.getSizeInventory()); + + engine = tileEngine; + + if (tileEngine.engine instanceof EngineStone) { + addSlotToContainer(new Slot(tileEngine, 0, 80, 41)); + } else { + addSlotToContainer(new Slot(tileEngine, 0, 52, 41)); + } + + for (int i = 0; i < 3; i++) { + for (int k = 0; k < 9; k++) { + addSlotToContainer(new Slot(inventoryplayer, k + i * 9 + 9, 8 + k * 18, 84 + i * 18)); + } + + } + + for (int j = 0; j < 9; j++) { + addSlotToContainer(new Slot(inventoryplayer, j, 8 + j * 18, 142)); + } } - // @Override - // public void updateCraftingResults() { - // super.updateCraftingResults(); - // - // System.out.println ("UPDATE CRAFTING RESULTS"); - // - // // for (int i = 0; i < crafters.size(); i++) { - // // ICrafting icrafting = (ICrafting) crafters.get(i); - // // - // // - // // - // // if (scaledBurnTime != engine.scaledBurnTime) { - // // icrafting.updateCraftingInventoryInfo(this, 0, - // // engine.scaledBurnTime); - // // } - // // } - // // - // // scaledBurnTime = engine.scaledBurnTime; - // } + @Override + public void updateCraftingResults() { + super.updateCraftingResults(); + + for (int i = 0; i < crafters.size(); i++) + engine.engine.sendGUINetworkData(this, (ICrafting) crafters.get(i)); + } @Override public void updateProgressBar(int i, int j) { engine.engine.getGUINetworkData(i, j); } + + public boolean isUsableByPlayer(EntityPlayer entityplayer) { + return engine.isUseableByPlayer(entityplayer); + } + + @Override + public boolean canInteractWith(EntityPlayer entityplayer) { + return engine.isUseableByPlayer(entityplayer); + } } diff --git a/common/buildcraft/energy/gui/ContainerEngineRoot.java b/common/buildcraft/energy/gui/ContainerEngineRoot.java deleted file mode 100644 index b45fa506..00000000 --- a/common/buildcraft/energy/gui/ContainerEngineRoot.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.energy.gui; - -import buildcraft.core.gui.BuildCraftContainer; -import buildcraft.energy.EngineStone; -import buildcraft.energy.TileEngine; -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.InventoryPlayer; -import net.minecraft.src.Slot; - -public class ContainerEngineRoot extends BuildCraftContainer { - - public ContainerEngineRoot(InventoryPlayer inventoryplayer, TileEngine tileEngine) { - super(tileEngine.getSizeInventory()); - - engine = tileEngine; - - if (tileEngine.engine instanceof EngineStone) { - addSlotToContainer(new Slot(tileEngine, 0, 80, 41)); - } else { - addSlotToContainer(new Slot(tileEngine, 0, 52, 41)); - } - - for (int i = 0; i < 3; i++) { - for (int k = 0; k < 9; k++) { - addSlotToContainer(new Slot(inventoryplayer, k + i * 9 + 9, 8 + k * 18, 84 + i * 18)); - } - - } - - for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventoryplayer, j, 8 + j * 18, 142)); - } - } - - public boolean isUsableByPlayer(EntityPlayer entityplayer) { - return engine.isUseableByPlayer(entityplayer); - } - - protected TileEngine engine; - - @Override - public boolean canInteractWith(EntityPlayer entityplayer) { - return engine.isUseableByPlayer(entityplayer); - } -} diff --git a/common/buildcraft/factory/BlockQuarry.java b/common/buildcraft/factory/BlockQuarry.java index 21246fd2..701d85f0 100644 --- a/common/buildcraft/factory/BlockQuarry.java +++ b/common/buildcraft/factory/BlockQuarry.java @@ -12,19 +12,13 @@ package buildcraft.factory; import java.util.ArrayList; import buildcraft.BuildCraftFactory; -import buildcraft.mod_BuildCraftEnergy; import buildcraft.api.core.Orientations; import buildcraft.api.core.Position; import buildcraft.api.tools.IToolWrench; import buildcraft.core.Box; import buildcraft.core.CoreProxy; import buildcraft.core.DefaultProps; -import buildcraft.core.GuiIds; -import buildcraft.core.IItemPipe; import buildcraft.core.Utils; -import buildcraft.energy.EngineIron; -import buildcraft.energy.EngineStone; -import buildcraft.energy.TileEngine; import buildcraft.factory.BlockMachineRoot; import net.minecraft.src.EntityLiving; diff --git a/common/buildcraft/factory/BlockRefinery.java b/common/buildcraft/factory/BlockRefinery.java index 51edad2f..829da0e2 100644 --- a/common/buildcraft/factory/BlockRefinery.java +++ b/common/buildcraft/factory/BlockRefinery.java @@ -13,7 +13,6 @@ import java.util.ArrayList; import buildcraft.BuildCraftCore; import buildcraft.mod_BuildCraftFactory; -import buildcraft.api.core.BuildCraftAPI; import buildcraft.api.core.Orientations; import buildcraft.api.core.Position; import buildcraft.api.liquids.LiquidManager; diff --git a/common/buildcraft/factory/BlockTank.java b/common/buildcraft/factory/BlockTank.java index d791a344..2d58dd1b 100644 --- a/common/buildcraft/factory/BlockTank.java +++ b/common/buildcraft/factory/BlockTank.java @@ -12,7 +12,6 @@ package buildcraft.factory; import java.util.ArrayList; import buildcraft.BuildCraftCore; -import buildcraft.api.core.BuildCraftAPI; import buildcraft.api.core.Orientations; import buildcraft.api.liquids.LiquidManager; import buildcraft.api.liquids.LiquidStack;