Record Class TrialSpawnerStateData.Packed
java.lang.Object
java.lang.Record
net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerStateData.Packed
- Enclosing class:
TrialSpawnerStateData
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long
The field for thecooldownEndsAt
record component.The field for thecurrentMobs
record component.The field for thedetectedPlayers
record component.private final Optional
<ResourceKey<LootTable>> The field for theejectingLootTable
record component.static final com.mojang.serialization.MapCodec
<TrialSpawnerStateData.Packed> private final long
The field for thenextMobSpawnsAt
record component.The field for thenextSpawnData
record component.private final int
The field for thetotalMobsSpawned
record component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the value of thecooldownEndsAt
record component.Returns the value of thecurrentMobs
record component.Returns the value of thedetectedPlayers
record component.Returns the value of theejectingLootTable
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.long
Returns the value of thenextMobSpawnsAt
record component.Returns the value of thenextSpawnData
record component.final String
toString()
Returns a string representation of this record class.int
Returns the value of thetotalMobsSpawned
record component.
-
Field Details
-
detectedPlayers
The field for thedetectedPlayers
record component. -
currentMobs
The field for thecurrentMobs
record component. -
cooldownEndsAt
private final long cooldownEndsAtThe field for thecooldownEndsAt
record component. -
nextMobSpawnsAt
private final long nextMobSpawnsAtThe field for thenextMobSpawnsAt
record component. -
totalMobsSpawned
private final int totalMobsSpawnedThe field for thetotalMobsSpawned
record component. -
nextSpawnData
The field for thenextSpawnData
record component. -
ejectingLootTable
The field for theejectingLootTable
record component. -
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 aPacked
record class.- Parameters:
detectedPlayers
- the value for thedetectedPlayers
record componentcurrentMobs
- the value for thecurrentMobs
record componentcooldownEndsAt
- the value for thecooldownEndsAt
record componentnextMobSpawnsAt
- the value for thenextMobSpawnsAt
record componenttotalMobsSpawned
- the value for thetotalMobsSpawned
record componentnextSpawnData
- the value for thenextSpawnData
record componentejectingLootTable
- the value for theejectingLootTable
record component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
detectedPlayers
Returns the value of thedetectedPlayers
record component.- Returns:
- the value of the
detectedPlayers
record component
-
currentMobs
Returns the value of thecurrentMobs
record component.- Returns:
- the value of the
currentMobs
record component
-
cooldownEndsAt
public long cooldownEndsAt()Returns the value of thecooldownEndsAt
record component.- Returns:
- the value of the
cooldownEndsAt
record component
-
nextMobSpawnsAt
public long nextMobSpawnsAt()Returns the value of thenextMobSpawnsAt
record component.- Returns:
- the value of the
nextMobSpawnsAt
record component
-
totalMobsSpawned
public int totalMobsSpawned()Returns the value of thetotalMobsSpawned
record component.- Returns:
- the value of the
totalMobsSpawned
record component
-
nextSpawnData
Returns the value of thenextSpawnData
record component.- Returns:
- the value of the
nextSpawnData
record component
-
ejectingLootTable
Returns the value of theejectingLootTable
record component.- Returns:
- the value of the
ejectingLootTable
record component
-