possible fixed to rotation fill crash

Not tested but this might reduce how often it happens
This commit is contained in:
Robert Seifert 2013-04-22 02:21:11 -04:00
parent 9e9537d693
commit 44343a56d5

View file

@ -82,6 +82,7 @@ public class BlockConstructionPump extends BlockAdvanced
{ {
return 0; return 0;
} }
@Override @Override
public int getRenderType() public int getRenderType()
{ {
@ -118,6 +119,12 @@ public class BlockConstructionPump extends BlockAdvanced
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
int angle = MathHelper.floor_double((entityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int angle = MathHelper.floor_double((entityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
TileEntity entity = world.getBlockTileEntity(x, y, z);
if (entity instanceof TileEntityConstructionPump)
{
HydraulicNetworkHelper.invalidate(entity);
}
if (meta == 3) if (meta == 3)
{ {
world.setBlockMetadataWithNotify(x, y, z, 0, 3); world.setBlockMetadataWithNotify(x, y, z, 0, 3);
@ -127,15 +134,9 @@ public class BlockConstructionPump extends BlockAdvanced
world.setBlockMetadataWithNotify(x, y, z, meta + 1, 3); world.setBlockMetadataWithNotify(x, y, z, meta + 1, 3);
} }
TileEntity entity = world.getBlockTileEntity(x, y, z);
if(entity instanceof TileEntityConstructionPump)
{
HydraulicNetworkHelper.invalidate(entity);
}
return true; return true;
} }
return this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ); return this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ);
} }
} }