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 TypeClassDescriptionprivate classprivate classprivate classNested classes/interfaces inherited from class Screen
Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Componentprivate final CreateWorldCallbackprivate static final Componentprivate static final Componentprivate static final intprivate static final intprivate final HeaderAndFooterLayoutprivate static final org.slf4j.Loggerprivate static final Componentprivate final Runnableprivate final DirectoryValidatorprivate static final Componentprivate booleanprivate static final intstatic final Identifierprivate final TabManagerprivate @Nullable TabNavigationBarprivate static final Stringprivate @Nullable Pathprivate @Nullable PackRepositoryprivate final WorldCreationUiStateprivate static final intFields 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
ConstructorsModifierConstructorDescriptionprivateCreateWorldScreen(Minecraft minecraft, Runnable onClose, WorldCreationContext settings, Optional<ResourceKey<WorldPreset>> preset, OptionalLong seed, CreateWorldCallback createWorldCallback) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidapplyNewPackConfig(PackRepository packRepository, WorldDataConfiguration newConfig, Consumer<WorldDataConfiguration> onAbort) private static voidcopyBetweenDirs(Path sourceDir, Path targetDir, Path sourcePath) private static WorldLoader.InitConfigcreateDefaultLoadConfig(PackRepository packRepository, WorldDataConfiguration config) static CreateWorldScreencreateFromExisting(Minecraft minecraft, Runnable onClose, LevelSettings levelSettings, WorldCreationContext worldCreationContext, @Nullable Path newDataPackDir) private LevelSettingscreateLevelSettings(boolean isDebug) private booleancreateNewWorld(LayeredRegistryAccess<RegistryLayer> finalLayers, LevelDataAndDimensions.WorldDataAndGenSettings worldDataAndGenSettings, Optional<GameRules> gameRules) private static Optional<LevelStorageSource.LevelStorageAccess> createNewWorldDirectory(Minecraft minecraft, String worldFolder, @Nullable Path tempDataPackDir) static PathcreateTempDataPackDirFromExistingWorld(Path sourcePackDir, Minecraft minecraft) private voidcreateWorldAndCleanup(LayeredRegistryAccess<RegistryLayer> finalLayers, LevelDataAndDimensions.WorldDataAndGenSettings worldDataAndGenSettings, Optional<GameRules> gameRules) private @Nullable com.mojang.datafixers.util.Pair<Path, PackRepository> getDataPackSelectionSettings(WorldDataConfiguration dataConfiguration) private @Nullable Pathprotected voidinit()booleankeyPressed(KeyEvent event) voidonClose()private voidonCreate()private static voidopenCreateWorldScreen(Minecraft minecraft, Runnable onClose, Function<WorldLoader.DataLoadContext, WorldGenSettings> worldGenSettings, WorldCreationContextMapper worldCreationContext, ResourceKey<WorldPreset> worldPreset, CreateWorldCallback createWorld) private voidopenDataPackSelectionScreen(WorldDataConfiguration dataConfiguration) private voidopenExperimentsScreen(WorldDataConfiguration dataConfiguration) static voidstatic voidopenFresh(Minecraft minecraft, Runnable onClose, CreateWorldCallback createWorld) voidprivate static voidqueueLoadScreen(Minecraft minecraft, Component message) private voidvoidrender(GuiGraphics graphics, int mouseX, int mouseY, float a) Renders the graphical user interface (GUI) element.protected voidrenderMenuBackground(GuiGraphics graphics) voidprotected voidstatic voidprivate voidtryApplyNewDataPacks(PackRepository packRepository, boolean isDataPackScreen, Consumer<WorldDataConfiguration> onAbort) Methods inherited from class Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, insertText, isAllowedInPortal, isInGameUi, isMouseOver, isPauseScreen, isValidCharacterForName, onFilesDrop, panoramaShouldSpin, rebuildWidgets, removed, removeWidget, renderBackground, renderBlurredBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltipAndSubtitles, resize, 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, setFocusedMethods inherited from interface GuiEventListener
mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface 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
-
createWorldCallback
-
onClose
-
tempDataPackDir
-
tempDataPackRepository
-
-
Constructor Details
-
CreateWorldScreen
private CreateWorldScreen(Minecraft minecraft, Runnable onClose, WorldCreationContext settings, Optional<ResourceKey<WorldPreset>> preset, OptionalLong seed, CreateWorldCallback createWorldCallback)
-
-
Method Details
-
openFresh
-
openFresh
public static void openFresh(Minecraft minecraft, Runnable onClose, CreateWorldCallback createWorld) -
testWorld
-
openCreateWorldScreen
private static void openCreateWorldScreen(Minecraft minecraft, Runnable onClose, Function<WorldLoader.DataLoadContext, WorldGenSettings> worldGenSettings, WorldCreationContextMapper worldCreationContext, ResourceKey<WorldPreset> worldPreset, CreateWorldCallback createWorld) -
createFromExisting
public static CreateWorldScreen createFromExisting(Minecraft minecraft, Runnable onClose, LevelSettings levelSettings, WorldCreationContext worldCreationContext, @Nullable Path newDataPackDir) -
getUiState
-
init
-
setInitialFocus
protected void setInitialFocus()- Overrides:
setInitialFocusin classScreen
-
repositionElements
public void repositionElements()- Overrides:
repositionElementsin classScreen
-
queueLoadScreen
-
onCreate
private void onCreate() -
createWorldAndCleanup
private void createWorldAndCleanup(LayeredRegistryAccess<RegistryLayer> finalLayers, LevelDataAndDimensions.WorldDataAndGenSettings worldDataAndGenSettings, Optional<GameRules> gameRules) -
createNewWorld
private boolean createNewWorld(LayeredRegistryAccess<RegistryLayer> finalLayers, LevelDataAndDimensions.WorldDataAndGenSettings worldDataAndGenSettings, Optional<GameRules> gameRules) -
createLevelSettings
-
keyPressed
- Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classScreen
-
onClose
-
popScreen
public void popScreen() -
render
Description copied from interface:RenderableRenders the graphical user interface (GUI) element.- Specified by:
renderin interfaceRenderable- Overrides:
renderin classScreen- Parameters:
graphics- the GuiGraphics object used for rendering.mouseX- the x-coordinate of the mouse cursor.mouseY- the y-coordinate of the mouse cursor.a- the partial tick time.
-
renderMenuBackground
- Overrides:
renderMenuBackgroundin classScreen
-
getOrCreateTempDataPackDir
-
openExperimentsScreen
-
openDataPackSelectionScreen
-
tryApplyNewDataPacks
private void tryApplyNewDataPacks(PackRepository packRepository, boolean isDataPackScreen, Consumer<WorldDataConfiguration> onAbort) -
applyNewPackConfig
private void applyNewPackConfig(PackRepository packRepository, WorldDataConfiguration newConfig, Consumer<WorldDataConfiguration> onAbort) -
createDefaultLoadConfig
private static WorldLoader.InitConfig createDefaultLoadConfig(PackRepository packRepository, WorldDataConfiguration config) -
removeTempDataPackDir
private void removeTempDataPackDir() -
copyBetweenDirs
-
createNewWorldDirectory
private static Optional<LevelStorageSource.LevelStorageAccess> createNewWorldDirectory(Minecraft minecraft, String worldFolder, @Nullable Path tempDataPackDir) -
createTempDataPackDirFromExistingWorld
-
getDataPackSelectionSettings
private @Nullable com.mojang.datafixers.util.Pair<Path, PackRepository> getDataPackSelectionSettings(WorldDataConfiguration dataConfiguration)
-