Record Class DifficultyButtons
java.lang.Object
java.lang.Record
net.minecraft.client.gui.screens.options.DifficultyButtons
public record DifficultyButtons(LayoutElement layout, CycleButton<Difficulty> difficultyButton, LockIconButton lockButton, Level level)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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
ConstructorsConstructorDescriptionDifficultyButtons(LayoutElement layout, CycleButton<Difficulty> difficultyButton, LockIconButton lockButton, Level level) Creates an instance of aDifficultyButtonsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic DifficultyButtonsReturns 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 static voidonLockCallback(boolean result, Minecraft minecraft, Screen screen, CycleButton<Difficulty> difficultyButton, LockIconButton lockButton) private static booleanplayerHasPermissionToChangeDifficulty(Minecraft minecraft) voidfinal StringtoString()Returns a string representation of this record class.
-
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.
-
-
Constructor Details
-
DifficultyButtons
public 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
-
refresh
-
isDifficultyLocked
-
playerHasPermissionToChangeDifficulty
-
onLockCallback
private static void onLockCallback(boolean result, Minecraft minecraft, Screen screen, CycleButton<Difficulty> difficultyButton, LockIconButton lockButton) -
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
-