Fixed conveyor belt not refreshing on world load

This commit is contained in:
Calclavia 2014-01-25 18:01:34 +08:00
parent 4be96d95be
commit 7a5075e323
2 changed files with 23 additions and 11 deletions

View file

@ -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<EntityPlayer>) world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1)))

View file

@ -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()
{