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.LongSet
The field for thenaturalSpawning
record component.private final it.unimi.dsi.fastutil.longs.LongSet
The field for thenormal
record component. -
Constructor Summary
ConstructorsConstructorDescriptionTicketSet
(it.unimi.dsi.fastutil.longs.LongSet normal, it.unimi.dsi.fastutil.longs.LongSet naturalSpawning) Creates an instance of aTicketSet
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.it.unimi.dsi.fastutil.longs.LongSet
getChunks
(boolean forceNaturalSpawning) final int
hashCode()
Returns a hash code value for this object.boolean
isEmpty()
Checks if all sets of this ticket set are empty.it.unimi.dsi.fastutil.longs.LongSet
Returns the value of thenaturalSpawning
record component.it.unimi.dsi.fastutil.longs.LongSet
normal()
Returns the value of thenormal
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
normal
private final it.unimi.dsi.fastutil.longs.LongSet normalThe field for thenormal
record component. -
naturalSpawning
private final it.unimi.dsi.fastutil.longs.LongSet naturalSpawningThe field for thenaturalSpawning
record 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 aTicketSet
record class.- Parameters:
normal
- the value for thenormal
record componentnaturalSpawning
- the value for thenaturalSpawning
record component
-
-
Method Details
-
isEmpty
public boolean isEmpty()Checks if all sets of this ticket set are empty.- Returns:
true
if there are no tickets or forced natural spawning tickets.
-
getChunks
public it.unimi.dsi.fastutil.longs.LongSet getChunks(boolean forceNaturalSpawning) - Parameters:
forceNaturalSpawning
-true
to 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 thenormal
record component.- Returns:
- the value of the
normal
record component
-
naturalSpawning
public it.unimi.dsi.fastutil.longs.LongSet naturalSpawning()Returns the value of thenaturalSpawning
record component.- Returns:
- the value of the
naturalSpawning
record component
-