public class ProjectileComponent implements Component
Component for tracking projectile state. Attach this component to entities that need to track projectile data.
java.lang.Object > ProjectileComponent
Field Summary
projectileAssetName
Field projectileAssetName.
brokenDamageModifier
Field brokenDamageModifier.
deadTimer
Field deadTimer.
creatorUuid
Field creatorUuid.
haveHit
Field haveHit.
lastBouncePosition
Field lastBouncePosition.
holder
Field holder.
projectileComponent
Field projectileComponent.
appearance
Field appearance.
bounceParticles
Field bounceParticles.
hitParticles
Field hitParticles.
targetEntity
Field targetEntity.
shooterRef
Field shooterRef.
missParticles
Field missParticles.
entityStore
Field entityStore.
world
Field world.
explosionConfig
Field explosionConfig.
chunkStore
Field chunkStore.
creatorRef
Field creatorRef.
damageSource
Field damageSource.
deathParticles
Field deathParticles.
direction
Field direction.
Method Detail
getComponentType
ProjectileComponent>
getComponentType
()
Method getComponentType.
ProjectileComponent
private
ProjectileComponent
()
Method ProjectileComponent.
assembleDefaultProjectile
Holder
assembleDefaultProjectile
(@Nonnull final TimeResource time, @Nonnull final String projectileAssetName, @Nonnull final Vector3d position, @Nonnull final Vector3f rotation)
Method assembleDefaultProjectile.
- Parameters:
@Nonnull final TimeResourcetime@Nonnull final StringprojectileAssetName@Nonnull final Vector3dposition@Nonnull final Vector3frotation
TransformComponent
new
TransformComponent
(position.clone()
Method TransformComponent.
- Parameters:
position.clone(position.clone(
initialize
boolean
initialize
()
Method initialize.
onProjectileBounce
void
onProjectileBounce
(@Nonnull final Vector3d position, @Nonnull final ComponentAccessor componentAccessor)
Method onProjectileBounce.
- Parameters:
@Nonnull final Vector3dposition@Nonnull final ComponentAccessorcomponentAccessor
onProjectileHitEvent
void
onProjectileHitEvent
(@Nonnull final Ref ref, @Nonnull final Vector3d position, @Nonnull final Ref targetRef, @Nonnull final ComponentAccessor componentAccessor)
Method onProjectileHitEvent.
- Parameters:
@Nonnull final Refref@Nonnull final Vector3dposition@Nonnull final ReftargetRef@Nonnull final ComponentAccessorcomponentAccessor
Damage
new
Damage
(new Damage.ProjectileSource((shooterRef != null)
Method Damage.
- Parameters:
new Damage.ProjectileSource((shooterRef !=null
consumeDeadTimer
boolean
consumeDeadTimer
(final float dt)
Method consumeDeadTimer.
- Parameters:
final floatdt
bounceHandler
void
bounceHandler
(@Nonnull final Vector3d position, @Nonnull final ComponentAccessor componentAccessor)
Method bounceHandler.
- Parameters:
@Nonnull final Vector3dposition@Nonnull final ComponentAccessorcomponentAccessor
impactHandler
void
impactHandler
(@Nonnull final Ref ref, @Nonnull final Vector3d position, @Nullable final Ref targetRef, @Nonnull final ComponentAccessor componentAccessor)
Method impactHandler.
- Parameters:
@Nonnull final Refref@Nonnull final Vector3dposition@Nullable final ReftargetRef@Nonnull final ComponentAccessorcomponentAccessor
onProjectileMissEvent
void
onProjectileMissEvent
(@Nonnull final Vector3d position, @Nonnull final ComponentAccessor componentAccessor)
Method onProjectileMissEvent.
- Parameters:
@Nonnull final Vector3dposition@Nonnull final ComponentAccessorcomponentAccessor
onProjectileDeath
void
onProjectileDeath
(@Nonnull final Ref ref, @Nonnull final Vector3d position, @Nonnull final CommandBuffer commandBuffer)
Method onProjectileDeath.
- Parameters:
@Nonnull final Refref@Nonnull final Vector3dposition@Nonnull final CommandBuffercommandBuffer
shoot
void
shoot
(@Nonnull final Holder holder, @Nonnull final UUID creatorUuid, double x, double y, double z, final float yaw, final float pitch)
Method shoot.
- Parameters:
@Nonnull final Holderholder@Nonnull final UUIDcreatorUuiddoublexdoubleydoublezfinal floatyawfinal floatpitch
computeStartOffset
void
computeStartOffset
(final boolean pitchAdjust, final double verticalCenterShot, final double horizontalCenterShot, final double depthShot, final float yaw, final float pitch, @Nonnull final Vector3d offset)
Method computeStartOffset.
- Parameters:
final booleanpitchAdjustfinal doubleverticalCenterShotfinal doublehorizontalCenterShotfinal doubledepthShotfinal floatyawfinal floatpitch@Nonnull final Vector3doffset
isOnGround
boolean
isOnGround
()
Method isOnGround.
getAppearance
String
getAppearance
()
Method getAppearance.
getProjectileAssetName
String
getProjectileAssetName
()
Method getProjectileAssetName.
getSimplePhysicsProvider
Method getSimplePhysicsProvider.
applyBrokenPenalty
void
applyBrokenPenalty
(final float penalty)
Method applyBrokenPenalty.
- Parameters:
final floatpenalty