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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final Tooltipprivate static final Tooltipprivate static final Tooltipprivate static final Componentprivate final CycleButton<Difficulty> The field for thedifficultyButtonrecord component.private final LayoutElementThe field for thelayoutrecord component.private final LevelThe field for thelevelrecord component.private final LockIconButtonThe field for thelockButtonrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDifficultyButtons(LayoutElement layout, CycleButton<Difficulty> difficultyButton, LockIconButton lockButton, Level level) Creates an instance of aDifficultyButtonsrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncreate(Minecraft minecraft, Level level, WorldOptionsScreen screen) Returns the value of thedifficultyButtonrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.private static booleanisDifficultyLocked(Level level) layout()Returns the value of thelayoutrecord component.level()Returns the value of thelevelrecord component.Returns the value of thelockButtonrecord component.private voidrefresh(Minecraft minecraft, WorldOptionsScreen worldOptionsScreen) private voidrefresh(Minecraft minecraft, WorldOptionsScreen worldOptionsScreen, boolean forceLevelDifficulty) final StringtoString()Returns a string representation of this record class.private static voidupdateDifficultyButtonsState(Minecraft minecraft, Level level, CycleButton<Difficulty> difficultyButton, LockIconButton lockButton)
-
Field Details
-
layout
The field for thelayoutrecord component. -
difficultyButton
The field for thedifficultyButtonrecord component. -
lockButton
The field for thelockButtonrecord component. -
level
The field for thelevelrecord component. -
DIFFICULTY_TITLE
-
DIFFICULTY_DISABLED_HARDCORE_TOOLTIP
-
DIFFICULTY_DISABLED_LOCKED_TOOLTIP
-
DIFFICULTY_DISABLED_OPERATOR_TOOLTIP
-
-
Constructor Details
-
DifficultyButtons
private DifficultyButtons(LayoutElement layout, CycleButton<Difficulty> difficultyButton, LockIconButton lockButton, Level level) Creates an instance of aDifficultyButtonsrecord class.- Parameters:
layout- the value for thelayoutrecord componentdifficultyButton- the value for thedifficultyButtonrecord componentlockButton- the value for thelockButtonrecord componentlevel- the value for thelevelrecord component
-
-
Method Details
-
create
public static WorldOptionsScreen.DifficultyButtons create(Minecraft minecraft, Level level, WorldOptionsScreen screen) -
refresh
-
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
-
toString
-
hashCode
-
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). -
layout
Returns the value of thelayoutrecord component.- Returns:
- the value of the
layoutrecord component
-
difficultyButton
Returns the value of thedifficultyButtonrecord component.- Returns:
- the value of the
difficultyButtonrecord component
-
lockButton
Returns the value of thelockButtonrecord component.- Returns:
- the value of the
lockButtonrecord component
-
level
Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-