From d0854772d874956b712fb8692517f520d7f14a1c Mon Sep 17 00:00:00 2001 From: asiekierka Date: Sat, 13 Dec 2014 14:10:11 +0100 Subject: [PATCH] rethink things and remove IControllable from Tables - control the lasers! --- .../silicon/TileAdvancedCraftingTable.java | 8 ++------ common/buildcraft/silicon/TileAssemblyTable.java | 6 ++---- common/buildcraft/silicon/TileChargingTable.java | 2 +- common/buildcraft/silicon/TileIntegrationTable.java | 5 ++--- common/buildcraft/silicon/TileLaserTableBase.java | 13 +------------ 5 files changed, 8 insertions(+), 26 deletions(-) diff --git a/common/buildcraft/silicon/TileAdvancedCraftingTable.java b/common/buildcraft/silicon/TileAdvancedCraftingTable.java index cfbfe349..9fd37eb5 100644 --- a/common/buildcraft/silicon/TileAdvancedCraftingTable.java +++ b/common/buildcraft/silicon/TileAdvancedCraftingTable.java @@ -32,7 +32,6 @@ import net.minecraftforge.oredict.OreDictionary; import buildcraft.BuildCraftSilicon; import buildcraft.api.core.IInvSlot; import buildcraft.api.power.ILaserTarget; -import buildcraft.api.tiles.IControllable; import buildcraft.core.inventory.InvUtils; import buildcraft.core.inventory.InventoryCopy; import buildcraft.core.inventory.InventoryIterator; @@ -233,9 +232,6 @@ public class TileAdvancedCraftingTable extends TileLaserTableBase implements IIn if (worldObj.isRemote) { return; } - if (mode == IControllable.Mode.Off) { - return; - } updateRecipe(); searchNeighborsForIngredients(); locateAndBindIngredients(); @@ -440,12 +436,12 @@ public class TileAdvancedCraftingTable extends TileLaserTableBase implements IIn @Override public boolean canCraft() { - return craftable && !justCrafted && mode != IControllable.Mode.Off; + return craftable && !justCrafted; } @Override public boolean hasWork() { - return requiresLaserEnergy() && super.hasWork(); + return requiresLaserEnergy(); } @Override diff --git a/common/buildcraft/silicon/TileAssemblyTable.java b/common/buildcraft/silicon/TileAssemblyTable.java index c749c83b..e1361040 100644 --- a/common/buildcraft/silicon/TileAssemblyTable.java +++ b/common/buildcraft/silicon/TileAssemblyTable.java @@ -28,7 +28,6 @@ import buildcraft.BuildCraftCore; import buildcraft.api.recipes.CraftingResult; import buildcraft.api.recipes.IFlexibleCrafter; import buildcraft.api.recipes.IFlexibleRecipe; -import buildcraft.api.tiles.IControllable; import buildcraft.core.network.CommandWriter; import buildcraft.core.network.ICommandReceiver; import buildcraft.core.network.PacketCommand; @@ -79,8 +78,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory, } } - if (getEnergy() >= currentRecipe.craft(this, true).energyCost - && mode != IControllable.Mode.Off) { + if (getEnergy() >= currentRecipe.craft(this, true).energyCost) { setEnergy(0); if (currentRecipe.canBeCrafted(this)) { @@ -316,7 +314,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory, @Override public boolean hasWork() { - return currentRecipe != null && super.hasWork(); + return currentRecipe != null; } @Override diff --git a/common/buildcraft/silicon/TileChargingTable.java b/common/buildcraft/silicon/TileChargingTable.java index 6f4994ed..037de48b 100644 --- a/common/buildcraft/silicon/TileChargingTable.java +++ b/common/buildcraft/silicon/TileChargingTable.java @@ -17,7 +17,7 @@ public class TileChargingTable extends TileLaserTableBase implements IHasWork { public void updateEntity() { super.updateEntity(); - if (getEnergy() > 0 && mode != Mode.Off) { + if (getEnergy() > 0) { if (getRequiredEnergy() > 0) { ItemStack stack = this.getStackInSlot(0); IEnergyContainerItem containerItem = (IEnergyContainerItem) stack.getItem(); diff --git a/common/buildcraft/silicon/TileIntegrationTable.java b/common/buildcraft/silicon/TileIntegrationTable.java index 47dd4107..9731fa20 100644 --- a/common/buildcraft/silicon/TileIntegrationTable.java +++ b/common/buildcraft/silicon/TileIntegrationTable.java @@ -79,8 +79,7 @@ public class TileIntegrationTable extends TileLaserTableBase implements IFlexibl return; } - if (getEnergy() >= craftingPreview.energyCost - && mode != IControllable.Mode.Off) { + if (getEnergy() >= craftingPreview.energyCost) { setEnergy(0); craftingPreview = null; @@ -185,7 +184,7 @@ public class TileIntegrationTable extends TileLaserTableBase implements IFlexibl @Override public boolean hasWork() { - return craftingPreview != null && super.hasWork(); + return craftingPreview != null; } @Override diff --git a/common/buildcraft/silicon/TileLaserTableBase.java b/common/buildcraft/silicon/TileLaserTableBase.java index 9334943b..ca690944 100644 --- a/common/buildcraft/silicon/TileLaserTableBase.java +++ b/common/buildcraft/silicon/TileLaserTableBase.java @@ -22,7 +22,7 @@ import buildcraft.core.TileBuildCraft; import buildcraft.core.inventory.SimpleInventory; import buildcraft.core.utils.AverageUtil; -public abstract class TileLaserTableBase extends TileBuildCraft implements ILaserTarget, IInventory, IHasWork, IControllable { +public abstract class TileLaserTableBase extends TileBuildCraft implements ILaserTarget, IInventory, IHasWork { public int clientRequiredEnergy = 0; protected SimpleInventory inv = new SimpleInventory(getSizeInventory(), "inv", 64); @@ -194,15 +194,4 @@ public abstract class TileLaserTableBase extends TileBuildCraft implements ILase iCrafting.sendProgressBarUpdate(container, 4, lRecentEnergy & 0xFFFF); iCrafting.sendProgressBarUpdate(container, 5, (lRecentEnergy >>> 16) & 0xFFFF); } - - @Override - public boolean hasWork() { - return mode != IControllable.Mode.Off; - } - - @Override - public boolean acceptsControlMode(Mode mode) { - return mode == IControllable.Mode.On || - mode == IControllable.Mode.Off; - } }