public interface NotifyNeighborBlockEvent extends Event, Cancellable
Directions. There is a way to mark an "update" as being
"invalid" or "cancelled": filterDirections(Predicate) will apply a
Predicate such that if the predicate returns false, the
Direction will be removed from the getNeighbors() map.| Modifier and Type | Method and Description |
|---|---|
void |
filterDirections(Predicate<Direction> predicate)
Filters out
Directions of the BlockStates to be
marked as "valid" after this event. |
Map<Direction,BlockState> |
getNeighbors()
Gets an immutable
Map of Direction to
BlockState of the BlockType that will be notified of
an update. |
Map<Direction,BlockState> |
getOriginalNeighbors()
Gets the immutable
Map of Direction to BlockState of the BlockType that would normally be
notified of changes. |
getCause, getContext, getSourceisCancelled, setCancelledMap<Direction,BlockState> getOriginalNeighbors()
Map of Direction to BlockState of the BlockType that would normally be
notified of changes.Map<Direction,BlockState> getNeighbors()
Map of Direction to
BlockState of the BlockType that will be notified of
an update. If a Direction is not required or needing to be
excluded from an update, filterDirections(Predicate) will
perform that exclusion.void filterDirections(Predicate<Direction> predicate)
Directions of the BlockStates to be
marked as "valid" after this event. If the
Predicate.test(Object) returns false, the
BlockState is removed from getNeighbors() map.predicate - The predicate to use for filtering.