Record Class BattleSceneTimeSettings

java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.battles.scene.BattleSceneTimeSettings
Record Components:
mode - whether the scene uses a fixed time or mirrors the real client world
time - fixed day time used when mode is BattleSceneSettingMode.FIXED

public record BattleSceneTimeSettings(BattleSceneSettingMode mode, long time) extends Record
Time-of-day behavior for a battle scene.

Fixed time uses the authored day time from the scene definition. World matching mirrors the real client world.

  • Field Details

  • Constructor Details

    • BattleSceneTimeSettings

      public BattleSceneTimeSettings(BattleSceneSettingMode mode, long time)
      Creates an instance of a BattleSceneTimeSettings record class.
      Parameters:
      mode - the value for the mode record component
      time - the value for the time record component
  • Method Details

    • decode

      public static BattleSceneTimeSettings decode(net.minecraft.network.FriendlyByteBuf buffer)
      Decodes time settings from a battle scene packet.
      Parameters:
      buffer - the packet buffer to read from
      Returns:
      the decoded time settings
    • encode

      public void encode(net.minecraft.network.FriendlyByteBuf buffer)
      Encodes these time settings for a battle scene packet.
      Parameters:
      buffer - the packet buffer to write to
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • mode

      public BattleSceneSettingMode mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • time

      public long time()
      Returns the value of the time record component.
      Returns:
      the value of the time record component