Class AbstractAffectEntityEvent
- java.lang.Object
-
- org.spongepowered.api.event.impl.AbstractEvent
-
- org.spongepowered.api.event.impl.entity.AbstractAffectEntityEvent
-
- All Implemented Interfaces:
Cancellable
,AffectEntityEvent
,Event
- Direct Known Subclasses:
AbstractDetonateEvent
,AbstractSpawnEntityEvent
public abstract class AbstractAffectEntityEvent extends AbstractEvent implements AffectEntityEvent
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<Entity>
entities
protected java.util.List<EntitySnapshot>
entitySnapshots
-
Fields inherited from class org.spongepowered.api.event.impl.AbstractEvent
currentOrder
-
-
Constructor Summary
Constructors Constructor Description AbstractAffectEntityEvent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Entity>
entities()
Gets theList
of entities who will be affected after event resolution.java.util.List<EntitySnapshot>
entitySnapshots()
Gets anList
of the entity data un-affected by event changes.void
filterEntities(java.util.function.Predicate<Entity> predicate)
Filters outEntity
's fromAffectEntityEvent.entities()
to be affected by this event.-
Methods inherited from class org.spongepowered.api.event.impl.AbstractEvent
init
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.spongepowered.api.event.entity.AffectEntityEvent
filterEntityLocations
-
Methods inherited from interface org.spongepowered.api.event.Cancellable
isCancelled, setCancelled
-
-
-
-
Field Detail
-
entities
protected java.util.List<Entity> entities
-
entitySnapshots
protected java.util.List<EntitySnapshot> entitySnapshots
-
-
Method Detail
-
entitySnapshots
public java.util.List<EntitySnapshot> entitySnapshots()
Description copied from interface:AffectEntityEvent
Gets anList
of the entity data un-affected by event changes.This method MUST be called at
Order.PRE
in order to be properly initialized, after which it can be called at any time. If it is not first called atOrder.PRE
, it will throw anIllegalStateException
when invoked.- Specified by:
entitySnapshots
in interfaceAffectEntityEvent
- Returns:
- The ImmutableList
-
entities
public java.util.List<Entity> entities()
Description copied from interface:AffectEntityEvent
Gets theList
of entities who will be affected after event resolution. This list can only be modified usingAffectEntityEvent.filterEntities(Predicate)
.- Specified by:
entities
in interfaceAffectEntityEvent
- Returns:
- The list of entities that will be affected.
-
filterEntities
public void filterEntities(java.util.function.Predicate<Entity> predicate)
Description copied from interface:AffectEntityEvent
Filters outEntity
's fromAffectEntityEvent.entities()
to be affected by this event.Entities for which the predicate returns
false
will be removed fromAffectEntityEvent.entities()
.- Specified by:
filterEntities
in interfaceAffectEntityEvent
- Parameters:
predicate
- The predicate to use for filtering
-
-