Package net.minecraft.client.gui.screen
Class PresetsScreen
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.screen.Screen
net.minecraft.client.gui.screen.PresetsScreen
- All Implemented Interfaces:
Drawable,Element,ParentElement,TickableElement
@Environment(CLIENT) public class PresetsScreen extends Screen
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classPresetsScreen.SuperflatPreset(package private) classPresetsScreen.SuperflatPresetsListWidget -
Field Summary
Fields Modifier and Type Field Description private FlatChunkGeneratorConfigconfigprivate TextFieldWidgetcustomPresetFieldprivate TextlistTextprivate PresetsScreen.SuperflatPresetsListWidgetlistWidgetprivate static LoggerLOGGERprivate CustomizeFlatLevelScreenparentprivate static List<PresetsScreen.SuperflatPreset>PRESETSprivate ButtonWidgetselectPresetButtonprivate TextshareTextFields inherited from class net.minecraft.client.gui.screen.Screen
buttons, children, client, height, itemRenderer, passEvents, textRenderer, title, widthFields inherited from class net.minecraft.client.gui.DrawableHelper
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE -
Constructor Summary
Constructors Constructor Description PresetsScreen(CustomizeFlatLevelScreen parent) -
Method Summary
Modifier and Type Method Description private static voidaddPreset(Text presetName, ItemConvertible icon, RegistryKey<Biome> presetBiome, List<StructureFeature<?>> structures, boolean generateStronghold, boolean generateFeatures, boolean generateLakes, FlatChunkGeneratorLayer[] layers)private static StringgetGeneratorConfigString(Registry<Biome> biomeRegistry, FlatChunkGeneratorConfig generatorConfig)protected voidinit()Called when a screen should be initialized.booleanmouseScrolled(double mouseX, double mouseY, double amount)Callback for when a mouse button scroll event has been captured.voidonClose()private static FlatChunkGeneratorLayerparseLayerString(String layer, int layerStartHeight)Parse a string like"60*minecraft:stone"to aFlatChunkGeneratorLayer.private static List<FlatChunkGeneratorLayer>parsePresetLayersString(String layers)Parse a string like"minecraft:bedrock,3*minecraft:dirt,minecraft:grass_block"to a list ofFlatChunkGeneratorLayer.static FlatChunkGeneratorConfigparsePresetString(Registry<Biome> biomeRegistry, String preset, FlatChunkGeneratorConfig generatorConfig)voidremoved()voidrender(MatrixStack matrices, int mouseX, int mouseY, float delta)voidresize(MinecraftClient client, int width, int height)voidtick()voidupdateSelectButton(boolean hasSelected)Methods inherited from class net.minecraft.client.gui.screen.Screen
addButton, addChild, children, filesDragged, getNarrationMessage, getTitle, getTooltipFromItem, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, keyPressed, renderBackground, renderBackground, renderBackgroundTexture, renderOrderedTooltip, renderTextHoverEffect, renderTooltip, renderTooltip, renderTooltip, sendMessage, sendMessage, shouldCloseOnEsc, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.AbstractParentElement
getFocused, isDragging, setDragging, setFocusedMethods inherited from class net.minecraft.client.gui.DrawableHelper
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffsetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.Element
mouseMovedMethods inherited from interface net.minecraft.client.gui.ParentElement
changeFocus, charTyped, focusOn, hoveredElement, keyReleased, mouseClicked, mouseDragged, mouseReleased, setInitialFocus
-
Field Details
-
LOGGER
-
PRESETS
-
parent
-
listText
-
listWidget
-
selectPresetButton
-
customPresetField
-
config
-
-
Constructor Details
-
PresetsScreen
-
-
Method Details
-
parseLayerString
@Nullable private static FlatChunkGeneratorLayer parseLayerString(String layer, int layerStartHeight)Parse a string like"60*minecraft:stone"to aFlatChunkGeneratorLayer. -
parsePresetLayersString
Parse a string like"minecraft:bedrock,3*minecraft:dirt,minecraft:grass_block"to a list ofFlatChunkGeneratorLayer. -
parsePresetString
public static FlatChunkGeneratorConfig parsePresetString(Registry<Biome> biomeRegistry, String preset, FlatChunkGeneratorConfig generatorConfig) -
getGeneratorConfigString
private static String getGeneratorConfigString(Registry<Biome> biomeRegistry, FlatChunkGeneratorConfig generatorConfig) -
init
protected void init()Called when a screen should be initialized.This method is called when this screen is
openedor resized. -
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double amount)Callback for when a mouse button scroll event has been captured.- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mouseamount- value is> 1if scrolled down,< 1if scrolled up- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Mouse.onMouseScroll(long, double, double)
-
resize
-
onClose
public void onClose() -
removed
public void removed() -
render
-
tick
public void tick()- Specified by:
tickin interfaceTickableElement- Overrides:
tickin classScreen
-
updateSelectButton
public void updateSelectButton(boolean hasSelected) -
addPreset
private static void addPreset(Text presetName, ItemConvertible icon, RegistryKey<Biome> presetBiome, List<StructureFeature<?>> structures, boolean generateStronghold, boolean generateFeatures, boolean generateLakes, FlatChunkGeneratorLayer[] layers)
-