Contents
Class PickupItemComponent
java.lang.Object
com.hypixel.hytale.server.core.modules.entity.item.PickupItemComponent
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
A component that signifies that an item entity is being used to display
the pick-up animation of an item.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatThe default travel time, in seconds, of a pickup item entity.Fields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionDefault Constructor for aPickupItemComponentinstance.PickupItemComponent(Ref<EntityStore> targetRef, org.joml.Vector3d startPosition) Default Constructor for aPickupItemComponentinstance.PickupItemComponent(Ref<EntityStore> targetRef, org.joml.Vector3d startPosition, float lifeTime) Default Constructor for aPickupItemComponentinstance.PickupItemComponent(PickupItemComponent pickupItemComponent) Constructor for aPickupItemComponentinstance. -
Method Summary
Modifier and TypeMethodDescriptionclone()voiddecreaseLifetime(float amount) Called to decrease the lifetime of this pickup item entity.static ComponentType<EntityStore, PickupItemComponent> floatfloatorg.joml.Vector3dbooleanvoidsetFinished(boolean finished) Sets whether this pickup item entity has finished.voidsetInitialLifeTime(float lifeTimeS) Meant to be called right after that component has been created.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Field Details
-
PICKUP_TRAVEL_TIME_DEFAULT
public static final float PICKUP_TRAVEL_TIME_DEFAULTThe default travel time, in seconds, of a pickup item entity.- See Also:
-
-
Constructor Details
-
PickupItemComponent
public PickupItemComponent()Default Constructor for aPickupItemComponentinstance. -
PickupItemComponent
public PickupItemComponent(@Nonnull Ref<EntityStore> targetRef, @Nonnull org.joml.Vector3d startPosition) Default Constructor for aPickupItemComponentinstance.- Parameters:
targetRef- The entity reference of the entity picking up this item.startPosition- The start position of the pickup item entity.
-
PickupItemComponent
public PickupItemComponent(@Nonnull Ref<EntityStore> targetRef, @Nonnull org.joml.Vector3d startPosition, float lifeTime) Default Constructor for aPickupItemComponentinstance.- Parameters:
targetRef- The entity reference of the entity picking up this item.startPosition- The start position of the pickup item entity.lifeTime- The maximum lifetime to travel to the target location.
-
PickupItemComponent
Constructor for aPickupItemComponentinstance.- Parameters:
pickupItemComponent- ThePickupItemComponentinstance to clone from.
-
-
Method Details
-
getComponentType
- Returns:
- the
PickupItemComponenttype.
-
hasFinished
public boolean hasFinished()- Returns:
trueif finished,falseotherwise.
-
setFinished
public void setFinished(boolean finished) Sets whether this pickup item entity has finished.- Parameters:
finished-trueif finished,falseotherwise.
-
decreaseLifetime
public void decreaseLifetime(float amount) Called to decrease the lifetime of this pickup item entity.- Parameters:
amount- The amount of time to decrease the lifetime by.
-
getLifeTime
public float getLifeTime()- Returns:
- the lifetime, in seconds, of this pickup item entity.
-
getOriginalLifeTime
public float getOriginalLifeTime()- Returns:
- the original lifetime, in seconds, of this pickup item entity.
-
setInitialLifeTime
public void setInitialLifeTime(float lifeTimeS) Meant to be called right after that component has been created.- Parameters:
lifeTimeS- The lifetime, in seconds, of this pickup item entity.
-
getStartPosition
@Nonnull public org.joml.Vector3d getStartPosition()- Returns:
- the start position of this pickup item entity.
-
getTargetRef
- Returns:
- the entity reference of the entity picking up this item.
-
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-