use of com.teamresourceful.resourcefulbees.tileentity.HoneyCongealerTileEntity in project ResourcefulBees by Resourceful-Bees.
the class SyncGUIMessage method handle.
public static void handle(SyncGUIMessage message, Supplier<NetworkEvent.Context> context) {
context.get().enqueueWork(() -> {
AbstractClientPlayer player = Minecraft.getInstance().player;
if (player != null && player.level.isLoaded(message.pos)) {
BlockEntity tileEntity = player.level.getBlockEntity(message.pos);
if (tileEntity instanceof CentrifugeTileEntity) {
((CentrifugeTileEntity) tileEntity).handleGUINetworkPacket(message.buffer);
}
if (tileEntity instanceof HoneyGeneratorTileEntity) {
((HoneyGeneratorTileEntity) tileEntity).handleGUINetworkPacket(message.buffer);
}
if (tileEntity instanceof HoneyCongealerTileEntity) {
((HoneyCongealerTileEntity) tileEntity).handleGUINetworkPacket(message.buffer);
}
if (tileEntity instanceof HoneyTankTileEntity) {
((HoneyTankTileEntity) tileEntity).handleGUINetworkPacket(message.buffer);
}
}
});
context.get().setPacketHandled(true);
}
use of com.teamresourceful.resourcefulbees.tileentity.HoneyCongealerTileEntity 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);
}
Aggregations