Record Class WorldOptionsScreen.DifficultyButtons

java.lang.Object
java.lang.Record
net.minecraft.client.gui.screens.WorldOptionsScreen.DifficultyButtons
Enclosing class:
WorldOptionsScreen

private static record WorldOptionsScreen.DifficultyButtons(LayoutElement layout, CycleButton<Difficulty> difficultyButton, LockIconButton lockButton, Level level) extends Record
  • Field Details

    • layout

      private final LayoutElement layout
      The field for the layout record component.
    • difficultyButton

      private final CycleButton<Difficulty> difficultyButton
      The field for the difficultyButton record component.
    • lockButton

      private final LockIconButton lockButton
      The field for the lockButton record component.
    • level

      private final Level level
      The field for the level record component.
    • DIFFICULTY_TITLE

      private static final Component DIFFICULTY_TITLE
    • DIFFICULTY_DISABLED_HARDCORE_TOOLTIP

      private static final Tooltip DIFFICULTY_DISABLED_HARDCORE_TOOLTIP
    • DIFFICULTY_DISABLED_LOCKED_TOOLTIP

      private static final Tooltip DIFFICULTY_DISABLED_LOCKED_TOOLTIP
    • DIFFICULTY_DISABLED_OPERATOR_TOOLTIP

      private static final Tooltip DIFFICULTY_DISABLED_OPERATOR_TOOLTIP
  • Constructor Details

    • DifficultyButtons

      private DifficultyButtons(LayoutElement layout, CycleButton<Difficulty> difficultyButton, LockIconButton lockButton, Level level)
      Creates an instance of a DifficultyButtons record class.
      Parameters:
      layout - the value for the layout record component
      difficultyButton - the value for the difficultyButton record component
      lockButton - the value for the lockButton record component
      level - the value for the level record component
  • Method Details

    • create

      public static WorldOptionsScreen.DifficultyButtons create(Minecraft minecraft, Level level, WorldOptionsScreen screen)
    • refresh

      private void refresh(Minecraft minecraft, WorldOptionsScreen worldOptionsScreen)
    • refresh

      private void refresh(Minecraft minecraft, WorldOptionsScreen worldOptionsScreen, boolean forceLevelDifficulty)
    • updateDifficultyButtonsState

      private static void updateDifficultyButtonsState(Minecraft minecraft, Level level, CycleButton<Difficulty> difficultyButton, LockIconButton lockButton)
    • isDifficultyLocked

      private static boolean isDifficultyLocked(Level level)
    • 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.
    • layout

      public LayoutElement layout()
      Returns the value of the layout record component.
      Returns:
      the value of the layout record component
    • difficultyButton

      public CycleButton<Difficulty> difficultyButton()
      Returns the value of the difficultyButton record component.
      Returns:
      the value of the difficultyButton record component
    • lockButton

      public LockIconButton lockButton()
      Returns the value of the lockButton record component.
      Returns:
      the value of the lockButton record component
    • level

      public Level level()
      Returns the value of the level record component.
      Returns:
      the value of the level record component