Class MarkedEntitySupport

java.lang.Object
com.hypixel.hytale.server.npc.role.support.MarkedEntitySupport
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class MarkedEntitySupport extends Object implements Component<EntityStore>
  • Field Details

    • CODEC

      @Nonnull public static final BuilderCodec<MarkedEntitySupport> CODEC
      Persists the "rebound" target slots: slot name -> the UUID of the entity that should be re-bound to that slot.
    • DEFAULT_TARGET_SLOT

      public static final String DEFAULT_TARGET_SLOT
      See Also:
  • Constructor Details

    • MarkedEntitySupport

      public MarkedEntitySupport()
  • Method Details

    • getComponentType

      @Nonnull public static ComponentType<EntityStore, MarkedEntitySupport> getComponentType()
    • get

      @Nonnull public static MarkedEntitySupport get(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> accessor)
    • getEntityTargets

      public Ref<EntityStore>[] getEntityTargets()
    • postRoleBuilder

      public void postRoleBuilder(@Nonnull BuilderSupport support)
    • clearMarkedEntity

      public void clearMarkedEntity(int targetSlot)
    • setMarkedEntity

      public void setMarkedEntity(String targetSlot, Ref<EntityStore> target)
    • setMarkedEntity

      public void setMarkedEntity(int targetSlot, @Nullable Ref<EntityStore> target)
      Sets a non-rebind (transient) marked target. Removes any existing rebind persistence for the slot.
    • setMarkedEntity

      public void setMarkedEntity(String targetSlot, Ref<EntityStore> target, boolean rebind, @Nonnull ComponentAccessor<EntityStore> accessor)
    • setMarkedEntity

      public void setMarkedEntity(int targetSlot, @Nullable Ref<EntityStore> target, boolean rebind, @Nonnull ComponentAccessor<EntityStore> accessor)
      Sets a marked target, explicitly choosing whether it should be rebind-able.
    • isRebindSlot

      public boolean isRebindSlot(int targetSlot)
      Whether the given slot is a rebind slot (has a persisted target UUID). Used to exempt it from per-tick clearing that only considers the live ref, since the rebind system owns its lifecycle.
    • resolveRebinds

      public void resolveRebinds(@Nonnull ComponentAccessor<EntityStore> accessor)
      Re-resolves rebind slots whose live ref has gone stale by looking the target up by UUID. If the entity can't be found, the slot is deleted (delete-on-null). Called once per tick, before any consumer reads the slots.
    • getMarkedEntityRef

      @Nullable public Ref<EntityStore> getMarkedEntityRef(String targetSlot)
    • getMarkedEntityRef

      @Nullable public Ref<EntityStore> getMarkedEntityRef(int targetSlot)
    • getMarkedEntitySlotCount

      public int getMarkedEntitySlotCount()
    • getStoredPosition

      public org.joml.Vector3d getStoredPosition(int slot)
    • hasMarkedEntity

      public boolean hasMarkedEntity(@Nonnull Ref<EntityStore> entityReference, int targetSlot)
    • hasMarkedEntityInSlot

      public boolean hasMarkedEntityInSlot(String targetSlot)
    • hasMarkedEntityInSlot

      public boolean hasMarkedEntityInSlot(int targetSlot)
    • flockSetTarget

      public void flockSetTarget(@Nonnull Ref<EntityStore> selfRef, @Nonnull String targetSlot, @Nullable Ref<EntityStore> targetRef, @Nonnull Store<EntityStore> store)
    • setTargetSlotToIgnoreForAvoidance

      public void setTargetSlotToIgnoreForAvoidance(int targetSlotToIgnoreForAvoidance)
    • getTargetReferenceToIgnoreForAvoidance

      @Nullable public Ref<EntityStore> getTargetReferenceToIgnoreForAvoidance()
    • getSlotName

      public String getSlotName(int slot)
    • unloaded

      public void unloaded()
    • clone

      @Nonnull public Component<EntityStore> clone()
      Specified by:
      clone in interface Component<EntityStore>
      Returns:
      a clone instance of the original component instance.