Search in sources :

Example 1 with CustomHoneyFluid

use of com.teamresourceful.resourcefulbees.fluids.CustomHoneyFluid in project ResourcefulBees by Resourceful-Bees.

the class HoneyCongealer method animateTick.

@Override
public void animateTick(@NotNull BlockState stateIn, @NotNull Level world, @NotNull BlockPos pos, @NotNull Random rand) {
    HoneyCongealerTileEntity tank = getTileEntity(world, pos);
    if (tank == null) {
        return;
    }
    if (tank.getFluidTank().getFluid().getFluid() instanceof CustomHoneyFluid) {
        CustomHoneyFluid fluid = (CustomHoneyFluid) tank.getFluidTank().getFluid().getFluid();
        if (fluid.getHoneyData().getColor().isRainbow()) {
            world.sendBlockUpdated(pos, stateIn, stateIn, 2);
        }
    }
    super.animateTick(stateIn, world, pos, rand);
}
Also used : HoneyCongealerTileEntity(com.teamresourceful.resourcefulbees.tileentity.HoneyCongealerTileEntity) CustomHoneyFluid(com.teamresourceful.resourcefulbees.fluids.CustomHoneyFluid)

Example 2 with CustomHoneyFluid

use of com.teamresourceful.resourcefulbees.fluids.CustomHoneyFluid in project ResourcefulBees by Resourceful-Bees.

the class HoneyTank method animateTick.

@Override
public void animateTick(@NotNull BlockState stateIn, @NotNull Level world, @NotNull BlockPos pos, @NotNull Random rand) {
    HoneyTankTileEntity tank = getTileEntity(world, pos);
    if (tank == null) {
        return;
    }
    if (tank.getFluidTank().getFluid().getFluid() instanceof CustomHoneyFluid) {
        CustomHoneyFluid fluid = (CustomHoneyFluid) tank.getFluidTank().getFluid().getFluid();
        if (fluid.getHoneyData().getColor().isRainbow()) {
            world.sendBlockUpdated(pos, stateIn, stateIn, 2);
        }
    }
    super.animateTick(stateIn, world, pos, rand);
}
Also used : HoneyTankTileEntity(com.teamresourceful.resourcefulbees.tileentity.HoneyTankTileEntity) CustomHoneyFluid(com.teamresourceful.resourcefulbees.fluids.CustomHoneyFluid)

Aggregations

CustomHoneyFluid (com.teamresourceful.resourcefulbees.fluids.CustomHoneyFluid)2 HoneyCongealerTileEntity (com.teamresourceful.resourcefulbees.tileentity.HoneyCongealerTileEntity)1 HoneyTankTileEntity (com.teamresourceful.resourcefulbees.tileentity.HoneyTankTileEntity)1