Prepared World customization Screen

This commit is contained in:
Frank 2022-05-22 17:59:37 +02:00
parent 7359c64fff
commit f45eaddde6

View file

@ -3,6 +3,7 @@ package org.betterx.bclib.gui.worldgen;
import net.minecraft.client.gui.screens.worldselection.CreateWorldScreen;
import net.minecraft.client.gui.screens.worldselection.WorldCreationContext;
import net.minecraft.core.Registry;
import net.minecraft.network.chat.CommonComponents;
import net.minecraft.network.chat.Component;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.FlatLevelSource;
@ -13,6 +14,7 @@ import net.minecraft.world.level.levelgen.structure.StructureSet;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import org.betterx.bclib.gui.gridlayout.GridLayout;
import org.betterx.bclib.gui.gridlayout.GridScreen;
import org.jetbrains.annotations.Nullable;
@ -30,7 +32,27 @@ public class WorldSetupScreen extends GridScreen {
@Override
protected void initLayout() {
final int BUTTON_HEIGHT = 20;
grid.addSpacerRow();
var row = grid.addRow();
var colNether = row.addColumn(0.5, GridLayout.GridValueType.PERCENTAGE);
var colEnd = row.addColumn(0.5, GridLayout.GridValueType.PERCENTAGE);
row = colNether.addRow(GridLayout.VerticalAlignment.CENTER);
row.addString(Component.literal("The Nether"), GridLayout.Alignment.CENTER, this);
row = colEnd.addRow(GridLayout.VerticalAlignment.CENTER);
row.addString(Component.literal("The End"), GridLayout.Alignment.CENTER, this);
grid.addSpacerRow(15);
row = grid.addRow();
row.addFiller();
row.addButton(CommonComponents.GUI_DONE, BUTTON_HEIGHT, font, (button) -> {
//TODO: update settings
onClose();
});
grid.addSpacerRow(10);
}
private void updateSettings() {