Record Class TrialSpawnerStateData.Packed

java.lang.Object
java.lang.Record
net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerStateData.Packed
Enclosing class:
TrialSpawnerStateData

public static record TrialSpawnerStateData.Packed(Set<UUID> detectedPlayers, Set<UUID> currentMobs, long cooldownEndsAt, long nextMobSpawnsAt, int totalMobsSpawned, Optional<SpawnData> nextSpawnData, Optional<ResourceKey<LootTable>> ejectingLootTable) extends Record
  • Field Details

    • detectedPlayers

      private final Set<UUID> detectedPlayers
      The field for the detectedPlayers record component.
    • currentMobs

      private final Set<UUID> currentMobs
      The field for the currentMobs record component.
    • cooldownEndsAt

      private final long cooldownEndsAt
      The field for the cooldownEndsAt record component.
    • nextMobSpawnsAt

      private final long nextMobSpawnsAt
      The field for the nextMobSpawnsAt record component.
    • totalMobsSpawned

      private final int totalMobsSpawned
      The field for the totalMobsSpawned record component.
    • nextSpawnData

      private final Optional<SpawnData> nextSpawnData
      The field for the nextSpawnData record component.
    • ejectingLootTable

      private final Optional<ResourceKey<LootTable>> ejectingLootTable
      The field for the ejectingLootTable record component.
    • MAP_CODEC

      public static final com.mojang.serialization.MapCodec<TrialSpawnerStateData.Packed> MAP_CODEC
  • Constructor Details

    • Packed

      public Packed(Set<UUID> detectedPlayers, Set<UUID> currentMobs, long cooldownEndsAt, long nextMobSpawnsAt, int totalMobsSpawned, Optional<SpawnData> nextSpawnData, Optional<ResourceKey<LootTable>> ejectingLootTable)
      Creates an instance of a Packed record class.
      Parameters:
      detectedPlayers - the value for the detectedPlayers record component
      currentMobs - the value for the currentMobs record component
      cooldownEndsAt - the value for the cooldownEndsAt record component
      nextMobSpawnsAt - the value for the nextMobSpawnsAt record component
      totalMobsSpawned - the value for the totalMobsSpawned record component
      nextSpawnData - the value for the nextSpawnData record component
      ejectingLootTable - the value for the ejectingLootTable record component
  • Method Details

    • 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.
    • detectedPlayers

      public Set<UUID> detectedPlayers()
      Returns the value of the detectedPlayers record component.
      Returns:
      the value of the detectedPlayers record component
    • currentMobs

      public Set<UUID> currentMobs()
      Returns the value of the currentMobs record component.
      Returns:
      the value of the currentMobs record component
    • cooldownEndsAt

      public long cooldownEndsAt()
      Returns the value of the cooldownEndsAt record component.
      Returns:
      the value of the cooldownEndsAt record component
    • nextMobSpawnsAt

      public long nextMobSpawnsAt()
      Returns the value of the nextMobSpawnsAt record component.
      Returns:
      the value of the nextMobSpawnsAt record component
    • totalMobsSpawned

      public int totalMobsSpawned()
      Returns the value of the totalMobsSpawned record component.
      Returns:
      the value of the totalMobsSpawned record component
    • nextSpawnData

      public Optional<SpawnData> nextSpawnData()
      Returns the value of the nextSpawnData record component.
      Returns:
      the value of the nextSpawnData record component
    • ejectingLootTable

      public Optional<ResourceKey<LootTable>> ejectingLootTable()
      Returns the value of the ejectingLootTable record component.
      Returns:
      the value of the ejectingLootTable record component