Class Interactions

java.lang.Object
com.hypixel.hytale.server.core.modules.interaction.Interactions
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class Interactions extends Object implements Component<EntityStore>
A component that holds interaction IDs for different interaction types for an entity.
  • Field Details

  • Constructor Details

    • Interactions

      public Interactions()
      Empty Constructor for a Interactions instance.

      Used by the codec to parse Interactions instances.

    • Interactions

      public Interactions(@Nonnull Map<InteractionType, String> interactions)
      Default Constructor for a Interactions instance.
      Parameters:
      interactions - A map of interaction types to their corresponding interaction IDs.
  • Method Details

    • getComponentType

      @Nonnull public static ComponentType<EntityStore, Interactions> getComponentType()
      Returns:
      the component type of the Interactions component.
    • getInteractionId

      @Nullable public String getInteractionId(@Nonnull InteractionType type)
      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 null if none exists.
    • setInteractionId

      public void setInteractionId(@Nonnull InteractionType type, @Nonnull String interactionId)
      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

      public void removeInteractionId(@Nonnull InteractionType type)
      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:
      true if no interaction type has an interaction ID and interactions are not overridden wholesale, false otherwise.
    • isOverrideAll

      public boolean isOverrideAll()
      Returns:
      true if 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

      @Nonnull public Map<InteractionType, String> getInteractions()
      Returns:
      an unmodifiable map of interaction types to their corresponding interaction IDs.
    • getInteractionHint

      @Nullable public String getInteractionHint()
    • setInteractionHint

      public void setInteractionHint(@Nullable String interactionHint)
    • clone

      @Nonnull public Component<EntityStore> clone()
      Specified by:
      clone in interface Component<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:
      true if this component is outdated on the network, false otherwise.