Class CreateWorldScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.worldselection.CreateWorldScreen
- All Implemented Interfaces:
ContainerEventHandler,GuiEventListener,Renderable,TabOrderedElement
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final record(package private) class(package private) class(package private) classNested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Component(package private) static final Component(package private) static final Componentprivate static final intprivate static final intprivate final Screenprivate final HeaderAndFooterLayoutprivate static final org.slf4j.Logger(package private) static final Componentprivate final DirectoryValidatorprivate static final Componentprivate booleanprivate static final intstatic final ResourceLocationprivate final TabManagerprivate TabNavigationBarprivate static final Stringprivate Pathprivate PackRepository(package private) final WorldCreationUiStateprivate static final intFields inherited from class net.minecraft.client.gui.screens.Screen
CUBE_MAP, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, PANORAMA, renderables, screenExecutor, title, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCreateWorldScreen(Minecraft minecraft, Screen lastScreen, WorldCreationContext settings, Optional<ResourceKey<WorldPreset>> preset, OptionalLong seed) -
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends GuiEventListener & Renderable & NarratableEntry>
TaddRenderableWidget(T widget) protected <T extends GuiEventListener & NarratableEntry>
TaddWidget(T listener) private voidapplyNewPackConfig(PackRepository packRepository, WorldDataConfiguration worldDataConfiguration, Consumer<WorldDataConfiguration> consumer) private static voidcopyBetweenDirs(Path fromDir, Path toDir, Path filePath) private static WorldLoader.InitConfigcreateDefaultLoadConfig(PackRepository packRepository, WorldDataConfiguration initialDataConfig) static CreateWorldScreencreateFromExisting(Minecraft minecraft, Screen lastScreen, LevelSettings levelSettings, WorldCreationContext settings, Path tempDataPackDir) private LevelSettingscreateLevelSettings(boolean debug) private voidcreateNewWorld(PrimaryLevelData.SpecialWorldProperty specialWorldProperty, LayeredRegistryAccess<RegistryLayer> p_249152_, com.mojang.serialization.Lifecycle worldGenSettingsLifecycle) static PathcreateTempDataPackDirFromExistingWorld(Path datapackDir, Minecraft minecraft) private com.mojang.datafixers.util.Pair<Path, PackRepository> getDataPackSelectionSettings(WorldDataConfiguration worldDataConfiguration) private Pathprotected voidinit()booleankeyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.voidonClose()private voidonCreate()(package private) voidopenDataPackSelectionScreen(WorldDataConfiguration worldDataConfiguration) (package private) voidopenExperimentsScreen(WorldDataConfiguration worldDataConfiguration) static voidvoidprivate static voidqueueLoadScreen(Minecraft minecraft, Component title) private voidvoidrender(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) Renders the graphical user interface (GUI) element.protected voidrenderMenuBackground(GuiGraphics partialTick) voidprotected voidprivate voidtryApplyNewDataPacks(PackRepository packRepository, boolean shouldConfirm, Consumer<WorldDataConfiguration> consumer) Methods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearTooltipForNextRenderPass, clearWidgets, findNarratableWidget, getBackgroundMusic, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, onFilesDrop, rebuildWidgets, removed, removeWidget, renderBackground, renderBlurredBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltip, resize, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, tick, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatus, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMovedMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
GROUP_BOTTOM
private static final int GROUP_BOTTOM- See Also:
-
TAB_COLUMN_WIDTH
private static final int TAB_COLUMN_WIDTH- See Also:
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TEMP_WORLD_PREFIX
- See Also:
-
GAME_MODEL_LABEL
-
NAME_LABEL
-
EXPERIMENTS_LABEL
-
ALLOW_COMMANDS_INFO
-
PREPARING_WORLD_DATA
-
HORIZONTAL_BUTTON_SPACING
private static final int HORIZONTAL_BUTTON_SPACING- See Also:
-
VERTICAL_BUTTON_SPACING
private static final int VERTICAL_BUTTON_SPACING- See Also:
-
TAB_HEADER_BACKGROUND
-
layout
-
uiState
-
tabManager
-
recreated
private boolean recreated -
packValidator
-
lastScreen
-
tempDataPackDir
-
tempDataPackRepository
-
-
Constructor Details
-
CreateWorldScreen
private CreateWorldScreen(Minecraft minecraft, @Nullable Screen lastScreen, WorldCreationContext settings, Optional<ResourceKey<WorldPreset>> preset, OptionalLong seed)
-
-
Method Details
-
openFresh
-
createFromExisting
public static CreateWorldScreen createFromExisting(Minecraft minecraft, @Nullable Screen lastScreen, LevelSettings levelSettings, WorldCreationContext settings, @Nullable Path tempDataPackDir) -
getUiState
-
init
protected void init() -
setInitialFocus
protected void setInitialFocus()- Overrides:
setInitialFocusin classScreen
-
repositionElements
public void repositionElements()- Overrides:
repositionElementsin classScreen
-
queueLoadScreen
-
onCreate
private void onCreate() -
createNewWorld
private void createNewWorld(PrimaryLevelData.SpecialWorldProperty specialWorldProperty, LayeredRegistryAccess<RegistryLayer> p_249152_, com.mojang.serialization.Lifecycle worldGenSettingsLifecycle) -
createLevelSettings
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.- Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classScreen- Parameters:
keyCode- the key code of the pressed key.scanCode- the scan code of the pressed key.modifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
onClose
public void onClose() -
popScreen
public void popScreen() -
render
Renders the graphical user interface (GUI) element.- Specified by:
renderin interfaceRenderable- Overrides:
renderin classScreen- Parameters:
guiGraphics- the GuiGraphics object used for rendering.mouseX- the x-coordinate of the mouse cursor.mouseY- the y-coordinate of the mouse cursor.partialTick- the partial tick time.
-
renderMenuBackground
- Overrides:
renderMenuBackgroundin classScreen
-
addWidget
-
addRenderableWidget
protected <T extends GuiEventListener & Renderable & NarratableEntry> T addRenderableWidget(T widget) - Overrides:
addRenderableWidgetin classScreen
-
getTempDataPackDir
-
openExperimentsScreen
-
openDataPackSelectionScreen
-
tryApplyNewDataPacks
private void tryApplyNewDataPacks(PackRepository packRepository, boolean shouldConfirm, Consumer<WorldDataConfiguration> consumer) -
applyNewPackConfig
private void applyNewPackConfig(PackRepository packRepository, WorldDataConfiguration worldDataConfiguration, Consumer<WorldDataConfiguration> consumer) -
createDefaultLoadConfig
private static WorldLoader.InitConfig createDefaultLoadConfig(PackRepository packRepository, WorldDataConfiguration initialDataConfig) -
removeTempDataPackDir
private void removeTempDataPackDir() -
copyBetweenDirs
-
createNewWorldDirectory
-
createTempDataPackDirFromExistingWorld
-
getDataPackSelectionSettings
@Nullable private com.mojang.datafixers.util.Pair<Path,PackRepository> getDataPackSelectionSettings(WorldDataConfiguration worldDataConfiguration)
-