Package com.petrolpark.core.world.block
Class HandlePrecipitationEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.BlockEvent
com.petrolpark.core.world.block.HandlePrecipitationEvent
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
public class HandlePrecipitationEvent
extends net.neoforged.neoforge.event.level.BlockEvent
implements net.neoforged.bus.api.ICancellableEvent
Called on a random Block in a chunk exposed to the sky every tick, for things like filling Cauldrons.
Level.isRaining() will always be true; there is no need to check this.
If cancelled, the usual Block handling will not be called.
This event is fired for non-motion-blocking Blocks e.g. plants, whereas the usual handling is not.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.level.BlockEvent
net.neoforged.neoforge.event.level.BlockEvent.BlockToolModificationEvent, net.neoforged.neoforge.event.level.BlockEvent.BreakEvent, net.neoforged.neoforge.event.level.BlockEvent.EntityMultiPlaceEvent, net.neoforged.neoforge.event.level.BlockEvent.EntityPlaceEvent, net.neoforged.neoforge.event.level.BlockEvent.FarmlandTrampleEvent, net.neoforged.neoforge.event.level.BlockEvent.FluidPlaceBlockEvent, net.neoforged.neoforge.event.level.BlockEvent.NeighborNotifyEvent, net.neoforged.neoforge.event.level.BlockEvent.PortalSpawnEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final net.minecraft.world.level.Levelprotected final net.minecraft.world.level.biome.Biome.Precipitation -
Constructor Summary
ConstructorsConstructorDescriptionHandlePrecipitationEvent(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.biome.Biome.Precipitation precipitation) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.LevelgetLevel()net.minecraft.world.level.biome.Biome.PrecipitationMethods inherited from class net.neoforged.neoforge.event.level.BlockEvent
getPos, getStateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
level
protected final net.minecraft.world.level.Level level -
precipitation
protected final net.minecraft.world.level.biome.Biome.Precipitation precipitation
-
-
Constructor Details
-
HandlePrecipitationEvent
public HandlePrecipitationEvent(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.biome.Biome.Precipitation precipitation)
-
-
Method Details
-
getLevel
public net.minecraft.world.level.Level getLevel()- Overrides:
getLevelin classnet.neoforged.neoforge.event.level.BlockEvent
-
getPrecipitation
public net.minecraft.world.level.biome.Biome.Precipitation getPrecipitation()
-