From fb4e53eb02d5b532953b841386ea4008d28c08cc Mon Sep 17 00:00:00 2001 From: Brian Ricketts Date: Sun, 13 Jan 2013 03:27:41 -0600 Subject: [PATCH] Fixed more armbot derpiness --- src/minecraft/assemblyline/client/gui/GuiEncoder.java | 2 +- .../assemblyline/common/machine/BlockManipulator.java | 2 +- .../common/machine/armbot/TileEntityArmbot.java | 11 ++++++++++- .../common/machine/belt/BlockConveyorBelt.java | 4 ++-- .../common/machine/command/CommandRotate.java | 9 +++++++-- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/minecraft/assemblyline/client/gui/GuiEncoder.java b/src/minecraft/assemblyline/client/gui/GuiEncoder.java index 8a55cb1b..394e4096 100644 --- a/src/minecraft/assemblyline/client/gui/GuiEncoder.java +++ b/src/minecraft/assemblyline/client/gui/GuiEncoder.java @@ -188,7 +188,7 @@ public class GuiEncoder extends GuiContainer implements IInventoryWatcher { relativeCommand = i - minCommand; command = this.commands.get(i).toUpperCase(); - drawCommand(command, 8, 46 + relativeCommand * (fontRenderer.FONT_HEIGHT + 4), this.selCommand == i); + drawCommand(command, 8, 47 + relativeCommand * (fontRenderer.FONT_HEIGHT + 4), this.selCommand == i); } } } diff --git a/src/minecraft/assemblyline/common/machine/BlockManipulator.java b/src/minecraft/assemblyline/common/machine/BlockManipulator.java index 3e621033..7d0fb0c4 100644 --- a/src/minecraft/assemblyline/common/machine/BlockManipulator.java +++ b/src/minecraft/assemblyline/common/machine/BlockManipulator.java @@ -22,7 +22,7 @@ public class BlockManipulator extends BlockImprintable public BlockManipulator(int id) { super("manipulator", id, UniversalElectricity.machine, TabAssemblyLine.INSTANCE); - this.setBlockBounds(0, 0, 0, 1, 0.3f, 1); + this.setBlockBounds(0, 0, 0, 1, 0.29f, 1); } @Override diff --git a/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java b/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java index 05cc5ace..90d53a1f 100644 --- a/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java +++ b/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java @@ -131,13 +131,21 @@ public class TileEntityArmbot extends TileEntityAssemblyNetwork implements IMult // keep it within 0 - 360 degrees so ROTATE commands work properly if (this.rotationPitch <= -360) + { this.rotationPitch += 360; + } if (this.rotationPitch >= 360) + { this.rotationPitch -= 360; + } if (this.rotationYaw <= -360) + { this.rotationYaw += 360; + } if (this.rotationYaw >= 360) + { this.rotationYaw -= 360; + } this.ticksSincePower = 0; } @@ -180,7 +188,7 @@ public class TileEntityArmbot extends TileEntityAssemblyNetwork implements IMult { NBTTagCompound nbt = new NBTTagCompound(); writeToNBT(nbt); - return PacketManager.getPacket(AssemblyLine.CHANNEL, this, this.commandManager.getCurrentTask(), nbt); + return PacketManager.getPacket(AssemblyLine.CHANNEL, this, this.powerTransferRange, this.commandManager.getCurrentTask(), nbt); } /** @@ -200,6 +208,7 @@ public class TileEntityArmbot extends TileEntityAssemblyNetwork implements IMult x = dis.readInt(); y = dis.readInt(); z = dis.readInt(); + this.powerTransferRange = dis.readInt(); this.commandManager.setCurrentTask(dis.readInt()); NBTTagCompound tag = Packet.readNBTTagCompound(dis); readFromNBT(tag); diff --git a/src/minecraft/assemblyline/common/machine/belt/BlockConveyorBelt.java b/src/minecraft/assemblyline/common/machine/belt/BlockConveyorBelt.java index ebdca10f..55a51773 100644 --- a/src/minecraft/assemblyline/common/machine/belt/BlockConveyorBelt.java +++ b/src/minecraft/assemblyline/common/machine/belt/BlockConveyorBelt.java @@ -238,13 +238,13 @@ public class BlockConveyorBelt extends BlockMachine if (direction.offsetX != 0) { double difference = (z + 0.5) - entity.posZ; - entity.motionZ += difference * 0.006; + entity.motionZ += difference * 0.06; // entity.posZ = z + 0.5; } else if (direction.offsetZ != 0) { double difference = (x + 0.5) - entity.posX; - entity.motionX += difference * 0.006; + entity.motionX += difference * 0.06; // /entity.posX = x + 0.5; } diff --git a/src/minecraft/assemblyline/common/machine/command/CommandRotate.java b/src/minecraft/assemblyline/common/machine/command/CommandRotate.java index 60f9ee92..ff578d1d 100644 --- a/src/minecraft/assemblyline/common/machine/command/CommandRotate.java +++ b/src/minecraft/assemblyline/common/machine/command/CommandRotate.java @@ -1,5 +1,6 @@ package assemblyline.common.machine.command; +import cpw.mods.fml.common.FMLCommonHandler; /** * Rotates the armbot to a specific direction. If not specified, it will turn right. @@ -41,7 +42,7 @@ public class CommandRotate extends Command super.doTask(); float rotationalDifference = Math.abs(this.tileEntity.rotationYaw - this.targetRotation); - if (rotationalDifference < 0.1) + if (rotationalDifference < ROTATION_SPEED) { this.tileEntity.rotationYaw = this.targetRotation; } @@ -55,9 +56,13 @@ public class CommandRotate extends Command { this.tileEntity.rotationYaw += ROTATION_SPEED; } + this.ticks = 0; } - if (this.ticks < 80) { return true; } + if (this.ticks < 10) + { + return true; + } return false; }