Contents
Class Interactions
java.lang.Object
com.hypixel.hytale.server.core.modules.interaction.Interactions
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
A component that holds interaction IDs for different interaction types for an entity.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<Interactions> The codec used to parseInteractionsinstances.Fields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionEmpty Constructor for aInteractionsinstance.Interactions(Map<InteractionType, String> interactions) Default Constructor for aInteractionsinstance. -
Method Summary
Modifier and TypeMethodDescriptionclone()booleanCalled to consume whether this component is outdated on the network.static ComponentType<EntityStore, Interactions> Gets the interaction ID for a given interaction type.booleanisEmpty()booleanvoidCalled to remove the interaction ID for a given interaction type.voidsetInteractionHint(String interactionHint) voidsetInteractionId(InteractionType type, String interactionId) Called to set the interaction ID for a given interaction type.voidsetOverrideAll(boolean overrideAll) Called to set whether unmapped interaction types resolve to no interaction.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Field Details
-
CODEC
The codec used to parseInteractionsinstances.
-
-
Constructor Details
-
Interactions
public Interactions()Empty Constructor for aInteractionsinstance.Used by the codec to parse
Interactionsinstances. -
Interactions
Default Constructor for aInteractionsinstance.- Parameters:
interactions- A map of interaction types to their corresponding interaction IDs.
-
-
Method Details
-
getComponentType
- Returns:
- the component type of the
Interactionscomponent.
-
getInteractionId
Gets the interaction ID for a given interaction type.- Parameters:
type- The interaction type to get the ID for.- Returns:
- the interaction ID for the given interaction type, or
nullif none exists.
-
setInteractionId
Called to set the interaction ID for a given interaction type.- Parameters:
type- The interaction type to set the ID for.interactionId- The interaction ID to set.
-
removeInteractionId
Called to remove the interaction ID for a given interaction type.- Parameters:
type- The interaction type to remove the ID for.
-
isEmpty
public boolean isEmpty()- Returns:
trueif no interaction type has an interaction ID and interactions are not overridden wholesale,falseotherwise.
-
isOverrideAll
public boolean isOverrideAll()- Returns:
trueif unmapped interaction types resolve to no interaction rather than falling through to the held item.
-
setOverrideAll
public void setOverrideAll(boolean overrideAll) Called to set whether unmapped interaction types resolve to no interaction.- Parameters:
overrideAll- Whether the interaction map is the complete set of allowed interactions.
-
getInteractions
- Returns:
- an unmodifiable map of interaction types to their corresponding interaction IDs.
-
getInteractionHint
-
setInteractionHint
-
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-
consumeNetworkOutdated
public boolean consumeNetworkOutdated()Called to consume whether this component is outdated on the network.- Returns:
trueif this component is outdated on the network,falseotherwise.
-