记录类 VibrationInfo

java.lang.Object
java.lang.Record
net.minecraft.world.level.gameevent.vibrations.VibrationInfo

public record VibrationInfo(Holder<GameEvent> gameEvent, float distance, Vec3 pos, @Nullable UUID uuid, @Nullable UUID projectileOwnerUuid, @Nullable Entity entity) extends Record
  • 字段详细资料

    • gameEvent

      private final Holder<GameEvent> gameEvent
      gameEvent 记录组件的字段。
    • distance

      private final float distance
      distance 记录组件的字段。
    • pos

      private final Vec3 pos
      pos 记录组件的字段。
    • uuid

      @Nullable private final UUID uuid
      uuid 记录组件的字段。
    • projectileOwnerUuid

      @Nullable private final UUID projectileOwnerUuid
      projectileOwnerUuid 记录组件的字段。
    • entity

      @Nullable private final Entity entity
      entity 记录组件的字段。
    • CODEC

      public static final com.mojang.serialization.Codec<VibrationInfo> CODEC
  • 构造器详细资料

    • VibrationInfo

      public VibrationInfo(Holder<GameEvent> p_332399_, float p_250190_, Vec3 p_251692_, @Nullable UUID p_249849_, @Nullable UUID p_249731_)
    • VibrationInfo

      public VibrationInfo(Holder<GameEvent> p_333558_, float p_251086_, Vec3 p_250935_, @Nullable Entity p_249432_)
    • VibrationInfo

      public VibrationInfo(Holder<GameEvent> gameEvent, float distance, Vec3 pos, @Nullable UUID uuid, @Nullable UUID projectileOwnerUuid, @Nullable Entity entity)
      创建 VibrationInfo 记录类的实例。
      参数:
      gameEvent - gameEvent 记录组件的值
      distance - distance 记录组件的值
      pos - pos 记录组件的值
      uuid - uuid 记录组件的值
      projectileOwnerUuid - projectileOwnerUuid 记录组件的值
      entity - entity 记录组件的值
  • 方法详细资料

    • getProjectileOwner

      @Nullable private static UUID getProjectileOwner(@Nullable Entity p_251531_)
    • getEntity

      public Optional<Entity> getEntity(ServerLevel p_249184_)
    • getProjectileOwner

      public Optional<Entity> getProjectileOwner(ServerLevel p_249217_)
    • toString

      public final String toString()
      返回此记录类的字符串表示形式。此表示形式包含类的名称,后跟每个记录组件的名称和值。
      指定者:
      toString 在类中 Record
      返回:
      此对象的字符串表示形式
    • hashCode

      public final int hashCode()
      返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。
      指定者:
      hashCode 在类中 Record
      返回:
      此对象的哈希代码值
    • equals

      public final boolean equals(Object o)
      指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 使用 Objects::equals(Object,Object) 对参考组件进行比较;使用 '==' 对基元组件进行比较
      指定者:
      equals 在类中 Record
      参数:
      o - 要与之进行比较的对象
      返回:
      如果此对象与 o 参数相同,则为 true;否则为 false
    • gameEvent

      public Holder<GameEvent> gameEvent()
      返回 gameEvent 记录组件的值。
      返回:
      gameEvent 记录组件的值
    • distance

      public float distance()
      返回 distance 记录组件的值。
      返回:
      distance 记录组件的值
    • pos

      public Vec3 pos()
      返回 pos 记录组件的值。
      返回:
      pos 记录组件的值
    • uuid

      @Nullable public UUID uuid()
      返回 uuid 记录组件的值。
      返回:
      uuid 记录组件的值
    • projectileOwnerUuid

      @Nullable public UUID projectileOwnerUuid()
      返回 projectileOwnerUuid 记录组件的值。
      返回:
      projectileOwnerUuid 记录组件的值
    • entity

      @Nullable public Entity entity()
      返回 entity 记录组件的值。
      返回:
      entity 记录组件的值