Record Class VibrationInfo

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

public record VibrationInfo(GameEvent gameEvent, float distance, Vec3 pos, @Nullable UUID uuid, @Nullable UUID projectileOwnerUuid, @Nullable Entity entity) extends Record
  • Field Details

    • gameEvent

      private final GameEvent gameEvent
      The field for the gameEvent record component.
    • distance

      private final float distance
      The field for the distance record component.
    • pos

      private final Vec3 pos
      The field for the pos record component.
    • uuid

      @Nullable private final UUID uuid
      The field for the uuid record component.
    • projectileOwnerUuid

      @Nullable private final UUID projectileOwnerUuid
      The field for the projectileOwnerUuid record component.
    • entity

      @Nullable private final Entity entity
      The field for the entity record component.
    • CODEC

      public static final com.mojang.serialization.Codec<VibrationInfo> CODEC
  • Constructor Details

    • VibrationInfo

      public VibrationInfo(GameEvent p_249055_, float p_250190_, Vec3 p_251692_, @Nullable UUID p_249849_, @Nullable UUID p_249731_)
    • VibrationInfo

      public VibrationInfo(GameEvent p_252023_, float p_251086_, Vec3 p_250935_, @Nullable Entity p_249432_)
    • VibrationInfo

      public VibrationInfo(GameEvent gameEvent, float distance, Vec3 pos, @Nullable UUID uuid, @Nullable UUID projectileOwnerUuid, @Nullable Entity entity)
      Creates an instance of a VibrationInfo record class.
      Parameters:
      gameEvent - the value for the gameEvent record component
      distance - the value for the distance record component
      pos - the value for the pos record component
      uuid - the value for the uuid record component
      projectileOwnerUuid - the value for the projectileOwnerUuid record component
      entity - the value for the entity record component
  • Method Details

    • 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()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • gameEvent

      public GameEvent gameEvent()
      Returns the value of the gameEvent record component.
      Returns:
      the value of the gameEvent record component
    • distance

      public float distance()
      Returns the value of the distance record component.
      Returns:
      the value of the distance record component
    • pos

      public Vec3 pos()
      Returns the value of the pos record component.
      Returns:
      the value of the pos record component
    • uuid

      @Nullable public UUID uuid()
      Returns the value of the uuid record component.
      Returns:
      the value of the uuid record component
    • projectileOwnerUuid

      @Nullable public UUID projectileOwnerUuid()
      Returns the value of the projectileOwnerUuid record component.
      Returns:
      the value of the projectileOwnerUuid record component
    • entity

      @Nullable public Entity entity()
      Returns the value of the entity record component.
      Returns:
      the value of the entity record component