Record Class TicketSet
java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.world.chunk.TicketSet
- Record Components:
normal- the normally loaded ticketsnaturalSpawning- the tickets that also force natural spawning to occur
public record TicketSet(it.unimi.dsi.fastutil.longs.LongSet normal, it.unimi.dsi.fastutil.longs.LongSet naturalSpawning)
extends Record
Represents a pair of chunk-loaded ticket sets.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<TicketSet> private static final com.mojang.serialization.Codec<it.unimi.dsi.fastutil.longs.LongSet> private final it.unimi.dsi.fastutil.longs.LongSetThe field for thenaturalSpawningrecord component.private final it.unimi.dsi.fastutil.longs.LongSetThe field for thenormalrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionTicketSet(it.unimi.dsi.fastutil.longs.LongSet normal, it.unimi.dsi.fastutil.longs.LongSet naturalSpawning) Creates an instance of aTicketSetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.it.unimi.dsi.fastutil.longs.LongSetgetChunks(boolean forceNaturalSpawning) final inthashCode()Returns a hash code value for this object.booleanisEmpty()Checks if all sets of this ticket set are empty.it.unimi.dsi.fastutil.longs.LongSetReturns the value of thenaturalSpawningrecord component.it.unimi.dsi.fastutil.longs.LongSetnormal()Returns the value of thenormalrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
normal
private final it.unimi.dsi.fastutil.longs.LongSet normalThe field for thenormalrecord component. -
naturalSpawning
private final it.unimi.dsi.fastutil.longs.LongSet naturalSpawningThe field for thenaturalSpawningrecord component. -
LONG_SET_CODEC
private static final com.mojang.serialization.Codec<it.unimi.dsi.fastutil.longs.LongSet> LONG_SET_CODEC -
CODEC
-
-
Constructor Details
-
TicketSet
public TicketSet(it.unimi.dsi.fastutil.longs.LongSet normal, it.unimi.dsi.fastutil.longs.LongSet naturalSpawning) Creates an instance of aTicketSetrecord class.- Parameters:
normal- the value for thenormalrecord componentnaturalSpawning- the value for thenaturalSpawningrecord component
-
-
Method Details
-
isEmpty
public boolean isEmpty()Checks if all sets of this ticket set are empty.- Returns:
trueif there are no tickets or forced natural spawning tickets.
-
getChunks
public it.unimi.dsi.fastutil.longs.LongSet getChunks(boolean forceNaturalSpawning) - Parameters:
forceNaturalSpawning-trueto get the forced natural spawning tickets, otherwise returns the normal tickets.- Returns:
- The set of normal or forced natural spawning tickets.
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
normal
public it.unimi.dsi.fastutil.longs.LongSet normal()Returns the value of thenormalrecord component.- Returns:
- the value of the
normalrecord component
-
naturalSpawning
public it.unimi.dsi.fastutil.longs.LongSet naturalSpawning()Returns the value of thenaturalSpawningrecord component.- Returns:
- the value of the
naturalSpawningrecord component
-