Class BlockEvent.NeighborNotifyEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.BlockEvent
net.neoforged.neoforge.event.level.BlockEvent.NeighborNotifyEvent
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
- Enclosing class:
BlockEvent
public static class BlockEvent.NeighborNotifyEvent
extends BlockEvent
implements net.neoforged.bus.api.ICancellableEvent
Fired when a physics update occurs on a block. This event acts as
a way for mods to detect physics updates, in the same way a BUD switch
does. This event is only called on the server.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.level.BlockEvent
BlockEvent.BlockToolModificationEvent, BlockEvent.BreakEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
-
Field Summary
Modifier and TypeFieldDescriptionprivate final boolean
-
Constructor Summary
ConstructorDescriptionNeighborNotifyEvent
(Level level, BlockPos pos, BlockState state, EnumSet<Direction> notifiedSides, boolean forceRedstoneUpdate) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Get if redstone update was forced during setBlock call (0x16 to flags)Gets a list of directions from the base block that updates will occur upon.Methods inherited from class net.neoforged.neoforge.event.level.BlockEvent
getLevel, getPos, getState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
notifiedSides
-
forceRedstoneUpdate
private final boolean forceRedstoneUpdate
-
-
Constructor Details
-
NeighborNotifyEvent
public NeighborNotifyEvent(Level level, BlockPos pos, BlockState state, EnumSet<Direction> notifiedSides, boolean forceRedstoneUpdate)
-
-
Method Details
-
getNotifiedSides
Gets a list of directions from the base block that updates will occur upon.- Returns:
- list of notified directions
-
getForceRedstoneUpdate
public boolean getForceRedstoneUpdate()Get if redstone update was forced during setBlock call (0x16 to flags)- Returns:
- if the flag was set
-