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) class
Nested 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 Component
private static final int
private static final int
private final Screen
private final HeaderAndFooterLayout
private static final org.slf4j.Logger
(package private) static final Component
private final DirectoryValidator
private static final Component
private boolean
private static final int
static final ResourceLocation
private final TabManager
private TabNavigationBar
private static final String
private Path
private PackRepository
(package private) final WorldCreationUiState
private static final int
Fields 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, width
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
CreateWorldScreen
(Minecraft pMinecraft, Screen pLastScreen, WorldCreationContext pSettings, Optional<ResourceKey<WorldPreset>> pPreset, OptionalLong pSeed) -
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends GuiEventListener & Renderable & NarratableEntry>
TaddRenderableWidget
(T p_170199_) protected <T extends GuiEventListener & NarratableEntry>
TaddWidget
(T pListener) private void
applyNewPackConfig
(PackRepository pPackRepository, WorldDataConfiguration pWorldDataConfiguration, Consumer<WorldDataConfiguration> pConsumer) private static void
copyBetweenDirs
(Path pFromDir, Path pToDir, Path pFilePath) private static WorldLoader.InitConfig
createDefaultLoadConfig
(PackRepository pPackRepository, WorldDataConfiguration pInitialDataConfig) static CreateWorldScreen
createFromExisting
(Minecraft pMinecraft, Screen pLastScreen, LevelSettings pLevelSettings, WorldCreationContext pSettings, Path pTempDataPackDir) private LevelSettings
createLevelSettings
(boolean pDebug) private void
createNewWorld
(PrimaryLevelData.SpecialWorldProperty p_250577_, LayeredRegistryAccess<RegistryLayer> p_249152_, com.mojang.serialization.Lifecycle p_249994_) static Path
createTempDataPackDirFromExistingWorld
(Path pDatapackDir, Minecraft pMinecraft) private com.mojang.datafixers.util.Pair
<Path, PackRepository> private Path
protected void
init()
boolean
keyPressed
(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.void
onClose()
private void
onCreate()
(package private) void
(package private) void
openExperimentsScreen
(WorldDataConfiguration p_270214_) static void
void
private static void
queueLoadScreen
(Minecraft pMinecraft, Component pTitle) private void
void
render
(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) Renders the graphical user interface (GUI) element.protected void
renderMenuBackground
(GuiGraphics pPartialTick) void
protected void
private void
tryApplyNewDataPacks
(PackRepository pPackRepository, boolean pShouldConfirm, Consumer<WorldDataConfiguration> pConsumer) 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, wrapScreenError
Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocused
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocused
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMoved
Methods 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 pMinecraft, @Nullable Screen pLastScreen, WorldCreationContext pSettings, Optional<ResourceKey<WorldPreset>> pPreset, OptionalLong pSeed)
-
-
Method Details
-
openFresh
-
createFromExisting
public static CreateWorldScreen createFromExisting(Minecraft pMinecraft, @Nullable Screen pLastScreen, LevelSettings pLevelSettings, WorldCreationContext pSettings, @Nullable Path pTempDataPackDir) -
getUiState
-
init
protected void init() -
setInitialFocus
protected void setInitialFocus()- Overrides:
setInitialFocus
in classScreen
-
repositionElements
public void repositionElements()- Overrides:
repositionElements
in classScreen
-
queueLoadScreen
-
onCreate
private void onCreate() -
createNewWorld
private void createNewWorld(PrimaryLevelData.SpecialWorldProperty p_250577_, LayeredRegistryAccess<RegistryLayer> p_249152_, com.mojang.serialization.Lifecycle p_249994_) -
createLevelSettings
-
keyPressed
public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.- Specified by:
keyPressed
in interfaceContainerEventHandler
- Specified by:
keyPressed
in interfaceGuiEventListener
- Overrides:
keyPressed
in classScreen
- Parameters:
pKeyCode
- the key code of the pressed key.pScanCode
- the scan code of the pressed key.pModifiers
- the keyboard modifiers.- Returns:
true
if the event is consumed,false
otherwise.
-
onClose
public void onClose() -
popScreen
public void popScreen() -
render
Renders the graphical user interface (GUI) element.- Specified by:
render
in interfaceRenderable
- Overrides:
render
in classScreen
- Parameters:
pGuiGraphics
- the GuiGraphics object used for rendering.pMouseX
- the x-coordinate of the mouse cursor.pMouseY
- the y-coordinate of the mouse cursor.pPartialTick
- the partial tick time.
-
renderMenuBackground
- Overrides:
renderMenuBackground
in classScreen
-
addWidget
-
addRenderableWidget
protected <T extends GuiEventListener & Renderable & NarratableEntry> T addRenderableWidget(T p_170199_) - Overrides:
addRenderableWidget
in classScreen
-
getTempDataPackDir
-
openExperimentsScreen
-
openDataPackSelectionScreen
-
tryApplyNewDataPacks
private void tryApplyNewDataPacks(PackRepository pPackRepository, boolean pShouldConfirm, Consumer<WorldDataConfiguration> pConsumer) -
applyNewPackConfig
private void applyNewPackConfig(PackRepository pPackRepository, WorldDataConfiguration pWorldDataConfiguration, Consumer<WorldDataConfiguration> pConsumer) -
createDefaultLoadConfig
private static WorldLoader.InitConfig createDefaultLoadConfig(PackRepository pPackRepository, WorldDataConfiguration pInitialDataConfig) -
removeTempDataPackDir
private void removeTempDataPackDir() -
copyBetweenDirs
-
createNewWorldDirectory
-
createTempDataPackDirFromExistingWorld
-
getDataPackSelectionSettings
@Nullable private com.mojang.datafixers.util.Pair<Path,PackRepository> getDataPackSelectionSettings(WorldDataConfiguration p_268328_)
-