Contents
- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- markNeedsSave()
- setLegacyUUID(UUID)
- remove()
- loadIntoWorld(World)
- unloadFromWorld()
- getNetworkId()
- getLegacyDisplayName()
- getUuid()
- moveTo(Ref, double, double, double, ComponentAccessor)
- getWorld()
- wasRemoved()
- isCollidable()
- hashCode()
- equals(Object)
- toString()
- isHiddenFromLivingEntity(Ref, Ref, ComponentAccessor)
- setReference(Ref)
- getReference()
- clearReference()
- clone()
- toHolder()
Class Entity
java.lang.Object
com.hypixel.hytale.server.core.entity.Entity
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
- Direct Known Subclasses:
LegacySpawnBeaconEntity, LivingEntity, PatrolPathMarkerEntity, SpawnBeacon
A class that represents a generic entity in the game world.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA class that contains the default animation IDs for entities. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<Entity> The codec used to parseEntityinstances.static final KeyedCodec<String> The legacy display name codec for the entities.static final HytaleLoggerThe logger for this class.static final intAn unassigned network ID constant.static final KeyedCodec<UUID> The legacy UUID codec for the entities.static final intThe current version of the entity codec.Fields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.clone()booleanDeprecated, for removal: This API element is subject to removal in a future version.intDeprecated, for removal: This API element is subject to removal in a future version.Access the network ID via theNetworkIdcomponent.getUuid()Deprecated, for removal: This API element is subject to removal in a future version.Access the UUID via theUUIDComponentcomponent.getWorld()inthashCode()booleanbooleanisHiddenFromLivingEntity(Ref<EntityStore> ref, Ref<EntityStore> targetRef, ComponentAccessor<EntityStore> componentAccessor) Determines whether this entity is hidden from the given target entityvoidloadIntoWorld(World world) Called to load the entity into the given world.voidDeprecated, for removal: This API element is subject to removal in a future version.UseDirty.markDirty()instead.voidmoveTo(Ref<EntityStore> ref, double locX, double locY, double locZ, ComponentAccessor<EntityStore> componentAccessor) Deprecated.UseTransformComponentdirectlybooleanremove()Called to remove this entity from the world.voidsetLegacyUUID(UUID uuid) Called to set the legacy UUID of this entity.voidsetReference(Ref<EntityStore> reference) Called to set the entity reference associated with this entity.toHolder()Called to convert and return this entity as an entity holder.toString()voidCalled to unload the entity from its current world.booleanMethods inherited from interface Component
cloneSerializable
-
Field Details
-
LOGGER
The logger for this class. -
VERSION
public static final int VERSIONThe current version of the entity codec.- See Also:
-
DISPLAY_NAME
The legacy display name codec for the entities. -
UUID
The legacy UUID codec for the entities. -
CODEC
The codec used to parseEntityinstances. -
UNASSIGNED_ID
public static final int UNASSIGNED_IDAn unassigned network ID constant.- See Also:
-
-
Constructor Details
-
Entity
Deprecated.Default Constructor for anEntityinstance.- Parameters:
world- The world that this entity is in, ornullif not in a world.
-
Entity
-
-
Method Details
-
markNeedsSave
Deprecated, for removal: This API element is subject to removal in a future version.UseDirty.markDirty()instead.Marks the chunk containing this entity as needing to be saved. -
setLegacyUUID
Called to set the legacy UUID of this entity.- Parameters:
uuid- The legacy UUID to set.
-
remove
public boolean remove()Called to remove this entity from the world.- Returns:
trueif the entity was removed,falseif it was already removed.
-
loadIntoWorld
Called to load the entity into the given world.- Parameters:
world- The world to load the entity into.
-
unloadFromWorld
public void unloadFromWorld()Called to unload the entity from its current world. -
getNetworkId
Deprecated, for removal: This API element is subject to removal in a future version.Access the network ID via theNetworkIdcomponent.- Returns:
- the network ID of this entity.
-
getLegacyDisplayName
Deprecated, for removal: This API element is subject to removal in a future version.Access the display name via theDisplayNameComponentcomponent.- Returns:
- the display name of the entity, or
nullif no display name is set.
-
getUuid
Deprecated, for removal: This API element is subject to removal in a future version.Access the UUID via theUUIDComponentcomponent.- Returns:
- the legacy
UUIDof this entity.
-
moveTo
@Deprecated public void moveTo(@Nonnull Ref<EntityStore> ref, double locX, double locY, double locZ, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Deprecated.UseTransformComponentdirectly- Parameters:
ref- The entity reference of this entity.locX- The X coordinate to move to.locY- The Y coordinate to move to.locZ- The Z coordinate to move to.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
getWorld
- Returns:
- the world that this entity is in, or
nullif not in a world.
-
wasRemoved
public boolean wasRemoved()- Returns:
trueif this entity was removed,falseotherwise.
-
isCollidable
public boolean isCollidable()- Returns:
trueif this entity is collidable,falseotherwise.
-
hashCode
-
equals
-
toString
-
isHiddenFromLivingEntity
public boolean isHiddenFromLivingEntity(@Nonnull Ref<EntityStore> ref, @Nonnull Ref<EntityStore> targetRef, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Determines whether this entity is hidden from the given target entity- Parameters:
ref- The entity reference of this entitytargetRef- The entity reference of the target entitycomponentAccessor- TheComponentAccessorfor component access- Returns:
trueif they are hidden from the target entity,falseotherwise
-
setReference
Called to set the entity reference associated with this entity.- Parameters:
reference- The entity reference to set.
-
getReference
- Returns:
- the entity reference of this entity.
-
clearReference
Deprecated.Called to clear the entity reference associated with this entity. -
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-
toHolder
Called to convert and return this entity as an entity holder.- Returns:
- the entity holder representation of this entity.
-
DisplayNameComponentcomponent.