Interface PhysicsConfig

All Superinterfaces:
NetworkSerializable<PhysicsConfig>
All Known Implementing Classes:
GroundFollowPhysicsConfig, StandardPhysicsConfig

public interface PhysicsConfig extends NetworkSerializable<PhysicsConfig>
A configuration defining the physics behavior of a projectile.
  • Field Details

  • Method Details

    • apply

      void apply(@Nonnull Holder<EntityStore> holder, @Nullable Ref<EntityStore> creatorRef, @Nonnull org.joml.Vector3d velocity, @Nonnull ComponentAccessor<EntityStore> componentAccessor, boolean predicted)
      Called to apply the physics to the given entity store holder.
      Parameters:
      holder - The entity holder of the projectile.
      creatorRef - The entity reference of the instigating entity.
      velocity - The initial velocity of the projectile.
      componentAccessor - The ComponentAccessor<EntityStore> for component access.
      predicted - Whether the physics is being applied in a predicted context.
    • getGravity

      default double getGravity()
      Returns the gravitational acceleration for this physics configuration. Used for NPC ballistic aiming calculations.
      Returns:
      the gravity in blocks/second², or 0 if gravity is not applicable.