Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getAssetStore()
- getAssetMap()
- getId()
- getPhysicsConfig()
- getModelAsset()
- getModel()
- createSpawnModel(Long)
- createSpawnModel(Long, float)
- getLaunchForce()
- getDirectionalHitBox()
- getMuzzleVelocity()
- getGravity()
- getVerticalCenterShot()
- getHorizontalCenterShot()
- getDepthShot()
- isPitchAdjustShot()
- getInteractions()
- getLaunchWorldSoundEventIndex()
- getProjectileSoundEventIndex()
- getSpawnOffset()
- isRotateSpawnOffsetByPitch()
- isRotateSpawnOffsetByYaw()
- getSpawnRotationOffset()
- getCalculatedOffset(float, float)
- toPacket()
Class ProjectileConfig
java.lang.Object
com.hypixel.hytale.server.core.modules.projectile.config.ProjectileConfig
- All Implemented Interfaces:
JsonAsset<String>, JsonAssetWithMap<String, DefaultAssetMap<String, ProjectileConfig>>, NetworkSerializable<ProjectileConfig>, BallisticData
public class ProjectileConfig
extends Object
implements JsonAssetWithMap<String, DefaultAssetMap<String, ProjectileConfig>>, NetworkSerializable<ProjectileConfig>, BallisticData
A configuration defining the properties and behavior of a projectile.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AssetBuilderCodec<String, ProjectileConfig> The codec used to parseProjectileConfiginstancesstatic final ValidatorCache<String> The validator cache forProjectileConfigasset references. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateSpawnModel(Long scaleSeed) createSpawnModel(Long scaleSeed, float scaleMultiplier) static DefaultAssetMap<String, ProjectileConfig> org.joml.Vector3dgetCalculatedOffset(float pitch, float yaw) Called to calculate and return the rotated spawn offset based on the given pitch and yaw.doubledoubledoublegetId()doubleintgetModel()doubleintorg.joml.Vector3fdoublebooleanbooleanbooleantoPacket()
-
Field Details
-
CODEC
The codec used to parseProjectileConfiginstances -
VALIDATOR_CACHE
The validator cache forProjectileConfigasset references.
-
-
Constructor Details
-
ProjectileConfig
public ProjectileConfig()
-
-
Method Details
-
getAssetStore
@Nonnull public static AssetStore<String, ProjectileConfig, DefaultAssetMap<String, ProjectileConfig>> getAssetStore()- Returns:
- the asset store for
ProjectileConfiginstances.
-
getAssetMap
- Returns:
- the asset map for
ProjectileConfiginstances.
-
getId
-
getPhysicsConfig
- Returns:
- the physics configuration for this projectile.
-
getModelAsset
- Returns:
- the resolved model asset for this projectile, or
nullif the asset doesn't exist.
-
getModel
- Returns:
- the unit-scale base model for this projectile, used as the network template.
-
createSpawnModel
-
createSpawnModel
- Parameters:
scaleSeed- A deterministic seed for the model scale, ornullfor a random scale.scaleMultiplier- A multiplier on the resulting scale. Scales the model and its hitbox uniformly (e.g. an AoE rune growing an ability projectile).- Returns:
- a new spawn model.
-
getLaunchForce
public double getLaunchForce()- Returns:
- the launch force of this projectile.
-
getDirectionalHitBox
-
getMuzzleVelocity
public double getMuzzleVelocity()- Specified by:
getMuzzleVelocityin interfaceBallisticData- Returns:
- the muzzle velocity of the projectile in blocks/second.
-
getGravity
public double getGravity()- Specified by:
getGravityin interfaceBallisticData- Returns:
- the gravitational acceleration applied to the projectile in blocks/second².
-
getVerticalCenterShot
public double getVerticalCenterShot()- Specified by:
getVerticalCenterShotin interfaceBallisticData- Returns:
- the vertical offset from the shooter's eye position to the projectile spawn point.
Positive values indicate the projectile spawns above the eye position.
-
getHorizontalCenterShot
public double getHorizontalCenterShot()- Specified by:
getHorizontalCenterShotin interfaceBallisticData- Returns:
- the horizontal offset from the shooter's eye position to the projectile spawn point.
Positive values indicate the projectile spawns in front of the eye position.
-
getDepthShot
public double getDepthShot()- Specified by:
getDepthShotin interfaceBallisticData- Returns:
- the forward depth offset from the shooter's position to the projectile spawn point.
Used to compensate for projectile spawning distance from the shooter.
-
isPitchAdjustShot
public boolean isPitchAdjustShot()- Specified by:
isPitchAdjustShotin interfaceBallisticData- Returns:
trueif the depth offset should be adjusted based on pitch angle,falseif the offset remains constant regardless of pitch.
-
getInteractions
- Returns:
- the interactions this projectile can perform.
-
getLaunchWorldSoundEventIndex
public int getLaunchWorldSoundEventIndex()- Returns:
- the sound event index of the local launch sound.
-
getProjectileSoundEventIndex
public int getProjectileSoundEventIndex()- Returns:
- the sound event index of the local launch sound.
-
getSpawnOffset
@Nonnull public org.joml.Vector3f getSpawnOffset()- Returns:
- the spawn offset of this projectile.
-
isRotateSpawnOffsetByPitch
public boolean isRotateSpawnOffsetByPitch()- Returns:
- whether the spawn offset is rotated by the launch pitch.
-
isRotateSpawnOffsetByYaw
public boolean isRotateSpawnOffsetByYaw()- Returns:
- whether the spawn offset is rotated by the launch yaw.
-
getSpawnRotationOffset
- Returns:
- the spawn rotation offset of this projectile.
-
getCalculatedOffset
@Nonnull public org.joml.Vector3d getCalculatedOffset(float pitch, float yaw) Called to calculate and return the rotated spawn offset based on the given pitch and yaw.- Parameters:
pitch- The given pitch.yaw- The given yaw.- Returns:
- the calculated offset.
-
toPacket
- Specified by:
toPacketin interfaceNetworkSerializable<ProjectileConfig>
-