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) 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 Componentprivate final CreateWorldCallback(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 pMinecraft, Screen pLastScreen, WorldCreationContext pContext, Optional<ResourceKey<WorldPreset>> pPreset, OptionalLong pSeed, CreateWorldCallback pCreateWorldCallback) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidapplyNewPackConfig(PackRepository pPackRepository, WorldDataConfiguration pWorldDataConfiguration, Consumer<WorldDataConfiguration> pCallback) private static voidcopyBetweenDirs(Path pFromDir, Path pToDir, Path pFilePath) private static WorldLoader.InitConfigcreateDefaultLoadConfig(PackRepository pPackRepository, WorldDataConfiguration pInitialDataConfig) static CreateWorldScreencreateFromExisting(Minecraft pMinecraft, Screen pLastScreen, LevelSettings pLevelSettings, WorldCreationContext pContext, Path pTempDataPackDir) private LevelSettingscreateLevelSettings(boolean pDebug) private booleancreateNewWorld(LayeredRegistryAccess<RegistryLayer> pRegistryAccess, WorldData pWorldData) private static Optional<LevelStorageSource.LevelStorageAccess> createNewWorldDirectory(Minecraft pMinecraft, String pSaveName, Path pTempDataPackDir) static PathcreateTempDataPackDirFromExistingWorld(Path pDatapackDir, Minecraft pMinecraft) private voidcreateWorldAndCleanup(LayeredRegistryAccess<RegistryLayer> pRegistryAccess, PrimaryLevelData pLevelData) private com.mojang.datafixers.util.Pair<Path, PackRepository> getDataPackSelectionSettings(WorldDataConfiguration pWorldDataConfiguration) private Pathprotected voidinit()booleankeyPressed(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.voidonClose()private voidonCreate()private static voidopenCreateWorldScreen(Minecraft pMinecraft, Screen pLastScreen, Function<WorldLoader.DataLoadContext, WorldGenSettings> pWorldGenSettingsGetter, WorldCreationContextMapper pCreationContextMapper, ResourceKey<WorldPreset> pPreset, CreateWorldCallback pCreateWorldCallback) (package private) voidopenDataPackSelectionScreen(WorldDataConfiguration pWorldDataConfiguration) (package private) voidopenExperimentsScreen(WorldDataConfiguration pWorldDataConfiguration) static voidstatic voidopenFresh(Minecraft pMinecraft, Screen pLastScreen, CreateWorldCallback pCallback) voidprivate static voidqueueLoadScreen(Minecraft pMinecraft, Component pTitle) private voidvoidrender(GuiGraphics p_282137_, int p_283640_, int p_281243_, float p_282743_) Neo: mixins targeting this method won't fire for container screens asAbstractContainerScreen.render(net.minecraft.client.gui.GuiGraphics, int, int, float)replicates this method in place of a super call to insert an eventprotected voidrenderMenuBackground(GuiGraphics p_331389_) voidprotected voidstatic voidprivate voidtryApplyNewDataPacks(PackRepository pPackRepository, boolean pShouldConfirm, Consumer<WorldDataConfiguration> pCallback) Methods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearTooltipForNextRenderPass, clearWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, 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, showsActiveEffects, tick, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatusMethods 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
getBorderForArrowNavigation, 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
-
createWorldCallback
-
lastScreen
-
tempDataPackDir
-
tempDataPackRepository
-
-
Constructor Details
-
CreateWorldScreen
private CreateWorldScreen(Minecraft pMinecraft, @Nullable Screen pLastScreen, WorldCreationContext pContext, Optional<ResourceKey<WorldPreset>> pPreset, OptionalLong pSeed, CreateWorldCallback pCreateWorldCallback)
-
-
Method Details
-
openFresh
-
openFresh
public static void openFresh(Minecraft pMinecraft, @Nullable Screen pLastScreen, CreateWorldCallback pCallback) -
testWorld
-
openCreateWorldScreen
private static void openCreateWorldScreen(Minecraft pMinecraft, @Nullable Screen pLastScreen, Function<WorldLoader.DataLoadContext, WorldGenSettings> pWorldGenSettingsGetter, WorldCreationContextMapper pCreationContextMapper, ResourceKey<WorldPreset> pPreset, CreateWorldCallback pCreateWorldCallback) -
createFromExisting
public static CreateWorldScreen createFromExisting(Minecraft pMinecraft, @Nullable Screen pLastScreen, LevelSettings pLevelSettings, WorldCreationContext pContext, @Nullable Path pTempDataPackDir) -
getUiState
-
init
protected void 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> pRegistryAccess, PrimaryLevelData pLevelData) -
createNewWorld
private boolean createNewWorld(LayeredRegistryAccess<RegistryLayer> pRegistryAccess, WorldData pWorldData) -
createLevelSettings
-
keyPressed
public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) Description copied from interface:ContainerEventHandlerCalled when a keyboard key is pressed within the GUI element.- Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classScreen- Parameters:
pKeyCode- the key code of the pressed key.pScanCode- the scan code of the pressed key.pModifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
onClose
public void onClose() -
popScreen
public void popScreen() -
render
Description copied from class:ScreenNeo: mixins targeting this method won't fire for container screens asAbstractContainerScreen.render(net.minecraft.client.gui.GuiGraphics, int, int, float)replicates this method in place of a super call to insert an event- Specified by:
renderin interfaceRenderable- Overrides:
renderin classScreen- Parameters:
p_282137_- the GuiGraphics object used for rendering.p_283640_- the x-coordinate of the mouse cursor.p_281243_- the y-coordinate of the mouse cursor.p_282743_- the partial tick time.
-
renderMenuBackground
- Overrides:
renderMenuBackgroundin classScreen
-
getOrCreateTempDataPackDir
-
openExperimentsScreen
-
openDataPackSelectionScreen
-
tryApplyNewDataPacks
private void tryApplyNewDataPacks(PackRepository pPackRepository, boolean pShouldConfirm, Consumer<WorldDataConfiguration> pCallback) -
applyNewPackConfig
private void applyNewPackConfig(PackRepository pPackRepository, WorldDataConfiguration pWorldDataConfiguration, Consumer<WorldDataConfiguration> pCallback) -
createDefaultLoadConfig
private static WorldLoader.InitConfig createDefaultLoadConfig(PackRepository pPackRepository, WorldDataConfiguration pInitialDataConfig) -
removeTempDataPackDir
private void removeTempDataPackDir() -
copyBetweenDirs
-
createNewWorldDirectory
private static Optional<LevelStorageSource.LevelStorageAccess> createNewWorldDirectory(Minecraft pMinecraft, String pSaveName, @Nullable Path pTempDataPackDir) -
createTempDataPackDirFromExistingWorld
-
getDataPackSelectionSettings
@Nullable private com.mojang.datafixers.util.Pair<Path,PackRepository> getDataPackSelectionSettings(WorldDataConfiguration pWorldDataConfiguration)
-