Fixed slant connection and made items fly off belts if too fast

This commit is contained in:
Calclavia 2014-01-18 18:22:34 +08:00
parent a202737f48
commit d4868e1815
2 changed files with 26 additions and 14 deletions

View file

@ -34,19 +34,6 @@ public class BlockConveyorBelt extends BlockRI
this.setBlockBounds(0, 0, 0, 1, 0.3f, 1);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
TileEntity t = world.getBlockTileEntity(x, y, z);
if (t != null && t instanceof TileConveyorBelt)
{
TileConveyorBelt tileEntity = (TileConveyorBelt) t;
System.out.println(world.isRemote + " : " + tileEntity.getNetwork());
}
return false;
}
@Override
public void onBlockAdded(World world, int x, int y, int z)
{
@ -325,7 +312,7 @@ public class BlockConveyorBelt extends BlockRI
entity.motionX = 0;
}
entity.motionY += 0.0125f;
entity.motionY += 0.125f * maxSpeed;
if (entity instanceof EntityItem)
{

View file

@ -238,6 +238,31 @@ public class TileConveyorBelt extends TileAdvanced implements IMechanicalConnect
if (dir == this.getDirection() || dir == this.getDirection().getOpposite())
{
if (dir == this.getDirection())
{
if (this.slantType == SlantType.DOWN)
{
pos.translate(new Vector3(0, -1, 0));
}
else if (this.slantType == SlantType.UP)
{
pos.translate(new Vector3(0, 1, 0));
}
}
else if (dir == this.getDirection().getOpposite())
{
if (this.slantType == SlantType.DOWN)
{
pos.translate(new Vector3(0, 1, 0));
}
else if (this.slantType == SlantType.UP)
{
pos.translate(new Vector3(0, -1, 0));
}
}
tile = pos.getTileEntity(this.worldObj);
if (tile instanceof IBelt)
{
connections[dir.ordinal()] = tile;