From 0f180e4f996b06753968b3b4040c3897f730fc0d Mon Sep 17 00:00:00 2001 From: Henry Mao Date: Wed, 6 Feb 2013 14:29:59 +0800 Subject: [PATCH] Reformat + Organize --- .../assemblyline/api/IArmbotUseable.java | 8 ++--- .../client/model/ModelCraneController.java | 20 ++++++------ .../client/render/RenderArmbot.java | 1 - .../client/render/RenderCrate.java | 5 ++- .../assemblyline/common/CommonProxy.java | 4 +-- .../assemblyline/common/block/BlockCrate.java | 10 ++++-- .../common/block/BlockTurntable.java | 6 ++-- .../common/block/ItemBlockCrate.java | 5 +-- .../common/block/TileEntityCrate.java | 5 ++- .../machine/TileEntityAssemblyNetwork.java | 3 -- .../common/machine/TileEntityManipulator.java | 31 ++++++++++++++----- .../common/machine/armbot/BlockArmbot.java | 5 ++- .../machine/armbot/TileEntityArmbot.java | 5 ++- .../machine/belt/BlockConveyorBelt.java | 10 ++++-- .../machine/belt/TileEntityConveyorBelt.java | 2 +- .../machine/belt/TileEntityElevatorBelt.java | 5 ++- .../common/machine/command/Command.java | 5 ++- .../common/machine/command/CommandBreak.java | 5 ++- .../common/machine/command/CommandDrop.java | 3 -- .../common/machine/command/CommandFire.java | 12 +++---- .../common/machine/command/CommandGrab.java | 1 - .../machine/command/CommandHarvest.java | 5 +-- .../common/machine/command/CommandIdle.java | 6 ++-- .../common/machine/command/CommandRepeat.java | 2 +- .../machine/command/CommandRotateBy.java | 25 ++++++++++----- .../machine/command/CommandRotateTo.java | 12 +++++-- .../common/machine/command/CommandUse.java | 1 - .../machine/crane/BlockCraneController.java | 14 ++++----- .../crane/TileEntityCraneController.java | 2 +- .../machine/detector/BlockDetector.java | 10 ++++-- .../common/machine/encoder/BlockEncoder.java | 4 ++- .../machine/encoder/ContainerEncoder.java | 15 +++++++-- .../machine/imprinter/BlockImprinter.java | 4 ++- .../machine/imprinter/ContainerImprinter.java | 20 +++++++++--- .../machine/imprinter/ItemImprinter.java | 4 +-- .../machine/imprinter/SlotCraftingResult.java | 12 +++++-- .../imprinter/TileEntityFilterable.java | 5 ++- .../imprinter/TileEntityImprinter.java | 25 +++++++++------ 38 files changed, 207 insertions(+), 110 deletions(-) diff --git a/src/minecraft/assemblyline/api/IArmbotUseable.java b/src/minecraft/assemblyline/api/IArmbotUseable.java index c6c9259d7..22b6151e5 100644 --- a/src/minecraft/assemblyline/api/IArmbotUseable.java +++ b/src/minecraft/assemblyline/api/IArmbotUseable.java @@ -1,9 +1,8 @@ package assemblyline.api; -import net.minecraft.entity.Entity; - /** - * The IUseable inteface is used by the ArmBot so that it may interact with Tile Entities. onUse will be called on the block an ArmBot is touching whenever the USE command is run on it. + * The IUseable inteface is used by the ArmBot so that it may interact with Tile Entities. onUse + * will be called on the block an ArmBot is touching whenever the USE command is run on it. * * @author Briman0094 * @@ -12,7 +11,8 @@ public interface IArmbotUseable { /** - * Called when the ArmBot command "USE" is run. This is called on any IUseable the ArmBot is touching. + * Called when the ArmBot command "USE" is run. This is called on any IUseable the ArmBot is + * touching. * * @param armbot - The Armbot instance. */ diff --git a/src/minecraft/assemblyline/client/model/ModelCraneController.java b/src/minecraft/assemblyline/client/model/ModelCraneController.java index 8a71cab6e..5e3463f13 100644 --- a/src/minecraft/assemblyline/client/model/ModelCraneController.java +++ b/src/minecraft/assemblyline/client/model/ModelCraneController.java @@ -12,15 +12,15 @@ import net.minecraft.client.model.ModelRenderer; public class ModelCraneController extends ModelBase { // fields - ModelRenderer Base2; - ModelRenderer Base; - ModelRenderer ConnectorFront; - ModelRenderer Decoration1; - ModelRenderer Decoration2; - ModelRenderer Decoration3; - ModelRenderer Decoration4; - ModelRenderer ConnectorTop; - ModelRenderer ConnectorRight; + ModelRenderer Base2; + ModelRenderer Base; + ModelRenderer ConnectorFront; + ModelRenderer Decoration1; + ModelRenderer Decoration2; + ModelRenderer Decoration3; + ModelRenderer Decoration4; + ModelRenderer ConnectorTop; + ModelRenderer ConnectorRight; public ModelCraneController() { @@ -103,7 +103,7 @@ public class ModelCraneController extends ModelBase setRotation(ConnectorFront, 0F, 1.570796F, 0F); ConnectorRight.setRotationPoint(0.01F, 12F, -4F); setRotation(ConnectorRight, 0F, 0F, 0F); - + Base2.render(scale); Base.render(scale); ConnectorFront.render(scale); diff --git a/src/minecraft/assemblyline/client/render/RenderArmbot.java b/src/minecraft/assemblyline/client/render/RenderArmbot.java index 5b0eb5534..f1f4e0bc3 100644 --- a/src/minecraft/assemblyline/client/render/RenderArmbot.java +++ b/src/minecraft/assemblyline/client/render/RenderArmbot.java @@ -10,7 +10,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; -import net.minecraftforge.client.ForgeHooksClient; import org.lwjgl.opengl.GL11; diff --git a/src/minecraft/assemblyline/client/render/RenderCrate.java b/src/minecraft/assemblyline/client/render/RenderCrate.java index 0446d12da..52054a54b 100644 --- a/src/minecraft/assemblyline/client/render/RenderCrate.java +++ b/src/minecraft/assemblyline/client/render/RenderCrate.java @@ -103,7 +103,10 @@ public class RenderCrate extends TileEntitySpecialRenderer { World world = tileEntity.worldObj; - if (world.isBlockOpaqueCube(tileEntity.xCoord + xDifference, tileEntity.yCoord, tileEntity.zCoord + zDifference)) { return; } + if (world.isBlockOpaqueCube(tileEntity.xCoord + xDifference, tileEntity.yCoord, tileEntity.zCoord + zDifference)) + { + return; + } int br = world.getLightBrightnessForSkyBlocks(tileEntity.xCoord + xDifference, tileEntity.yCoord, tileEntity.zCoord + zDifference, 0); int var11 = br % 65536; diff --git a/src/minecraft/assemblyline/common/CommonProxy.java b/src/minecraft/assemblyline/common/CommonProxy.java index 197c696e8..bfdedf6ec 100644 --- a/src/minecraft/assemblyline/common/CommonProxy.java +++ b/src/minecraft/assemblyline/common/CommonProxy.java @@ -27,8 +27,8 @@ import cpw.mods.fml.common.registry.GameRegistry; public class CommonProxy implements IGuiHandler { - public static final int GUI_IMPRINTER = 1; - public static final int GUI_ENCODER = 2; + public static final int GUI_IMPRINTER = 1; + public static final int GUI_ENCODER = 2; public void preInit() { diff --git a/src/minecraft/assemblyline/common/block/BlockCrate.java b/src/minecraft/assemblyline/common/block/BlockCrate.java index 721ea77ff..4840a52fc 100644 --- a/src/minecraft/assemblyline/common/block/BlockCrate.java +++ b/src/minecraft/assemblyline/common/block/BlockCrate.java @@ -12,7 +12,8 @@ import assemblyline.common.AssemblyLine; import assemblyline.common.TabAssemblyLine; /** - * A block that allows the placement of mass amount of a specific item within it. It will be allowed to go on Conveyor Belts + * A block that allows the placement of mass amount of a specific item within it. It will be allowed + * to go on Conveyor Belts * * @author Calclavia * @@ -110,7 +111,7 @@ public class BlockCrate extends BlockMachine if (containedStack != null && (crateStack == null || (crateStack != null && containedStack.getItem().itemID == crateStack.getItem().itemID && containedStack.getItemDamage() == crateStack.getItemDamage()))) { ItemStack returned = this.putIn(tileEntity, containedStack); - ItemBlockCrate.setContainingItemStack(currentStack, returned ); + ItemBlockCrate.setContainingItemStack(currentStack, returned); return true; } @@ -246,7 +247,10 @@ public class BlockCrate extends BlockMachine itemStack.stackSize = 0; } - if (itemStack.stackSize <= 0) { return null; } + if (itemStack.stackSize <= 0) + { + return null; + } return itemStack; } diff --git a/src/minecraft/assemblyline/common/block/BlockTurntable.java b/src/minecraft/assemblyline/common/block/BlockTurntable.java index 4756e00c2..ec15aedf8 100644 --- a/src/minecraft/assemblyline/common/block/BlockTurntable.java +++ b/src/minecraft/assemblyline/common/block/BlockTurntable.java @@ -1,9 +1,9 @@ package assemblyline.common.block; -import assemblyline.common.AssemblyLine; -import assemblyline.common.TabAssemblyLine; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import assemblyline.common.AssemblyLine; +import assemblyline.common.TabAssemblyLine; public class BlockTurntable extends Block { @@ -25,7 +25,7 @@ public class BlockTurntable extends Block { return this.blockIndexInTexture + 1; } - + return this.blockIndexInTexture + 2; } } diff --git a/src/minecraft/assemblyline/common/block/ItemBlockCrate.java b/src/minecraft/assemblyline/common/block/ItemBlockCrate.java index ca66affac..6b367816c 100644 --- a/src/minecraft/assemblyline/common/block/ItemBlockCrate.java +++ b/src/minecraft/assemblyline/common/block/ItemBlockCrate.java @@ -50,7 +50,7 @@ public class ItemBlockCrate extends ItemBlock } } } - + public static void setContainingItemStack(ItemStack itemStack, ItemStack containingStack) { if (itemStack.stackTagCompound == null) @@ -66,7 +66,8 @@ public class ItemBlockCrate extends ItemBlock itemStack.getTagCompound().setTag("Item", itemTagCompound); itemStack.getTagCompound().setInteger("Count", containingStack.stackSize); - }else + } + else { itemStack.getTagCompound().setTag("Item", new NBTTagCompound()); itemStack.getTagCompound().setInteger("Count", 0); diff --git a/src/minecraft/assemblyline/common/block/TileEntityCrate.java b/src/minecraft/assemblyline/common/block/TileEntityCrate.java index 438124933..e602199f6 100644 --- a/src/minecraft/assemblyline/common/block/TileEntityCrate.java +++ b/src/minecraft/assemblyline/common/block/TileEntityCrate.java @@ -65,7 +65,10 @@ public class TileEntityCrate extends TileEntityAdvanced implements IInventory, I @Override public Packet getDescriptionPacket() { - if (this.containingItems[0] != null) { return PacketManager.getPacket(AssemblyLine.CHANNEL, this, true, this.containingItems[0].itemID, this.containingItems[0].stackSize, this.containingItems[0].getItemDamage()); } + if (this.containingItems[0] != null) + { + return PacketManager.getPacket(AssemblyLine.CHANNEL, this, true, this.containingItems[0].itemID, this.containingItems[0].stackSize, this.containingItems[0].getItemDamage()); + } return PacketManager.getPacket(AssemblyLine.CHANNEL, this, false); } diff --git a/src/minecraft/assemblyline/common/machine/TileEntityAssemblyNetwork.java b/src/minecraft/assemblyline/common/machine/TileEntityAssemblyNetwork.java index dbe20424c..7c39f95c2 100644 --- a/src/minecraft/assemblyline/common/machine/TileEntityAssemblyNetwork.java +++ b/src/minecraft/assemblyline/common/machine/TileEntityAssemblyNetwork.java @@ -3,11 +3,8 @@ package assemblyline.common.machine; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; -import universalelectricity.core.electricity.ElectricityNetwork; import universalelectricity.core.electricity.ElectricityPack; import universalelectricity.prefab.network.PacketManager; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.relauncher.Side; /** * A class to be inherited by all machines on the assembly line. This will allow all machines to be diff --git a/src/minecraft/assemblyline/common/machine/TileEntityManipulator.java b/src/minecraft/assemblyline/common/machine/TileEntityManipulator.java index e53ca3a15..3e487f840 100644 --- a/src/minecraft/assemblyline/common/machine/TileEntityManipulator.java +++ b/src/minecraft/assemblyline/common/machine/TileEntityManipulator.java @@ -280,7 +280,10 @@ public class TileEntityManipulator extends TileEntityFilterable implements IRota for (int i = startIndex; i < startIndex + inventory.getSizeInventorySide(direction); i++) { itemStack = this.addStackToInventory(i, inventory, itemStack); - if (itemStack == null) { return null; } + if (itemStack == null) + { + return null; + } } } else if (tileEntity instanceof IInventory) @@ -290,12 +293,18 @@ public class TileEntityManipulator extends TileEntityFilterable implements IRota for (int i = 0; i < inventory.getSizeInventory(); i++) { itemStack = this.addStackToInventory(i, inventory, itemStack); - if (itemStack == null) { return null; } + if (itemStack == null) + { + return null; + } } } } - if (itemStack.stackSize <= 0) { return null; } + if (itemStack.stackSize <= 0) + { + return null; + } return itemStack; } @@ -305,25 +314,31 @@ public class TileEntityManipulator extends TileEntityFilterable implements IRota if (inventory.getSizeInventory() > slotIndex) { ItemStack stackInInventory = inventory.getStackInSlot(slotIndex); - + if (stackInInventory == null) { inventory.setInventorySlotContents(slotIndex, itemStack); - if (inventory.getStackInSlot(slotIndex) == null) { return itemStack; } + if (inventory.getStackInSlot(slotIndex) == null) + { + return itemStack; + } return null; } else if (stackInInventory.isItemEqual(itemStack) && stackInInventory.isStackable()) - { + { stackInInventory = stackInInventory.copy(); int stackLim = Math.min(inventory.getInventoryStackLimit(), itemStack.getMaxStackSize()); - int rejectedAmount = Math.max((stackInInventory.stackSize + itemStack.stackSize) - stackLim , 0); + int rejectedAmount = Math.max((stackInInventory.stackSize + itemStack.stackSize) - stackLim, 0); stackInInventory.stackSize = Math.min(Math.max((stackInInventory.stackSize + itemStack.stackSize - rejectedAmount), 0), inventory.getInventoryStackLimit()); itemStack.stackSize = rejectedAmount; inventory.setInventorySlotContents(slotIndex, stackInInventory); } } - if (itemStack.stackSize <= 0) { return null; } + if (itemStack.stackSize <= 0) + { + return null; + } return itemStack; } diff --git a/src/minecraft/assemblyline/common/machine/armbot/BlockArmbot.java b/src/minecraft/assemblyline/common/machine/armbot/BlockArmbot.java index 97ded7a29..917456440 100644 --- a/src/minecraft/assemblyline/common/machine/armbot/BlockArmbot.java +++ b/src/minecraft/assemblyline/common/machine/armbot/BlockArmbot.java @@ -39,7 +39,10 @@ public class BlockArmbot extends BlockMachine { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - if (tileEntity != null && tileEntity instanceof IMultiBlock) { return ((IMultiBlock) tileEntity).onActivated(player); } + if (tileEntity != null && tileEntity instanceof IMultiBlock) + { + return ((IMultiBlock) tileEntity).onActivated(player); + } return false; } diff --git a/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java b/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java index a3934c0cb..364543b9d 100644 --- a/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java +++ b/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java @@ -802,7 +802,10 @@ public class TileEntityArmbot extends TileEntityAssemblyNetwork implements IMult { for (int i = 0; i < found.size(); i++) { - if (found.get(i) != null && !(found.get(i) instanceof EntityPlayer) && found.get(i).ridingEntity == null) { return new Object[] { true }; } + if (found.get(i) != null && !(found.get(i) instanceof EntityPlayer) && found.get(i).ridingEntity == null) + { + return new Object[] { true }; + } } } diff --git a/src/minecraft/assemblyline/common/machine/belt/BlockConveyorBelt.java b/src/minecraft/assemblyline/common/machine/belt/BlockConveyorBelt.java index fb3261b8d..28131bc7a 100644 --- a/src/minecraft/assemblyline/common/machine/belt/BlockConveyorBelt.java +++ b/src/minecraft/assemblyline/common/machine/belt/BlockConveyorBelt.java @@ -67,8 +67,14 @@ public class BlockConveyorBelt extends BlockMachine { TileEntityConveyorBelt tileEntity = (TileEntityConveyorBelt) t; - if (tileEntity.getSlant() == SlantType.UP || tileEntity.getSlant() == SlantType.DOWN) { return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double) x + this.minX, (double) y + this.minY, (double) z + this.minZ, (double) x + 1, (double) y + 1, (double) z + 1); } - if (tileEntity.getSlant() == SlantType.TOP) { return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double) x + this.minX, (double) y + 0.68f, (double) z + this.minZ, (double) x + this.maxX, (double) y + 0.98f, (double) z + this.maxZ); } + if (tileEntity.getSlant() == SlantType.UP || tileEntity.getSlant() == SlantType.DOWN) + { + return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double) x + this.minX, (double) y + this.minY, (double) z + this.minZ, (double) x + 1, (double) y + 1, (double) z + 1); + } + if (tileEntity.getSlant() == SlantType.TOP) + { + return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double) x + this.minX, (double) y + 0.68f, (double) z + this.minZ, (double) x + this.maxX, (double) y + 0.98f, (double) z + this.maxZ); + } } return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double) x + this.minX, (double) y + this.minY, (double) z + this.minZ, (double) x + this.maxX, (double) y + this.maxY, (double) z + this.maxZ); diff --git a/src/minecraft/assemblyline/common/machine/belt/TileEntityConveyorBelt.java b/src/minecraft/assemblyline/common/machine/belt/TileEntityConveyorBelt.java index 1c1966e41..5ca725e8c 100644 --- a/src/minecraft/assemblyline/common/machine/belt/TileEntityConveyorBelt.java +++ b/src/minecraft/assemblyline/common/machine/belt/TileEntityConveyorBelt.java @@ -305,7 +305,7 @@ public class TileEntityConveyorBelt extends TileEntityAssemblyNetwork implements } } - + return this.animFrame; } diff --git a/src/minecraft/assemblyline/common/machine/belt/TileEntityElevatorBelt.java b/src/minecraft/assemblyline/common/machine/belt/TileEntityElevatorBelt.java index 3b9f8e88c..28ff772cf 100644 --- a/src/minecraft/assemblyline/common/machine/belt/TileEntityElevatorBelt.java +++ b/src/minecraft/assemblyline/common/machine/belt/TileEntityElevatorBelt.java @@ -27,7 +27,10 @@ public class TileEntityElevatorBelt extends TileEntityConveyorBelt public boolean isBellowABelt() { TileEntity ent = worldObj.getBlockTileEntity(xCoord, xCoord - 1, zCoord); - if (ent instanceof TileEntityElevatorBelt) { return true; } + if (ent instanceof TileEntityElevatorBelt) + { + return true; + } return false; } diff --git a/src/minecraft/assemblyline/common/machine/command/Command.java b/src/minecraft/assemblyline/common/machine/command/Command.java index d3ac5fc8d..cec42edd2 100644 --- a/src/minecraft/assemblyline/common/machine/command/Command.java +++ b/src/minecraft/assemblyline/common/machine/command/Command.java @@ -112,7 +112,10 @@ public abstract class Command */ protected String getArg(int i) { - if (i >= 0 && i < this.parameters.length) { return this.parameters[i]; } + if (i >= 0 && i < this.parameters.length) + { + return this.parameters[i]; + } return null; } diff --git a/src/minecraft/assemblyline/common/machine/command/CommandBreak.java b/src/minecraft/assemblyline/common/machine/command/CommandBreak.java index 96115ed51..eb004f7b4 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandBreak.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandBreak.java @@ -3,7 +3,6 @@ package assemblyline.common.machine.command; import java.util.ArrayList; import net.minecraft.block.Block; -import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -52,8 +51,10 @@ public class CommandBreak extends Command */ return true; } + /** * Drops an item stack at the exact center of the coords given + * * @param world * @param x * @param y @@ -69,8 +70,10 @@ public class CommandBreak extends Command world.spawnEntityInWorld(entity); } } + /** * grabs all the items that the block can drop then pass them onto dropBlockAsItem_do + * * @param world * @param x * @param y diff --git a/src/minecraft/assemblyline/common/machine/command/CommandDrop.java b/src/minecraft/assemblyline/common/machine/command/CommandDrop.java index c9022136b..c2db6069e 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandDrop.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandDrop.java @@ -1,8 +1,5 @@ package assemblyline.common.machine.command; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; - public class CommandDrop extends Command { @Override diff --git a/src/minecraft/assemblyline/common/machine/command/CommandFire.java b/src/minecraft/assemblyline/common/machine/command/CommandFire.java index 8b9df0ba0..32a9bca50 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandFire.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandFire.java @@ -12,13 +12,13 @@ import universalelectricity.core.vector.Vector3; public class CommandFire extends Command { - private static final float MIN_ACTUAL_PITCH = -80; - private static final float MAX_ACTUAL_PITCH = 80; + private static final float MIN_ACTUAL_PITCH = -80; + private static final float MAX_ACTUAL_PITCH = 80; - private float actualYaw; - private float actualPitch; - private float velocity; - private Vector3 finalVelocity; + private float actualYaw; + private float actualPitch; + private float velocity; + private Vector3 finalVelocity; @Override public void onTaskStart() diff --git a/src/minecraft/assemblyline/common/machine/command/CommandGrab.java b/src/minecraft/assemblyline/common/machine/command/CommandGrab.java index 9ca2ed954..b044e61af 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandGrab.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandGrab.java @@ -3,7 +3,6 @@ package assemblyline.common.machine.command; import java.util.List; import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.util.AxisAlignedBB; diff --git a/src/minecraft/assemblyline/common/machine/command/CommandHarvest.java b/src/minecraft/assemblyline/common/machine/command/CommandHarvest.java index 1f667a71f..5703d931b 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandHarvest.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandHarvest.java @@ -1,9 +1,5 @@ package assemblyline.common.machine.command; -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import universalelectricity.core.vector.Vector3; - /** * Used by arms to break a specific block in a position. * @@ -12,6 +8,7 @@ import universalelectricity.core.vector.Vector3; public class CommandHarvest extends CommandBreak { private CommandRotateTo rotateToCommand; + @Override public void onTaskStart() { diff --git a/src/minecraft/assemblyline/common/machine/command/CommandIdle.java b/src/minecraft/assemblyline/common/machine/command/CommandIdle.java index b65e7f116..e9c3ee29f 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandIdle.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandIdle.java @@ -36,7 +36,7 @@ public class CommandIdle extends Command return false; } - + @Override public void readFromNBT(NBTTagCompound taskCompound) { @@ -44,7 +44,7 @@ public class CommandIdle extends Command this.idleTime = taskCompound.getInteger("idleTime"); this.totalIdleTime = taskCompound.getInteger("idleTotal"); } - + @Override public void writeToNBT(NBTTagCompound taskCompound) { @@ -52,7 +52,7 @@ public class CommandIdle extends Command taskCompound.setInteger("idleTime", this.idleTime); taskCompound.setInteger("idleTotal", this.totalIdleTime); } - + @Override public String toString() { diff --git a/src/minecraft/assemblyline/common/machine/command/CommandRepeat.java b/src/minecraft/assemblyline/common/machine/command/CommandRepeat.java index 89513360f..63fe7cfaf 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandRepeat.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandRepeat.java @@ -70,7 +70,7 @@ public class CommandRepeat extends Command taskCompound.setInteger("repCur", this.curReps); taskCompound.setInteger("repGoal", this.numReps); } - + @Override public String toString() { diff --git a/src/minecraft/assemblyline/common/machine/command/CommandRotateBy.java b/src/minecraft/assemblyline/common/machine/command/CommandRotateBy.java index 128c2f9c9..ea9f222bb 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandRotateBy.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandRotateBy.java @@ -9,10 +9,10 @@ import net.minecraft.nbt.NBTTagCompound; */ public class CommandRotateBy extends Command { - float targetRotationYaw = 0; - float targetRotationPitch = 0; - float deltaPitch = 0, deltaYaw = 90; - float totalTicks = 0f; + float targetRotationYaw = 0; + float targetRotationPitch = 0; + float deltaPitch = 0, deltaYaw = 90; + float totalTicks = 0f; @Override public void onTaskStart() @@ -62,7 +62,10 @@ public class CommandRotateBy extends Command /* * float rotationalDifference = Math.abs(this.tileEntity.rotationYaw - this.targetRotation); * - * if (rotationalDifference < ROTATION_SPEED) { this.tileEntity.rotationYaw = this.targetRotation; } else { if (this.tileEntity.rotationYaw > this.targetRotation) { this.tileEntity.rotationYaw -= ROTATION_SPEED; } else { this.tileEntity.rotationYaw += ROTATION_SPEED; } this.ticks = 0; } + * if (rotationalDifference < ROTATION_SPEED) { this.tileEntity.rotationYaw = + * this.targetRotation; } else { if (this.tileEntity.rotationYaw > this.targetRotation) { + * this.tileEntity.rotationYaw -= ROTATION_SPEED; } else { this.tileEntity.rotationYaw += + * ROTATION_SPEED; } this.ticks = 0; } */ // set the rotation to the target immediately and let the client handle animating it @@ -73,9 +76,15 @@ public class CommandRotateBy extends Command if (Math.abs(this.tileEntity.rotationPitch - this.targetRotationPitch) > 0.001f) this.tileEntity.rotationPitch = this.targetRotationPitch; - //if (this.ticks < this.totalTicks) { return true; } - if (Math.abs(this.tileEntity.renderPitch - this.tileEntity.rotationPitch) > 0.001f) { return true; } - if (Math.abs(this.tileEntity.renderYaw - this.tileEntity.rotationYaw) > 0.001f) { return true; } + // if (this.ticks < this.totalTicks) { return true; } + if (Math.abs(this.tileEntity.renderPitch - this.tileEntity.rotationPitch) > 0.001f) + { + return true; + } + if (Math.abs(this.tileEntity.renderYaw - this.tileEntity.rotationYaw) > 0.001f) + { + return true; + } return false; } diff --git a/src/minecraft/assemblyline/common/machine/command/CommandRotateTo.java b/src/minecraft/assemblyline/common/machine/command/CommandRotateTo.java index c94207bfc..2080ba3d4 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandRotateTo.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandRotateTo.java @@ -72,9 +72,15 @@ public class CommandRotateTo extends Command this.tileEntity.rotationYaw = this.targetRotationYaw; this.tileEntity.rotationPitch = this.targetRotationPitch; - //if (this.ticks < this.totalTicks) { return true; } - if (Math.abs(this.tileEntity.renderPitch - this.tileEntity.rotationPitch) > 0.001f) { return true; } - if (Math.abs(this.tileEntity.renderYaw - this.tileEntity.rotationYaw) > 0.001f) { return true; } + // if (this.ticks < this.totalTicks) { return true; } + if (Math.abs(this.tileEntity.renderPitch - this.tileEntity.rotationPitch) > 0.001f) + { + return true; + } + if (Math.abs(this.tileEntity.renderYaw - this.tileEntity.rotationYaw) > 0.001f) + { + return true; + } return false; } diff --git a/src/minecraft/assemblyline/common/machine/command/CommandUse.java b/src/minecraft/assemblyline/common/machine/command/CommandUse.java index 94cfaae01..06c929519 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandUse.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandUse.java @@ -1,6 +1,5 @@ package assemblyline.common.machine.command; -import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import assemblyline.api.IArmbotUseable; diff --git a/src/minecraft/assemblyline/common/machine/crane/BlockCraneController.java b/src/minecraft/assemblyline/common/machine/crane/BlockCraneController.java index f6e08da18..22db999aa 100644 --- a/src/minecraft/assemblyline/common/machine/crane/BlockCraneController.java +++ b/src/minecraft/assemblyline/common/machine/crane/BlockCraneController.java @@ -21,13 +21,13 @@ public class BlockCraneController extends BlockMachine this.setHardness(5.0f); this.setCreativeTab(TabAssemblyLine.INSTANCE); } - + @Override public boolean isOpaqueCube() { return false; } - + @Override public boolean renderAsNormalBlock() { @@ -40,22 +40,22 @@ public class BlockCraneController extends BlockMachine int rot = (int) Math.min((entity.rotationYaw - 45f) / 90f, 3); switch (rot) { - case 0: //WEST + case 0: // WEST { world.setBlockMetadataWithNotify(x, y, z, ForgeDirection.WEST.ordinal()); break; } - case 1: //NORTH + case 1: // NORTH { world.setBlockMetadataWithNotify(x, y, z, ForgeDirection.NORTH.ordinal()); break; } - case 2: //EAST + case 2: // EAST { world.setBlockMetadataWithNotify(x, y, z, ForgeDirection.EAST.ordinal()); break; } - default: //SOUTH + default: // SOUTH { world.setBlockMetadataWithNotify(x, y, z, ForgeDirection.SOUTH.ordinal()); break; @@ -69,7 +69,7 @@ public class BlockCraneController extends BlockMachine { return BlockRenderingHandler.BLOCK_RENDER_ID; } - + @Override public TileEntity createNewTileEntity(World world, int metadata) { diff --git a/src/minecraft/assemblyline/common/machine/crane/TileEntityCraneController.java b/src/minecraft/assemblyline/common/machine/crane/TileEntityCraneController.java index 50b47ee75..3af0b379d 100644 --- a/src/minecraft/assemblyline/common/machine/crane/TileEntityCraneController.java +++ b/src/minecraft/assemblyline/common/machine/crane/TileEntityCraneController.java @@ -4,5 +4,5 @@ import assemblyline.common.machine.TileEntityAssemblyNetwork; public class TileEntityCraneController extends TileEntityAssemblyNetwork { - + } diff --git a/src/minecraft/assemblyline/common/machine/detector/BlockDetector.java b/src/minecraft/assemblyline/common/machine/detector/BlockDetector.java index b8a3264ec..87a9b72a4 100644 --- a/src/minecraft/assemblyline/common/machine/detector/BlockDetector.java +++ b/src/minecraft/assemblyline/common/machine/detector/BlockDetector.java @@ -91,7 +91,10 @@ public class BlockDetector extends BlockImprintable @Override public int getBlockTextureFromSideAndMetadata(int side, int metadata) { - if (side == ForgeDirection.DOWN.ordinal()) { return this.blockIndexInTexture + 1; } + if (side == ForgeDirection.DOWN.ordinal()) + { + return this.blockIndexInTexture + 1; + } return this.blockIndexInTexture; } @@ -150,7 +153,10 @@ public class BlockDetector extends BlockImprintable TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity != null) { - if (tileEntity instanceof TileEntityDetector) { return ((TileEntityDetector) tileEntity).isPoweringTo(ForgeDirection.getOrientation(direction)); } + if (tileEntity instanceof TileEntityDetector) + { + return ((TileEntityDetector) tileEntity).isPoweringTo(ForgeDirection.getOrientation(direction)); + } } return false; diff --git a/src/minecraft/assemblyline/common/machine/encoder/BlockEncoder.java b/src/minecraft/assemblyline/common/machine/encoder/BlockEncoder.java index af55dfefb..25456d79d 100644 --- a/src/minecraft/assemblyline/common/machine/encoder/BlockEncoder.java +++ b/src/minecraft/assemblyline/common/machine/encoder/BlockEncoder.java @@ -30,7 +30,9 @@ public class BlockEncoder extends BlockMachine return this.blockIndexInTexture; } - else if (side == 1) { return this.blockIndexInTexture + 1; + else if (side == 1) + { + return this.blockIndexInTexture + 1; } diff --git a/src/minecraft/assemblyline/common/machine/encoder/ContainerEncoder.java b/src/minecraft/assemblyline/common/machine/encoder/ContainerEncoder.java index 22ca4458d..47d547a6b 100644 --- a/src/minecraft/assemblyline/common/machine/encoder/ContainerEncoder.java +++ b/src/minecraft/assemblyline/common/machine/encoder/ContainerEncoder.java @@ -64,10 +64,16 @@ public class ContainerEncoder extends Container { if (this.getSlot(0).isItemValid(slotStack)) { - if (!this.mergeItemStack(slotStack, 0, 1, false)) { return null; } + if (!this.mergeItemStack(slotStack, 0, 1, false)) + { + return null; + } } } - else if (!this.mergeItemStack(slotStack, this.containingItems.length, 37, false)) { return null; } + else if (!this.mergeItemStack(slotStack, this.containingItems.length, 37, false)) + { + return null; + } if (slotStack.stackSize == 0) { @@ -78,7 +84,10 @@ public class ContainerEncoder extends Container slotObj.onSlotChanged(); } - if (slotStack.stackSize == copyStack.stackSize) { return null; } + if (slotStack.stackSize == copyStack.stackSize) + { + return null; + } slotObj.onPickupFromSlot(player, slotStack); } diff --git a/src/minecraft/assemblyline/common/machine/imprinter/BlockImprinter.java b/src/minecraft/assemblyline/common/machine/imprinter/BlockImprinter.java index 0d47180de..6c98a079a 100644 --- a/src/minecraft/assemblyline/common/machine/imprinter/BlockImprinter.java +++ b/src/minecraft/assemblyline/common/machine/imprinter/BlockImprinter.java @@ -30,7 +30,9 @@ public class BlockImprinter extends BlockMachine return this.blockIndexInTexture; } - else if (side == 1) { return this.blockIndexInTexture + 1; + else if (side == 1) + { + return this.blockIndexInTexture + 1; } diff --git a/src/minecraft/assemblyline/common/machine/imprinter/ContainerImprinter.java b/src/minecraft/assemblyline/common/machine/imprinter/ContainerImprinter.java index 97c559ea5..12ef9f51c 100644 --- a/src/minecraft/assemblyline/common/machine/imprinter/ContainerImprinter.java +++ b/src/minecraft/assemblyline/common/machine/imprinter/ContainerImprinter.java @@ -92,11 +92,20 @@ public class ContainerImprinter extends Container implements ISlotWatcher { if (this.getSlot(this.tileEntity.IMPRINTER_MATRIX_START).isItemValid(slotStack)) { - if (!this.mergeItemStack(slotStack, this.tileEntity.IMPRINTER_MATRIX_START, this.tileEntity.IMPRINTER_MATRIX_START + 1, true)) { return null; } + if (!this.mergeItemStack(slotStack, this.tileEntity.IMPRINTER_MATRIX_START, this.tileEntity.IMPRINTER_MATRIX_START + 1, true)) + { + return null; + } + } + else if (!this.mergeItemStack(slotStack, this.tileEntity.INVENTORY_START, this.tileEntity.getSizeInventory(), false)) + { + return null; } - else if (!this.mergeItemStack(slotStack, this.tileEntity.INVENTORY_START, this.tileEntity.getSizeInventory(), false)) { return null; } } - else if (!this.mergeItemStack(slotStack, this.tileEntity.getSizeInventory(), this.tileEntity.getSizeInventory() + 36, false)) { return null; } + else if (!this.mergeItemStack(slotStack, this.tileEntity.getSizeInventory(), this.tileEntity.getSizeInventory() + 36, false)) + { + return null; + } if (slotStack.stackSize == 0) { @@ -107,7 +116,10 @@ public class ContainerImprinter extends Container implements ISlotWatcher slotObj.onSlotChanged(); } - if (slotStack.stackSize == copyStack.stackSize) { return null; } + if (slotStack.stackSize == copyStack.stackSize) + { + return null; + } slotObj.onPickupFromSlot(player, slotStack); } diff --git a/src/minecraft/assemblyline/common/machine/imprinter/ItemImprinter.java b/src/minecraft/assemblyline/common/machine/imprinter/ItemImprinter.java index 98c2673d7..df66a5f45 100644 --- a/src/minecraft/assemblyline/common/machine/imprinter/ItemImprinter.java +++ b/src/minecraft/assemblyline/common/machine/imprinter/ItemImprinter.java @@ -39,8 +39,8 @@ public class ItemImprinter extends Item if (entity != null && !(entity instanceof IProjectile) && !(entity instanceof EntityPlayer)) { String stringName = EntityList.getEntityString(entity); - //TODO add to filter - player.sendChatToPlayer("Target: "+ stringName); + // TODO add to filter + player.sendChatToPlayer("Target: " + stringName); return true; } return false; diff --git a/src/minecraft/assemblyline/common/machine/imprinter/SlotCraftingResult.java b/src/minecraft/assemblyline/common/machine/imprinter/SlotCraftingResult.java index 87647f1a3..f3ad00293 100644 --- a/src/minecraft/assemblyline/common/machine/imprinter/SlotCraftingResult.java +++ b/src/minecraft/assemblyline/common/machine/imprinter/SlotCraftingResult.java @@ -25,7 +25,8 @@ public class SlotCraftingResult extends Slot public boolean canTakeStack(EntityPlayer player) { return true; - // this.getStack() == null ? false : this.container.tileEntity.getIdealRecipe(this.getStack()) != null; + // this.getStack() == null ? false : + // this.container.tileEntity.getIdealRecipe(this.getStack()) != null; } @Override @@ -37,9 +38,14 @@ public class SlotCraftingResult extends Slot } /* - * private boolean playerHasRequiredIngredients(EntityPlayer player, ItemStack desiredItem) { if (this.getStack() != null) { ItemStack[] idealRecipe = this.container.tileEntity.getIdealRecipe(this.getStack()).getValue(); if (idealRecipe != null) { ItemStack[] requiredItems = idealRecipe.clone(); int foundItems = 0; + * private boolean playerHasRequiredIngredients(EntityPlayer player, ItemStack desiredItem) { if + * (this.getStack() != null) { ItemStack[] idealRecipe = + * this.container.tileEntity.getIdealRecipe(this.getStack()).getValue(); if (idealRecipe != + * null) { ItemStack[] requiredItems = idealRecipe.clone(); int foundItems = 0; * - * if (requiredItems != null) { for (ItemStack searchStack : requiredItems) { for (int i = 0; i < player.inventory.getSizeInventory(); i++) { ItemStack checkStack = player.inventory.getStackInSlot(i); + * if (requiredItems != null) { for (ItemStack searchStack : requiredItems) { for (int i = 0; i + * < player.inventory.getSizeInventory(); i++) { ItemStack checkStack = + * player.inventory.getStackInSlot(i); * * if (checkStack != null) { if (searchStack.isItemEqual(checkStack)) { foundItems++; } } } } } * diff --git a/src/minecraft/assemblyline/common/machine/imprinter/TileEntityFilterable.java b/src/minecraft/assemblyline/common/machine/imprinter/TileEntityFilterable.java index 3609643d4..ca7c9ab49 100644 --- a/src/minecraft/assemblyline/common/machine/imprinter/TileEntityFilterable.java +++ b/src/minecraft/assemblyline/common/machine/imprinter/TileEntityFilterable.java @@ -46,7 +46,10 @@ public abstract class TileEntityFilterable extends TileEntityAssemblyNetwork imp { if (checkStacks.get(i) != null) { - if (checkStacks.get(i).isItemEqual(itemStack)) { return !inverted; } + if (checkStacks.get(i).isItemEqual(itemStack)) + { + return !inverted; + } } } } diff --git a/src/minecraft/assemblyline/common/machine/imprinter/TileEntityImprinter.java b/src/minecraft/assemblyline/common/machine/imprinter/TileEntityImprinter.java index e2d87db3d..111526e9c 100644 --- a/src/minecraft/assemblyline/common/machine/imprinter/TileEntityImprinter.java +++ b/src/minecraft/assemblyline/common/machine/imprinter/TileEntityImprinter.java @@ -3,8 +3,6 @@ package assemblyline.common.machine.imprinter; import java.util.ArrayList; import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; @@ -24,9 +22,7 @@ import universalelectricity.prefab.TranslationHelper; import universalelectricity.prefab.tile.TileEntityAdvanced; import assemblyline.api.IArmbot; import assemblyline.api.IArmbotUseable; -import assemblyline.common.AssemblyLine; import assemblyline.common.Pair; -import assemblyline.common.machine.armbot.TileEntityArmbot; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.ReflectionHelper; @@ -464,11 +460,17 @@ public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInv { if (object instanceof ShapedRecipes) { - if (this.hasResource(((ShapedRecipes) object).recipeItems) != null) { return new Pair(((IRecipe) object).getRecipeOutput().copy(), ((ShapedRecipes) object).recipeItems); } + if (this.hasResource(((ShapedRecipes) object).recipeItems) != null) + { + return new Pair(((IRecipe) object).getRecipeOutput().copy(), ((ShapedRecipes) object).recipeItems); + } } else if (object instanceof ShapelessRecipes) { - if (this.hasResource(((ShapelessRecipes) object).recipeItems.toArray(new ItemStack[1])) != null) { return new Pair(((IRecipe) object).getRecipeOutput().copy(), (ItemStack[]) ((ShapelessRecipes) object).recipeItems.toArray(new ItemStack[1])); } + if (this.hasResource(((ShapelessRecipes) object).recipeItems.toArray(new ItemStack[1])) != null) + { + return new Pair(((IRecipe) object).getRecipeOutput().copy(), (ItemStack[]) ((ShapelessRecipes) object).recipeItems.toArray(new ItemStack[1])); + } } else if (object instanceof ShapedOreRecipe) { @@ -477,9 +479,11 @@ public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInv ArrayList hasResources = this.hasResource(oreRecipeInput); - if (hasResources != null) { + if (hasResources != null) + { - return new Pair(((IRecipe) object).getRecipeOutput().copy(), hasResources.toArray(new ItemStack[1])); } + return new Pair(((IRecipe) object).getRecipeOutput().copy(), hasResources.toArray(new ItemStack[1])); + } } else if (object instanceof ShapelessOreRecipe) { @@ -488,7 +492,10 @@ public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInv List hasResources = this.hasResource(oreRecipeInput.toArray()); - if (hasResources != null) { return new Pair(((IRecipe) object).getRecipeOutput().copy(), hasResources.toArray(new ItemStack[1])); } + if (hasResources != null) + { + return new Pair(((IRecipe) object).getRecipeOutput().copy(), hasResources.toArray(new ItemStack[1])); + } } } }