Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getComponentType()
- get(Ref, ComponentAccessor)
- getEntityTargets()
- postRoleBuilder(BuilderSupport)
- clearMarkedEntity(int)
- setMarkedEntity(String, Ref)
- setMarkedEntity(int, Ref)
- setMarkedEntity(String, Ref, boolean, ComponentAccessor)
- setMarkedEntity(int, Ref, boolean, ComponentAccessor)
- isRebindSlot(int)
- resolveRebinds(ComponentAccessor)
- getMarkedEntityRef(String)
- getMarkedEntityRef(int)
- getMarkedEntitySlotCount()
- getStoredPosition(int)
- hasMarkedEntity(Ref, int)
- hasMarkedEntityInSlot(String)
- hasMarkedEntityInSlot(int)
- flockSetTarget(Ref, String, Ref, Store)
- setTargetSlotToIgnoreForAvoidance(int)
- getTargetReferenceToIgnoreForAvoidance()
- getSlotName(int)
- unloaded()
- clone()
Class MarkedEntitySupport
java.lang.Object
com.hypixel.hytale.server.npc.role.support.MarkedEntitySupport
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<MarkedEntitySupport> Persists the "rebound" target slots: slot name -> the UUID of the entity that should be re-bound to that slot.static final StringFields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearMarkedEntity(int targetSlot) clone()voidflockSetTarget(Ref<EntityStore> selfRef, String targetSlot, Ref<EntityStore> targetRef, Store<EntityStore> store) static MarkedEntitySupportget(Ref<EntityStore> ref, ComponentAccessor<EntityStore> accessor) static ComponentType<EntityStore, MarkedEntitySupport> Ref<EntityStore>[]getMarkedEntityRef(int targetSlot) getMarkedEntityRef(String targetSlot) intgetSlotName(int slot) org.joml.Vector3dgetStoredPosition(int slot) booleanhasMarkedEntity(Ref<EntityStore> entityReference, int targetSlot) booleanhasMarkedEntityInSlot(int targetSlot) booleanhasMarkedEntityInSlot(String targetSlot) booleanisRebindSlot(int targetSlot) Whether the given slot is a rebind slot (has a persisted target UUID).voidpostRoleBuilder(BuilderSupport support) voidresolveRebinds(ComponentAccessor<EntityStore> accessor) Re-resolves rebind slots whose live ref has gone stale by looking the target up by UUID.voidsetMarkedEntity(int targetSlot, Ref<EntityStore> target) Sets a non-rebind (transient) marked target.voidsetMarkedEntity(int targetSlot, Ref<EntityStore> target, boolean rebind, ComponentAccessor<EntityStore> accessor) Sets a marked target, explicitly choosing whether it should be rebind-able.voidsetMarkedEntity(String targetSlot, Ref<EntityStore> target) voidsetMarkedEntity(String targetSlot, Ref<EntityStore> target, boolean rebind, ComponentAccessor<EntityStore> accessor) voidsetTargetSlotToIgnoreForAvoidance(int targetSlotToIgnoreForAvoidance) voidunloaded()Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Field Details
-
CODEC
Persists the "rebound" target slots: slot name -> the UUID of the entity that should be re-bound to that slot. -
DEFAULT_TARGET_SLOT
- See Also:
-
-
Constructor Details
-
MarkedEntitySupport
public MarkedEntitySupport()
-
-
Method Details
-
getComponentType
-
get
@Nonnull public static MarkedEntitySupport get(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> accessor) -
getEntityTargets
-
postRoleBuilder
-
clearMarkedEntity
public void clearMarkedEntity(int targetSlot) -
setMarkedEntity
-
setMarkedEntity
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
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
-
getMarkedEntityRef
-
getMarkedEntitySlotCount
public int getMarkedEntitySlotCount() -
getStoredPosition
public org.joml.Vector3d getStoredPosition(int slot) -
hasMarkedEntity
-
hasMarkedEntityInSlot
-
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
-
getSlotName
-
unloaded
public void unloaded() -
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-