Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getComponentType()
- assembleDefaultProjectile(TimeResource, String, Vector3d, Rotation3f)
- initialize()
- initializePhysics(BoundingBox)
- onProjectileBounce(Vector3d, ComponentAccessor)
- consumeDeadTimer(float)
- onProjectileDeath(Ref, Vector3d, CommandBuffer)
- shoot(Holder, UUID, double, double, double, float, float)
- computeStartOffset(boolean, double, double, double, float, float, Vector3d)
- isOnGround()
- getProjectile()
- getAppearance()
- getProjectileAssetName()
- getSimplePhysicsProvider()
- applyBrokenPenalty(float)
- getCreatorUuid()
- clone()
Class ProjectileComponent
java.lang.Object
com.hypixel.hytale.server.core.entity.entities.ProjectileComponent
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
A component that is attached to a projectile entity, containing the projectile attributes and configuration
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<ProjectileComponent> The codec used to parseProjectileComponentinstancesFields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionProjectileComponent(String projectileAssetName) Default Constructor for aProjectileComponentinstance -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyBrokenPenalty(float penalty) static Holder<EntityStore> assembleDefaultProjectile(TimeResource time, String projectileAssetName, org.joml.Vector3d position, Rotation3f rotation) Creates a new entity holder, using the given projectile name, position and rotationclone()static voidcomputeStartOffset(boolean pitchAdjust, double verticalCenterShot, double horizontalCenterShot, double depthShot, float yaw, float pitch, org.joml.Vector3d offset) booleanconsumeDeadTimer(float dt) Consumes the dead timer of the projectilestatic ComponentType<EntityStore, ProjectileComponent> booleanCalled to initialize this projectile component for a projectile entity.voidinitializePhysics(BoundingBox boundingBox) Called to initialize the physics of this projectile.booleanvoidonProjectileBounce(org.joml.Vector3d position, ComponentAccessor<EntityStore> componentAccessor) Called when the projectile bounces.voidonProjectileDeath(Ref<EntityStore> ref, org.joml.Vector3d position, CommandBuffer<EntityStore> commandBuffer) Called upon the death of the given projectile.voidshoot(Holder<EntityStore> holder, UUID creatorUuid, double x, double y, double z, float yaw, float pitch) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Field Details
-
CODEC
The codec used to parseProjectileComponentinstances
-
-
Constructor Details
-
ProjectileComponent
Default Constructor for aProjectileComponentinstance- Parameters:
projectileAssetName- The name of the affiliated projectile asset
-
ProjectileComponent
-
-
Method Details
-
getComponentType
- Returns:
- the component type for the
ProjectileComponentcomponent
-
assembleDefaultProjectile
@Nonnull public static Holder<EntityStore> assembleDefaultProjectile(@Nonnull TimeResource time, @Nonnull String projectileAssetName, @Nonnull org.joml.Vector3d position, @Nonnull Rotation3f rotation) Creates a new entity holder, using the given projectile name, position and rotation- Parameters:
time- The time resource of the entity storeprojectileAssetName- The name of the associated projectile assetposition- The position of the projectilerotation- The rotation of the projectile- Returns:
- the newly created entity holder for the projectile entity
-
initialize
public boolean initialize()Called to initialize this projectile component for a projectile entity.- Returns:
trueif initialization was successful,falseotherwise.
-
initializePhysics
Called to initialize the physics of this projectile.- Parameters:
boundingBox- The configured bounding box of the projectile.
-
onProjectileBounce
public void onProjectileBounce(@Nonnull org.joml.Vector3d position, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called when the projectile bounces.- Parameters:
position- The position of the projectile.componentAccessor- The component accessor for accessing components and resources.
-
consumeDeadTimer
public boolean consumeDeadTimer(float dt) Consumes the dead timer of the projectile- Parameters:
dt- The delta time to consume- Returns:
trueif the dead timer has expired,falseotherwise
-
onProjectileDeath
public void onProjectileDeath(@Nonnull Ref<EntityStore> ref, @Nonnull org.joml.Vector3d position, @Nonnull CommandBuffer<EntityStore> commandBuffer) Called upon the death of the given projectile.- Parameters:
ref- The entity reference to the affiliated projectile.position- The position of the projectile.commandBuffer- TheCommandBuffer<EntityStore>for component access.
-
shoot
public void shoot(@Nonnull Holder<EntityStore> holder, @Nonnull UUID creatorUuid, double x, double y, double z, float yaw, float pitch) -
computeStartOffset
public static void computeStartOffset(boolean pitchAdjust, double verticalCenterShot, double horizontalCenterShot, double depthShot, float yaw, float pitch, @Nonnull org.joml.Vector3d offset) -
isOnGround
public boolean isOnGround() -
getProjectile
-
getAppearance
-
getProjectileAssetName
-
getSimplePhysicsProvider
-
applyBrokenPenalty
public void applyBrokenPenalty(float penalty) -
getCreatorUuid
-
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-