From c7a572609b0a8f6f2eb998bcccaa3aacc0ff4867 Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 23 Dec 2013 00:35:41 -0500 Subject: [PATCH] Fixed Battery Box outputs --- .../machine/TileEntityBatteryBox.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/com/builtbroken/assemblyline/machine/TileEntityBatteryBox.java b/src/com/builtbroken/assemblyline/machine/TileEntityBatteryBox.java index eec006230..d24b323b7 100644 --- a/src/com/builtbroken/assemblyline/machine/TileEntityBatteryBox.java +++ b/src/com/builtbroken/assemblyline/machine/TileEntityBatteryBox.java @@ -4,13 +4,8 @@ import java.util.EnumSet; import net.minecraft.inventory.Container; import net.minecraft.network.packet.Packet; -import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; import universalelectricity.api.CompatibilityModule; -import universalelectricity.api.energy.IEnergyInterface; -import universalelectricity.api.item.ElectricItemHelper; -import universalelectricity.api.vector.Vector3; -import universalelectricity.api.vector.VectorHelper; import com.builtbroken.minecraft.network.PacketHandler; import com.builtbroken.minecraft.prefab.TileEntityEnergyMachine; @@ -26,7 +21,7 @@ public class TileEntityBatteryBox extends TileEntityEnergyMachine { public TileEntityBatteryBox() { - super(0, 5000000); + super(10000, 5000000); this.invSlots = 2; this.hasGUI = true; } @@ -41,12 +36,18 @@ public class TileEntityBatteryBox extends TileEntityEnergyMachine /** Recharges electric item. */ this.setEnergy(ForgeDirection.UNKNOWN, this.getEnergy(ForgeDirection.UNKNOWN) - CompatibilityModule.chargeItem(this.getStackInSlot(0), Math.min(10000, this.getEnergyStored()), true)); /** Decharge electric item. */ - this.setEnergy(ForgeDirection.UNKNOWN, this.getEnergy(ForgeDirection.UNKNOWN) + CompatibilityModule.disChargeItem(this.getStackInSlot(1), Math.min(10000, this.getEnergyCapacity(ForgeDirection.UNKNOWN) - this.getEnergyStored()), true)); - + this.setEnergy(ForgeDirection.UNKNOWN, this.getEnergy(ForgeDirection.UNKNOWN) + CompatibilityModule.dischargeItem(this.getStackInSlot(1), Math.min(10000, this.getEnergyCapacity(ForgeDirection.UNKNOWN) - this.getEnergyStored()), true)); + /** Output to network, or connected machines */ this.produce(); } } + @Override + protected boolean consumePower(long watts, boolean doDrain) + { + return true; + } + @Override public boolean canConnect(ForgeDirection direction) { @@ -56,7 +57,7 @@ public class TileEntityBatteryBox extends TileEntityEnergyMachine @Override public EnumSet getOutputDirections() { - return EnumSet.of(ForgeDirection.getOrientation(this.getBlockMetadata()).getOpposite()); + return EnumSet.of(ForgeDirection.getOrientation(this.getBlockMetadata())); } /** The electrical input direction. @@ -66,7 +67,7 @@ public class TileEntityBatteryBox extends TileEntityEnergyMachine public EnumSet getInputDirections() { EnumSet et = EnumSet.allOf(ForgeDirection.class); - et.remove(ForgeDirection.getOrientation(this.getBlockMetadata()).getOpposite()); + et.remove(ForgeDirection.getOrientation(this.getBlockMetadata())); et.remove(ForgeDirection.UNKNOWN); return et; }