From d3a40a764b690e253d5d6143fc0a56d058eec565 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Sat, 3 Nov 2012 11:01:09 +0800 Subject: [PATCH] Reformat --- src/common/assemblyline/ai/Task.java | 8 +- .../crafter/TileEntityCraftingArm.java | 81 ++++++++++--------- 2 files changed, 47 insertions(+), 42 deletions(-) diff --git a/src/common/assemblyline/ai/Task.java b/src/common/assemblyline/ai/Task.java index f3e35ef0f..1ef4991d7 100644 --- a/src/common/assemblyline/ai/Task.java +++ b/src/common/assemblyline/ai/Task.java @@ -4,7 +4,7 @@ import net.minecraft.src.TileEntity; /** * An AI Task that is used by TileEntities with - * simple AI. + * AI. * * @author Calclavia * @@ -32,11 +32,15 @@ public abstract class Task * - The amount of ticks this task * has been elapsed for. */ - protected void onDoTask() + protected void doTask() { this.ticks++; } + public void resetTask() + { + } + /** * @return Whether the task should keep * executing. diff --git a/src/common/assemblyline/machines/crafter/TileEntityCraftingArm.java b/src/common/assemblyline/machines/crafter/TileEntityCraftingArm.java index f66d5b699..c618dbedc 100644 --- a/src/common/assemblyline/machines/crafter/TileEntityCraftingArm.java +++ b/src/common/assemblyline/machines/crafter/TileEntityCraftingArm.java @@ -11,14 +11,16 @@ import net.minecraft.src.Packet250CustomPayload; import net.minecraft.src.TileEntity; import net.minecraftforge.common.ForgeDirection; -public class TileEntityCraftingArm extends TileEntityBase implements IElectricityReceiver { +public class TileEntityCraftingArm extends TileEntityBase implements IElectricityReceiver +{ public enum armTasks { - NONE,COLLECT,MINE,PLACE,SORT,CRAFT + NONE, COLLECT, MINE, PLACE, SORT, CRAFT } - + /** - * Entity robotic arm to be used with this tileEntity + * Entity robotic arm to be used with this + * tileEntity */ public EntityCraftingArm EntityArm = null; @@ -28,110 +30,109 @@ public class TileEntityCraftingArm extends TileEntityBase implements IElectricit public double maxJoules = 100; /** - * does this arm have a task to do + * does this arm have a task to do */ public boolean hasTask = true; /** * what kind of task this arm should do */ public armTasks task = armTasks.NONE; - + public void updateEntity() { super.updateEntity(); - if(this.ticks % 5 == 0 && !this.isDisabled() && this.hasTask && EntityArm != null) + if (this.ticks % 5 == 0 && !this.isDisabled() && this.hasTask && EntityArm != null) { this.jouleReceived -= this.wattUsed; this.doWork(); } } - + /** - * controls the robotic arm into doing a set task + * controls the robotic arm into doing a set + * task */ public void doWork() { - + } - + /** * UE methods */ @Override - public void onReceive(TileEntity sender, double amps, double voltage, - ForgeDirection side) { - this.jouleReceived = Math.max(jouleReceived + (amps * voltage), - maxJoules); + public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side) + { + this.jouleReceived = Math.max(jouleReceived + (amps * voltage), maxJoules); } @Override - public double wattRequest() { + public double wattRequest() + { return maxJoules - jouleReceived; } @Override - public boolean canReceiveFromSide(ForgeDirection side) { - if (side != ForgeDirection.UP) { - return true; - } + public boolean canReceiveFromSide(ForgeDirection side) + { + if (side != ForgeDirection.UP) { return true; } return false; } + @Override - public void onDisable(int duration) { + public void onDisable(int duration) + { // TODO Auto-generated method stub - + } - @Override - public boolean isDisabled() { + public boolean isDisabled() + { // TODO Auto-generated method stub return false; } - @Override - public boolean canConnect(ForgeDirection side) { - if(side != ForgeDirection.UP) - { - return true; - } + public boolean canConnect(ForgeDirection side) + { + if (side != ForgeDirection.UP) { return true; } return false; } @Override - public double getVoltage() { + public double getVoltage() + { // TODO Auto-generated method stub return 120; } + /** * Data */ @Override - public void handlePacketData(INetworkManager network, int packetType, - Packet250CustomPayload packet, EntityPlayer player, - ByteArrayDataInput dataStream) { + public void handlePacketData(INetworkManager network, int packetType, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream) + { // TODO Auto-generated method stub - + } /** * inventory */ @Override - public int getSizeInventory() { + public int getSizeInventory() + { // TODO Auto-generated method stub return 1; } - @Override - public String getInvName() { + public String getInvName() + { // TODO Auto-generated method stub return "RoboticArm"; } - - }