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 class
PresetsScreen.SuperflatPreset
(package private) class
PresetsScreen.SuperflatPresetsListWidget
-
Field Summary
Fields Modifier and Type Field Description private FlatChunkGeneratorConfig
config
private TextFieldWidget
customPresetField
private Text
listText
private PresetsScreen.SuperflatPresetsListWidget
listWidget
private static Logger
LOGGER
private CustomizeFlatLevelScreen
parent
private static List<PresetsScreen.SuperflatPreset>
PRESETS
private ButtonWidget
selectPresetButton
private Text
shareText
Fields inherited from class net.minecraft.client.gui.screen.Screen
buttons, children, client, height, itemRenderer, passEvents, textRenderer, title, width
Fields 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 void
addPreset(Text presetName, ItemConvertible icon, RegistryKey<Biome> presetBiome, List<StructureFeature<?>> structures, boolean generateStronghold, boolean generateFeatures, boolean generateLakes, FlatChunkGeneratorLayer[] layers)
private static String
getGeneratorConfigString(Registry<Biome> biomeRegistry, FlatChunkGeneratorConfig generatorConfig)
protected void
init()
Called when a screen should be initialized.boolean
mouseScrolled(double mouseX, double mouseY, double amount)
Callback for when a mouse button scroll event has been captured.void
onClose()
private static FlatChunkGeneratorLayer
parseLayerString(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 FlatChunkGeneratorConfig
parsePresetString(Registry<Biome> biomeRegistry, String preset, FlatChunkGeneratorConfig generatorConfig)
void
removed()
void
render(MatrixStack matrices, int mouseX, int mouseY, float delta)
void
resize(MinecraftClient client, int width, int height)
void
tick()
void
updateSelectButton(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, wrapScreenError
Methods inherited from class net.minecraft.client.gui.AbstractParentElement
getFocused, isDragging, setDragging, setFocused
Methods 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, setZOffset
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.Element
mouseMoved
Methods 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
opened
or 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> 1
if scrolled down,< 1
if scrolled up- Returns:
true
to 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:
tick
in interfaceTickableElement
- Overrides:
tick
in 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)
-