Class WorldOptionsScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.WorldOptionsScreen
- All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement, HasDifficultyReaction, HasGamemasterPermissionReaction
public class WorldOptionsScreen
extends Screen
implements HasGamemasterPermissionReaction, HasDifficultyReaction
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordNested classes/interfaces inherited from class Screen
Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Componentprivate static final Tooltipprivate static final Tooltipprivate static final Tooltipprivate static final Componentprivate static final Componentprivate static final Tooltipprivate @Nullable CycleButton<GameType> private static final Componentprivate final WorldOptionsScreen.DifficultyButtonsprivate static final Componentprivate static final Tooltipprivate static final Tooltipprivate static final Tooltipprivate static final Tooltipprivate static final Tooltipprivate @Nullable CycleButton<Boolean> private static final Tooltipprivate static final Tooltipprivate static final Componentprivate static final Tooltipprivate static final Tooltipprivate static final Componentprivate static final Componentprivate static final Tooltipprivate static final Tooltipprivate static final Tooltipprivate @Nullable CycleButton<Boolean> private @Nullable Difficultyprivate intprivate static final Componentprivate final Screenprivate final HeaderAndFooterLayoutprivate final Levelprivate static final Componentprivate static final Componentprivate static final Tooltipprivate @Nullable CycleButton<GameType> private intprivate static final intprivate static final Componentprivate static final intprivate static final Componentprivate booleanprivate static final Componentprivate @Nullable ScrollableLayoutprivate static final Componentprivate @Nullable DifficultyFields inherited from class Screen
FADE_IN_TIME, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, renderables, screenExecutor, title, width -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadded()protected voidapplyChanges(@Nullable IntegratedServer singleplayerServer) private voidchangeMultiplayerScope(IntegratedServer singleplayerServer) private CycleButton<Boolean> createAllowCommandsButton(IntegratedServer singleplayerServer) private FocusableTextWidgetcreateCategoryHeader(Component title) private CycleButton<GameType> createGameModeButton(IntegratedServer singleplayerServer, Component buttonName, Tooltip tooltip, GameType defaultValue, Consumer<GameType> gameTypeToChange) private ButtoncreateGameRulesButton(@Nullable IntegratedServer singleplayerServer) private Buttonprotected voidextractMenuBackground(GuiGraphicsExtractor graphics) voidextractRenderState(GuiGraphicsExtractor graphics, int xm, int ym, float a) private voidgeneralOptions(LinearLayout content, @Nullable IntegratedServer singleplayerServer) protected booleanprivate booleanprotected voidinit()private booleanprivate voidmultiplayerOptions(LinearLayout content, IntegratedServer singleplayerServer) voidonClose()voidvoidvoidonGamemasterPermissionChanged(boolean hasGamemasterPermission) private booleanprivate voidpublish(IntegratedServer singleplayerServer, MinecraftServer.MultiplayerScope scope) protected voidprivate voidsendPublishMessage(Component message) private voidsetPortError(EditBox portEdit, @Nullable Component errorMessage) tryParsePort(String value) private voidprivate voidupdateButton(@Nullable AbstractWidget widget, @Nullable IntegratedServer singleplayerServer, @Nullable Tooltip tooltip, Tooltip disabledTooltip, Tooltip hardcoreTooltip) private voidupdateForceGameModeButton(IntegratedServer singleplayerServer) private voidupdateGuestCommandAccessButton(IntegratedServer singleplayerServer) private voidupdatePermissionDependentButtons(@Nullable IntegratedServer singleplayerServer, boolean allowCommands, boolean affectGameRulesButton) voidprivate voidMethods inherited from class Screen
addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, extractBackground, extractBlurredBackground, extractMenuBackground, extractMenuBackgroundTexture, extractPanorama, extractRenderStateWithTooltipAndSubtitles, extractTransparentBackground, fadeWidgets, findNarratableWidget, getBackgroundMusic, getFont, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, insertText, isAllowedInPortal, isInGameUi, isInputCaptured, isMouseOver, isPauseScreen, isValidCharacterForName, keyPressed, onFilesDrop, rebuildWidgets, removed, removeWidget, resize, scheduleNarration, setInitialFocus, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, tick, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatusMethods inherited from class AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContainerEventHandler
charTyped, getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, preeditUpdated, setFocusedMethods inherited from interface GuiEventListener
capturesInput, mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface TabOrderedElement
getTabOrderGroup
-
Field Details
-
TITLE
-
GENERAL_TITLE
-
GAME_RULES
-
GAMERULES_DISABLED_TOOLTIP
-
GAMERULES_DISABLED_HARDCORE_TOOLTIP
-
DEFAULT_GAME_MODE
-
DEFAULT_GAME_MODE_TOOLTIP
-
PERSONAL_GAME_MODE
-
PERSONAL_GAME_MODE_TOOLTIP
-
GAME_MODE_DISABLED_OPERATOR_TOOLTIP
-
GAME_MODE_DISABLED_HARDCORE_TOOLTIP
-
ALLOW_COMMANDS
-
ALLOW_COMMANDS_TOOLTIP
-
ALLOW_COMMANDS_DISABLED_HARDCORE_TOOLTIP
-
ALLOW_COMMANDS_DISABLED_DEMO_TOOLTIP
-
RESTRICTIONS
-
MULTIPLAYER_TITLE
-
GUEST_COMMAND_ACCESS
-
GUEST_COMMAND_ACCESS_TOOLTIP
-
GUEST_COMMAND_ACCESS_DISABLED_MULTIPLAYER_SCOPE_OFF
-
GUEST_COMMAND_ACCESS_DISABLED_COMMANDS_OFF
-
FORCE_GAME_MODE
-
FORCE_GAME_MODE_ON_TOOLTIP
-
FORCE_GAME_MODE_OFF_TOOLTIP
-
FORCE_GAME_MODE_OFF_MULTIPLAYER_TOOLTIP
-
FORCE_GAME_MODE_OFF_HARDCORE_TOOLTIP
-
FORCE_GAME_MODE_OFF_COMMANDS_TOOLTIP
-
PORT_LOWER_BOUND
private static final int PORT_LOWER_BOUND- See Also:
-
PORT_HIGHER_BOUND
private static final int PORT_HIGHER_BOUND- See Also:
-
PORT_INFO_TEXT
-
PORT_UNAVAILABLE
-
INVALID_PORT
-
DIFFICULTY_LOCK_TITLE
-
APPLY_CHANGES
-
layout
-
scrollArea
-
difficultyButtons
-
gameRulesButton
-
defaultGameModeButton
-
personalGameModeButton
-
initialDifficulty
-
wantedDifficulty
-
initialDifficultyLocked
-
wantedDifficultyLocked
-
initialDefaultGameMode
-
wantedDefaultGameMode
-
initialPersonalGameMode
-
wantedPersonalGameMode
-
initialAllowCommands
-
wantedAllowCommands
-
initialMultiplayerScope
-
wantedMultiplayerScope
-
port
private int port -
portValid
private boolean portValid -
portEdit
-
initialPort
private int initialPort -
initialGuestCommandAccess
-
wantedGuestCommandAccess
-
guestCommandAccessButton
-
initialForceGameMode
-
wantedForceGameMode
-
forceGameModeButton
-
lastScreen
-
level
-
applyChanges
-
-
Constructor Details
-
WorldOptionsScreen
-
-
Method Details
-
init
-
createCategoryHeader
-
generalOptions
-
createGameRulesButton
-
createGameModeButton
private CycleButton<GameType> createGameModeButton(IntegratedServer singleplayerServer, Component buttonName, Tooltip tooltip, GameType defaultValue, Consumer<GameType> gameTypeToChange) -
createAllowCommandsButton
-
updateButton
private void updateButton(@Nullable AbstractWidget widget, @Nullable IntegratedServer singleplayerServer, @Nullable Tooltip tooltip, Tooltip disabledTooltip, Tooltip hardcoreTooltip) -
createRestrictionsButton
-
multiplayerOptions
-
updateGuestCommandAccessButton
-
updateForceGameModeButton
-
hasChanges
protected boolean hasChanges() -
applyChanges
-
updateApplyChangesActiveState
private void updateApplyChangesActiveState() -
repositionElements
protected void repositionElements()- Overrides:
repositionElementsin classScreen
-
extractMenuBackground
- Overrides:
extractMenuBackgroundin classScreen
-
extractRenderState
- Specified by:
extractRenderStatein interfaceRenderable- Overrides:
extractRenderStatein classScreen
-
onClose
-
onGamemasterPermissionChanged
public void onGamemasterPermissionChanged(boolean hasGamemasterPermission) - Specified by:
onGamemasterPermissionChangedin interfaceHasGamemasterPermissionReaction
-
updatePermissionDependentButtons
private void updatePermissionDependentButtons(@Nullable IntegratedServer singleplayerServer, boolean allowCommands, boolean affectGameRulesButton) -
updatePersonalGameModeButton
-
added
-
onDifficultyChanged
public void onDifficultyChanged()- Specified by:
onDifficultyChangedin interfaceHasDifficultyReaction
-
onDefaultGameModeChanged
-
portIsRequired
private boolean portIsRequired() -
hasSettingsChanges
private boolean hasSettingsChanges() -
lanPortChanged
private boolean lanPortChanged() -
changeMultiplayerScope
-
publish
-
sendPublishMessage
-
updatePortControlsState
private void updatePortControlsState() -
tryParsePort
-
setPortError
-