Record Class TicketType

java.lang.Object
java.lang.Record
net.minecraft.server.level.TicketType

public record TicketType(long timeout, int flags, boolean forceNaturalSpawning) extends Record
  • Field Details

    • timeout

      private final long timeout
      The field for the timeout record component.
    • flags

      private final int flags
      The field for the flags record component.
    • forceNaturalSpawning

      private final boolean forceNaturalSpawning
      The field for the forceNaturalSpawning record component.
    • NO_TIMEOUT

      public static final long NO_TIMEOUT
      See Also:
    • FLAG_PERSIST

      public static final int FLAG_PERSIST
      See Also:
    • FLAG_LOADING

      public static final int FLAG_LOADING
      See Also:
    • FLAG_SIMULATION

      public static final int FLAG_SIMULATION
      See Also:
    • FLAG_KEEP_DIMENSION_ACTIVE

      public static final int FLAG_KEEP_DIMENSION_ACTIVE
      See Also:
    • FLAG_CAN_EXPIRE_IF_UNLOADED

      public static final int FLAG_CAN_EXPIRE_IF_UNLOADED
      See Also:
    • PLAYER_SPAWN

      public static final TicketType PLAYER_SPAWN
    • DRAGON

      public static final TicketType DRAGON
    • PLAYER_LOADING

      public static final TicketType PLAYER_LOADING
    • PLAYER_SIMULATION

      public static final TicketType PLAYER_SIMULATION
    • FORCED

      public static final TicketType FORCED
    • PORTAL

      public static final TicketType PORTAL
    • ENDER_PEARL

      public static final TicketType ENDER_PEARL
    • UNKNOWN

      public static final TicketType UNKNOWN
  • Constructor Details

    • TicketType

      public TicketType(long timeout, int flags)
    • TicketType

      public TicketType(long timeout, int flags, boolean forceNaturalSpawning)
      Creates an instance of a TicketType record class.
      Parameters:
      timeout - the value for the timeout record component
      flags - the value for the flags record component
      forceNaturalSpawning - the value for the forceNaturalSpawning record component
  • Method Details

    • register

      private static TicketType register(String pName, long pTimeout, int pFlags)
    • persist

      public boolean persist()
    • doesLoad

      public boolean doesLoad()
    • doesSimulate

      public boolean doesSimulate()
    • shouldKeepDimensionActive

      public boolean shouldKeepDimensionActive()
    • canExpireIfUnloaded

      public boolean canExpireIfUnloaded()
    • hasTimeout

      public boolean hasTimeout()
    • 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 '=='.
      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.
    • timeout

      public long timeout()
      Returns the value of the timeout record component.
      Returns:
      the value of the timeout record component
    • flags

      public int flags()
      Returns the value of the flags record component.
      Returns:
      the value of the flags record component
    • forceNaturalSpawning

      public boolean forceNaturalSpawning()
      Returns the value of the forceNaturalSpawning record component.
      Returns:
      the value of the forceNaturalSpawning record component