接口 Fireball

所有超级接口:
CommandSender, Entity, Explosive, Metadatable, Nameable, Permissible, PersistentDataHolder, Projectile, ServerOperator
所有已知子接口:
AbstractWindCharge, BreezeWindCharge, DragonFireball, LargeFireball, SizedFireball, SmallFireball, WindCharge, WitherSkull

public interface Fireball extends Projectile, Explosive
代表一个火球.
  • 方法详细资料

    • setDirection

      void setDirection(@NotNull @NotNull Vector direction)
      设置火球飞行的方向.
      这是一个便捷方法,它会改变速度方向和加速度方向,同时保持力度不变.
      注意: 此方法仅使用向量的方向,并会将其归一化(使用副本).
      特殊情况: 当给定方向为 零向量时,速度和加速度也将被设置为零,且不会保持力度.

      原文:Sets the direction the fireball should be flying towards.
      This is a convenience method, it will change the velocity direction and acceleration direction, while keeping the power the same.
      Note: This method only uses the direction of the vector and will normalize (a copy of) it.
      Special Case: When the given direction is zero, the velocity and acceleration will also be set to zero without keeping the power.

      参数:
      direction - 此火球应飞行的方向
      另请参阅:
    • getDirection

      @NotNull @Deprecated(since="1.20.6") @NotNull Vector getDirection()
      已过时。
      命名不当的方法,返回的是 getAcceleration() 的值
      获取此火球的飞行方向. 返回的向量不会被归一化.

      原文:Retrieve the direction this fireball is heading toward. The returned vector is not normalized.

      返回:
      方向
      另请参阅:
    • setAcceleration

      void setAcceleration(@NotNull @NotNull Vector acceleration)
      设置火球的加速度. 加速度每 tick 都会被应用到速度上,根据火球的具体类型,会施加一个阻尼/阻力因子, 以防止速度无限增长.
      注意: 客户端可能不会遵循非默认的加速度力度,因此会导致火球位置预测错误, 造成视觉上的卡顿.

      原文:Sets the acceleration of the fireball. The acceleration gets applied to the velocity every tick, depending on the specific type of the fireball a damping / drag factor is applied so that the velocity does not grow into infinity.
      Note: that the client may not respect non-default acceleration power and will therefore mispredict the location of the fireball, causing visual stutter.

      参数:
      acceleration - 加速度
    • getAcceleration

      @NotNull @NotNull Vector getAcceleration()
      获取此火球的加速度.

      原文:Retrieve the acceleration of this fireball.

      返回:
      加速度