Class InteractionSet
java.lang.Object
com.pixelmonmod.pixelmon.api.npc.interaction.InteractionSet
- All Implemented Interfaces:
Iterable<Interaction>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
static InteractionSet
copy
(InteractionSet set) Copies the given InteractionSetstatic InteractionSet
empty()
Creates a new empty InteractionSetstatic InteractionSet
from
(InteractionSetData data) boolean
handleInteraction
(InteractionEvent interactionEvent, InteractionContext context) Checks that the event should be handled by this NPC, then checks against the relevant conditions and then passes the context to the results if the conditions passed.@NotNull Iterator<Interaction>
iterator()
static InteractionSet
of
(Interaction... interactions) Creates a new InteractionSet with the given interactionsstatic InteractionSet
of
(Iterable<Interaction> interactions) Creates a new InteractionSet with the given interactionstoData()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
CODEC
-
-
Constructor Details
-
InteractionSet
-
-
Method Details
-
empty
Creates a new empty InteractionSet- Returns:
- A new empty InteractionSet
-
copy
Copies the given InteractionSet- Parameters:
set
- The set to copy- Returns:
- A new InteractionSet with the same interactions as the given set
-
of
Creates a new InteractionSet with the given interactions- Parameters:
interactions
- The interactions to add to the set- Returns:
- A new InteractionSet with the given interactions
-
of
Creates a new InteractionSet with the given interactions- Parameters:
interactions
- The interactions to add to the set- Returns:
- A new InteractionSet with the given interactions
-
from
-
handleInteraction
Checks that the event should be handled by this NPC, then checks against the relevant conditions and then passes the context to the results if the conditions passed.- Parameters:
interactionEvent
- The event that triggered this callcontext
- The context for the event- Returns:
- True if the event was a success, the conditions passed, and the results were fired
-
iterator
- Specified by:
iterator
in interfaceIterable<Interaction>
-
toData
-
addNewInteraction
public void addNewInteraction()
-