[Feature] Additional UI Config Options for Nether BiomeSource on the Customize World Screen (quiqueck/BetterNether#62)
This commit is contained in:
parent
42be3dd2c7
commit
1e968fafc7
4 changed files with 50 additions and 3 deletions
|
@ -86,6 +86,9 @@ public class BCLNetherBiomeSourceConfig implements BiomeSourceConfig<BCLibNether
|
|||
public String toString() {
|
||||
return "BCLibNetherBiomeSourceConfig{" +
|
||||
"mapVersion=" + mapVersion +
|
||||
", useVerticalBiomes=" + useVerticalBiomes +
|
||||
", biomeSize=" + biomeSize +
|
||||
", biomeSizeVertical=" + biomeSizeVertical +
|
||||
'}';
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,8 @@ import org.jetbrains.annotations.Nullable;
|
|||
public class WorldSetupScreen extends LayoutScreen {
|
||||
private final WorldCreationContext context;
|
||||
private final CreateWorldScreen createWorldScreen;
|
||||
private Range<Integer> netherBiomeSize;
|
||||
private Range<Integer> netherVerticalBiomeSize;
|
||||
private Range<Integer> landBiomeSize;
|
||||
private Range<Integer> voidBiomeSize;
|
||||
private Range<Integer> centerBiomeSize;
|
||||
|
@ -58,6 +60,7 @@ public class WorldSetupScreen extends LayoutScreen {
|
|||
Checkbox endCustomTerrain;
|
||||
Checkbox generateEndVoid;
|
||||
Checkbox netherLegacy;
|
||||
Checkbox netherVertical;
|
||||
|
||||
public LayoutComponent<?, ?> netherPage(BCLNetherBiomeSourceConfig netherConfig) {
|
||||
VerticalStack content = new VerticalStack(fill(), fit()).centerHorizontal();
|
||||
|
@ -75,9 +78,44 @@ public class WorldSetupScreen extends LayoutScreen {
|
|||
netherConfig.mapVersion == BCLNetherBiomeSourceConfig.NetherBiomeMapType.SQUARE
|
||||
);
|
||||
|
||||
netherVertical = content.indent(20).addCheckbox(
|
||||
fit(), fit(),
|
||||
Component.translatable("title.screen.bclib.worldgen.nether_vertical"),
|
||||
netherConfig.useVerticalBiomes
|
||||
);
|
||||
|
||||
content.addSpacer(12);
|
||||
content.addText(fit(), fit(), Component.translatable("title.screen.bclib.worldgen.avg_biome_size"))
|
||||
.centerHorizontal();
|
||||
content.addHorizontalSeparator(8).alignTop();
|
||||
|
||||
netherBiomeSize = content.addRange(
|
||||
fixed(200),
|
||||
fit(),
|
||||
Component.translatable("title.screen.bclib.worldgen.nether_biome_size"),
|
||||
1,
|
||||
512,
|
||||
netherConfig.biomeSize / 16
|
||||
);
|
||||
|
||||
netherVerticalBiomeSize = content.addRange(
|
||||
fixed(200),
|
||||
fit(),
|
||||
Component.translatable("title.screen.bclib.worldgen.nether_vertical_biome_size"),
|
||||
1,
|
||||
32,
|
||||
netherConfig.biomeSizeVertical / 16
|
||||
);
|
||||
|
||||
bclibNether.onChange((cb, state) -> {
|
||||
netherLegacy.setEnabled(state);
|
||||
netherVertical.setEnabled(state);
|
||||
netherBiomeSize.setEnabled(state);
|
||||
netherVerticalBiomeSize.setEnabled(state && netherVertical.isChecked());
|
||||
});
|
||||
|
||||
netherVertical.onChange((cb, state) -> {
|
||||
netherVerticalBiomeSize.setEnabled(state && bclibNether.isChecked());
|
||||
});
|
||||
|
||||
content.addSpacer(8);
|
||||
|
@ -231,9 +269,9 @@ public class WorldSetupScreen extends LayoutScreen {
|
|||
netherLegacy.isChecked()
|
||||
? BCLNetherBiomeSourceConfig.NetherBiomeMapType.SQUARE
|
||||
: BCLNetherBiomeSourceConfig.NetherBiomeMapType.HEX,
|
||||
BCLNetherBiomeSourceConfig.DEFAULT.biomeSize,
|
||||
BCLNetherBiomeSourceConfig.DEFAULT.biomeSizeVertical,
|
||||
BCLNetherBiomeSourceConfig.DEFAULT.useVerticalBiomes
|
||||
netherBiomeSize.getValue() * 16,
|
||||
netherVerticalBiomeSize.getValue() * 16,
|
||||
netherVertical.isChecked()
|
||||
);
|
||||
|
||||
ChunkGenerator netherGenerator = betterxDimensions.get(LevelStem.NETHER);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue