Record Class VibrationListener.ReceivingEvent

java.lang.Object
java.lang.Record
net.minecraft.world.level.gameevent.vibrations.VibrationListener.ReceivingEvent
Enclosing class:
VibrationListener

public static record VibrationListener.ReceivingEvent(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<VibrationListener.ReceivingEvent> CODEC
  • Constructor Details

    • ReceivingEvent

      public ReceivingEvent(GameEvent p_223817_, float p_223818_, Vec3 p_223819_, @Nullable UUID p_223820_, @Nullable UUID p_223821_)
    • ReceivingEvent

      public ReceivingEvent(GameEvent p_223812_, float p_223813_, Vec3 p_223814_, @Nullable Entity p_223815_)
    • ReceivingEvent

      public ReceivingEvent(GameEvent gameEvent, float distance, Vec3 pos, @Nullable UUID uuid, @Nullable UUID projectileOwnerUuid, @Nullable Entity entity)
      Creates an instance of a ReceivingEvent 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_223833_)
    • getEntity

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

      public Optional<Entity> getProjectileOwner(ServerLevel p_223846_)
    • 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