use of net.minecraft.world.level.material.FluidState in project MinecraftForge by MinecraftForge.
the class FiniteWaterTest method handleFiniteWaterSource.
@SubscribeEvent
public static void handleFiniteWaterSource(BlockEvent.CreateFluidSourceEvent event) {
if (ENABLED) {
BlockState state = event.getState();
FluidState fluidState = state.getFluidState();
if (fluidState.getType().isSame(Fluids.WATER)) {
event.setResult(Event.Result.DENY);
} else if (fluidState.getType().isSame(Fluids.LAVA)) {
event.setResult(Event.Result.ALLOW);
}
}
}
Aggregations