Search in sources :

Example 1 with ContraptionFluidPacket

use of com.simibubi.create.content.contraptions.components.structureMovement.sync.ContraptionFluidPacket in project Create by Creators-of-Create.

the class MountedFluidStorage method tick.

public void tick(Entity entity, BlockPos pos, boolean isRemote) {
    if (!isRemote) {
        if (packetCooldown > 0)
            packetCooldown--;
        else if (sendPacket) {
            sendPacket = false;
            AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> entity), new ContraptionFluidPacket(entity.getId(), pos, tank.getFluid()));
            packetCooldown = 8;
        }
        return;
    }
    if (!(te instanceof FluidTankTileEntity))
        return;
    FluidTankTileEntity tank = (FluidTankTileEntity) te;
    tank.getFluidLevel().tick();
}
Also used : ContraptionFluidPacket(com.simibubi.create.content.contraptions.components.structureMovement.sync.ContraptionFluidPacket) CreativeFluidTankTileEntity(com.simibubi.create.content.contraptions.fluids.tank.CreativeFluidTankTileEntity) FluidTankTileEntity(com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity)

Aggregations

ContraptionFluidPacket (com.simibubi.create.content.contraptions.components.structureMovement.sync.ContraptionFluidPacket)1 CreativeFluidTankTileEntity (com.simibubi.create.content.contraptions.fluids.tank.CreativeFluidTankTileEntity)1 FluidTankTileEntity (com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity)1