Record Class TicketSet

java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.world.chunk.TicketSet
Record Components:
normal - the normally loaded tickets
naturalSpawning - 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

    Fields
    Modifier and Type
    Field
    Description
    static 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 the naturalSpawning record component.
    private final it.unimi.dsi.fastutil.longs.LongSet
    The field for the normal record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TicketSet(it.unimi.dsi.fastutil.longs.LongSet normal, it.unimi.dsi.fastutil.longs.LongSet naturalSpawning)
    Creates an instance of a TicketSet record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    it.unimi.dsi.fastutil.longs.LongSet
    getChunks(boolean forceNaturalSpawning)
     
    final int
    Returns a hash code value for this object.
    boolean
    Checks if all sets of this ticket set are empty.
    it.unimi.dsi.fastutil.longs.LongSet
    Returns the value of the naturalSpawning record component.
    it.unimi.dsi.fastutil.longs.LongSet
    Returns the value of the normal record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • normal

      private final it.unimi.dsi.fastutil.longs.LongSet normal
      The field for the normal record component.
    • naturalSpawning

      private final it.unimi.dsi.fastutil.longs.LongSet naturalSpawning
      The field for the naturalSpawning record component.
    • LONG_SET_CODEC

      private static final com.mojang.serialization.Codec<it.unimi.dsi.fastutil.longs.LongSet> LONG_SET_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<TicketSet> CODEC
  • Constructor Details

    • TicketSet

      public TicketSet(it.unimi.dsi.fastutil.longs.LongSet normal, it.unimi.dsi.fastutil.longs.LongSet naturalSpawning)
      Creates an instance of a TicketSet record class.
      Parameters:
      normal - the value for the normal record component
      naturalSpawning - the value for the naturalSpawning 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

      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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • normal

      public it.unimi.dsi.fastutil.longs.LongSet normal()
      Returns the value of the normal record component.
      Returns:
      the value of the normal record component
    • naturalSpawning

      public it.unimi.dsi.fastutil.longs.LongSet naturalSpawning()
      Returns the value of the naturalSpawning record component.
      Returns:
      the value of the naturalSpawning record component