public interface NotifyNeighborBlockEvent extends GameEvent, Cancellable, CauseTracked
Location
triggers an update to one or more
Location
s. 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
Location
removed from the getRelatives()
map.Modifier and Type | Interface and Description |
---|---|
static interface |
NotifyNeighborBlockEvent.Burn |
static interface |
NotifyNeighborBlockEvent.Ignite
An event where the action is an "ingition" that notifies the neighbor
blocks.
|
static interface |
NotifyNeighborBlockEvent.Power |
static interface |
NotifyNeighborBlockEvent.Spread |
Modifier and Type | Method and Description |
---|---|
void |
filterDirections(Predicate<Direction> predicate)
Filters out
Direction s of the BlockState s to be
marked as "valid" after this event. |
Map<Direction,BlockSnapshot> |
getOriginalRelatives()
Gets the immutable
Map of Direction to Location
of the BlockSnapshot that would normally be notified of changes. |
Map<Direction,Location<World>> |
getRelatives()
Gets an immutable
Map of Direction to
Location of the BlockState s that will be notified of
an update. |
getCallbacks
isCancelled, setCancelled
getCause
Map<Direction,BlockSnapshot> getOriginalRelatives()
Map
of Direction
to Location
of the BlockSnapshot
that would normally be notified of changes.Map<Direction,Location<World>> getRelatives()
Map
of Direction
to
Location
of the BlockState
s 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)
Direction
s of the BlockState
s to be
marked as "valid" after this event. If the
Predicate.apply(Object)
returns false
, the
BlockState
is removed from getRelatives()
map.predicate
- The predicate to use for filtering.