Class InteractionSet
java.lang.Object
com.pixelmonmod.pixelmon.api.npc.interaction.InteractionSet
- All Implemented Interfaces:
Iterable<Interaction>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic InteractionSetcopy(InteractionSet set) Copies the given InteractionSetstatic InteractionSetempty()Creates a new empty InteractionSetstatic InteractionSetfrom(InteractionSetData data) booleanhandleInteraction(net.minecraft.core.Holder<InteractionEvent> interactionEvent, StoredContext 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 InteractionSetof(Interaction... interactions) Creates a new InteractionSet with the given interactionsstatic InteractionSetof(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, waitMethods 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
public boolean handleInteraction(net.minecraft.core.Holder<InteractionEvent> interactionEvent, StoredContext 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.- 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:
iteratorin interfaceIterable<Interaction>
-
toData
-
addNewInteraction
public void addNewInteraction()
-