Only update intake tile on server side, should fix #296

This commit is contained in:
Decebaldecebal 2015-07-20 15:23:21 +03:00
parent 22971108b0
commit 2e8cc6a714

View File

@ -47,6 +47,8 @@ public class TileIntake extends TileEntity implements IFluidHandler
@Override
public void updateEntity()
{
if(!worldObj.isRemote)
{
if((this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == Blocks.water)
&& (this.worldObj.getBlockMetadata(this.xCoord, this.yCoord - 1, this.zCoord) == 0))
@ -69,13 +71,18 @@ public class TileIntake extends TileEntity implements IFluidHandler
export.fill(ForgeDirection.DOWN,
new FluidStack(FluidRegistry.WATER, Math.min(this.waterTank.getFluidAmount(), exportAmountPerTick)), true), true);
}
}
else
{
Random random = this.worldObj.rand;
if(this.waterTank.getFluidAmount() > 0)
this.worldObj.spawnParticle("dripWater", this.xCoord + random.nextDouble(), this.yCoord + random.nextDouble(),
this.zCoord + random.nextDouble(), random.nextDouble(), -0.5D, random.nextDouble());
if(random.nextInt(100) == 0)
this.worldObj.playSound(this.xCoord, this.yCoord, this.zCoord, ModInfo.PREFIX + "intake", 1F, 1F, true);
}
}
@Override
public void readFromNBT(NBTTagCompound tag)