From 7a5075e323fc6f01d163c3fc29ccd0d5e32dcada Mon Sep 17 00:00:00 2001 From: Calclavia Date: Sat, 25 Jan 2014 18:01:34 +0800 Subject: [PATCH] Fixed conveyor belt not refreshing on world load --- .../mechanical/belt/BlockConveyorBelt.java | 10 ++++---- .../mechanical/network/TileMechanical.java | 24 +++++++++++++++---- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/main/java/resonantinduction/mechanical/belt/BlockConveyorBelt.java b/src/main/java/resonantinduction/mechanical/belt/BlockConveyorBelt.java index 47b49017..19ece33f 100644 --- a/src/main/java/resonantinduction/mechanical/belt/BlockConveyorBelt.java +++ b/src/main/java/resonantinduction/mechanical/belt/BlockConveyorBelt.java @@ -126,7 +126,7 @@ public class BlockConveyorBelt extends BlockRI { par6List.add(newBounds); } - + return; } @@ -304,8 +304,8 @@ public class BlockConveyorBelt extends BlockRI if (slantType == SlantType.UP) { - //We need at least 0.25 to move items up. - entity.motionY = Math.max(0.25, maxSpeed); + // We need at least 0.25 to move items up. + entity.motionY = maxSpeed * 2;// Math.max(0.25, maxSpeed); } else if (slantType == SlantType.DOWN) { @@ -330,16 +330,14 @@ public class BlockConveyorBelt extends BlockRI { double difference = (z + 0.5) - entity.posZ; entity.motionZ += difference * 0.1; - // entity.posZ = z + 0.5; } else if (direction.offsetZ != 0) { double difference = (x + 0.5) - entity.posX; entity.motionX += difference * 0.1; - // /entity.posX = x + 0.5; } - ((EntityItem) entity).age++; + ((EntityItem) entity).age = 0; boolean foundSneaking = false; for (EntityPlayer player : (List) world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1))) diff --git a/src/main/java/resonantinduction/mechanical/network/TileMechanical.java b/src/main/java/resonantinduction/mechanical/network/TileMechanical.java index 00341c8c..2d1b1e26 100644 --- a/src/main/java/resonantinduction/mechanical/network/TileMechanical.java +++ b/src/main/java/resonantinduction/mechanical/network/TileMechanical.java @@ -14,6 +14,12 @@ public abstract class TileMechanical extends TileAdvanced implements IMechanical protected long torque; public float angle = 0; + @Override + public void initiate() + { + refresh(); + } + @Override public void updateEntity() { @@ -23,11 +29,6 @@ public abstract class TileMechanical extends TileAdvanced implements IMechanical angularVelocity *= getLoad(); } - protected float getLoad() - { - return 0.9f; - } - @Override public void invalidate() { @@ -35,6 +36,19 @@ public abstract class TileMechanical extends TileAdvanced implements IMechanical super.invalidate(); } + /** + * Refreshes all the connections of this block. + */ + public void refresh() + { + + } + + protected float getLoad() + { + return 0.9f; + } + @Override public Object[] getConnections() {