From dd0c259b56c18ea280c49acff512d8a0cce27e7a Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 22 May 2022 22:44:09 +0200 Subject: [PATCH] Functional WorldSetupScreen --- .../betterx/bclib/gui/gridlayout/GridRow.java | 117 +++++++++--------- .../bclib/gui/screens/WorldSetupScreen.java | 71 ++++++----- .../common/WorldPresetsBootstrapMixin.java | 6 +- .../presets/worldgen/BCLChunkGenerator.java | 28 ++--- .../bclib/presets/worldgen/WorldPresets.java | 60 +++++++++ .../bclib/world/generator/BCLBiomeSource.java | 18 ++- .../world/generator/BCLibEndBiomeSource.java | 3 +- .../generator/BCLibNetherBiomeSource.java | 3 +- src/main/resources/bclib.accesswidener | 3 + 9 files changed, 197 insertions(+), 112 deletions(-) diff --git a/src/main/java/org/betterx/bclib/gui/gridlayout/GridRow.java b/src/main/java/org/betterx/bclib/gui/gridlayout/GridRow.java index 2838ab45..bf315885 100644 --- a/src/main/java/org/betterx/bclib/gui/gridlayout/GridRow.java +++ b/src/main/java/org/betterx/bclib/gui/gridlayout/GridRow.java @@ -90,11 +90,11 @@ public class GridRow extends GridContainer { OnPress onPress) { GridCell cell = new GridCell(width, height, widthType, (transform) -> { Button customButton = new Button(transform.left, - transform.top, - transform.width, - transform.height, - text, - onPress); + transform.top, + transform.width, + transform.height, + text, + onPress); customButton.setAlpha(alpha); return customButton; }, null); @@ -104,6 +104,11 @@ public class GridRow extends GridContainer { public GridCheckboxCell addCheckbox(Component text, boolean checked, Font font, Consumer onChange) { final int width = font.width(text.getVisualOrderText()) + 24 + 2 * 12; + return addCheckbox(text, checked, width, widthType, onChange); + } + + public GridCheckboxCell addCheckbox(Component text, boolean checked, double width, + GridLayout.GridValueType widthType, Consumer onChange) { GridCheckboxCell cell = new GridCheckboxCell(text, checked, 1.0f, width, widthType, 20, onChange); this.cells.add(cell); @@ -157,16 +162,16 @@ public class GridRow extends GridContainer { public GridCell addImage(ResourceLocation location, float alpha, int width, int height) { return addImage(location, - alpha, - width, - GridLayout.GridValueType.CONSTANT, - height, - 0, - 0, - width, - height, - width, - height); + alpha, + width, + GridLayout.GridValueType.CONSTANT, + height, + 0, + 0, + width, + height, + width, + height); } public GridCell addImage(ResourceLocation location, @@ -186,16 +191,16 @@ public class GridRow extends GridContainer { int resourceWidth, int resourceHeight) { return addImage(location, - alpha, - width, - widthType, - height, - 0, - 0, - resourceWidth, - resourceWidth, - resourceWidth, - resourceHeight); + alpha, + width, + widthType, + height, + 0, + 0, + resourceWidth, + resourceWidth, + resourceWidth, + resourceHeight); } public GridCell addImage(ResourceLocation location, @@ -209,16 +214,16 @@ public class GridRow extends GridContainer { int resourceWidth, int resourceHeight) { return addImage(location, - 1.0f, - width, - widthType, - height, - uvLeft, - uvTop, - uvWidth, - uvHeight, - resourceWidth, - resourceHeight); + 1.0f, + width, + widthType, + height, + uvLeft, + uvTop, + uvWidth, + uvHeight, + resourceWidth, + resourceHeight); } public GridCell addImage(ResourceLocation location, @@ -233,16 +238,16 @@ public class GridRow extends GridContainer { int resourceWidth, int resourceHeight) { GridCell cell = new GridImageCell(location, - width, - widthType, - height, - alpha, - uvLeft, - uvTop, - uvWidth, - uvHeight, - resourceWidth, - resourceHeight); + width, + widthType, + height, + alpha, + uvLeft, + uvTop, + uvWidth, + uvHeight, + resourceWidth, + resourceHeight); this.cells.add(cell); return cell; } @@ -303,11 +308,11 @@ public class GridRow extends GridContainer { public GridStringCell addString(Component text, int color, GridScreen parent) { final int width = parent.getWidth(text); return this.addString(text, - width, - GridLayout.GridValueType.CONSTANT, - color, - GridLayout.Alignment.CENTER, - parent); + width, + GridLayout.GridValueType.CONSTANT, + color, + GridLayout.Alignment.CENTER, + parent); } public GridStringCell addString(Component text, GridLayout.Alignment contentAlignment, GridScreen parent) { @@ -336,12 +341,12 @@ public class GridRow extends GridContainer { GridLayout.Alignment contentAlignment, GridScreen parent) { GridStringCell cell = new GridStringCell(width, - widthType, - parent.getFont().lineHeight, - contentAlignment, - parent, - text, - color); + widthType, + parent.getFont().lineHeight, + contentAlignment, + parent, + text, + color); this.cells.add(cell); return cell; } diff --git a/src/main/java/org/betterx/bclib/gui/screens/WorldSetupScreen.java b/src/main/java/org/betterx/bclib/gui/screens/WorldSetupScreen.java index e20da93b..1d5d9c2e 100644 --- a/src/main/java/org/betterx/bclib/gui/screens/WorldSetupScreen.java +++ b/src/main/java/org/betterx/bclib/gui/screens/WorldSetupScreen.java @@ -2,15 +2,12 @@ package org.betterx.bclib.gui.screens; 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.resources.ResourceKey; +import net.minecraft.world.level.dimension.BuiltinDimensionTypes; +import net.minecraft.world.level.dimension.DimensionType; import net.minecraft.world.level.dimension.LevelStem; -import net.minecraft.world.level.levelgen.FlatLevelSource; -import net.minecraft.world.level.levelgen.WorldGenSettings; -import net.minecraft.world.level.levelgen.flat.FlatLevelGeneratorSettings; -import net.minecraft.world.level.levelgen.structure.StructureSet; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; @@ -19,6 +16,8 @@ import org.betterx.bclib.BCLib; import org.betterx.bclib.gui.gridlayout.GridCheckboxCell; import org.betterx.bclib.gui.gridlayout.GridLayout; import org.betterx.bclib.presets.worldgen.BCLChunkGenerator; +import org.betterx.bclib.presets.worldgen.WorldPresets; +import org.betterx.bclib.world.generator.BCLBiomeSource; import org.jetbrains.annotations.Nullable; @@ -72,14 +71,16 @@ public class WorldSetupScreen extends BCLibScreen { row = colNether.addRow(); row.addSpacer(32); netherLegacy = row.addCheckbox(Component.translatable("title.screen.bclib.worldgen.legacy_square"), - endVersion == BCLChunkGenerator.BIOME_SOURCE_VERSION_SQUARE, - font, + endVersion == BCLBiomeSource.BIOME_SOURCE_VERSION_SQUARE, + 1.0, + GridLayout.GridValueType.PERCENTAGE, (state) -> { }); bclibNether = mainSettingsRow.addCheckbox(Component.translatable( "title.screen.bclib.worldgen.custom_biome_source"), - netherVersion != BCLChunkGenerator.BIOME_SOURCE_VERSION_VANILLA, - font, + netherVersion != BCLBiomeSource.BIOME_SOURCE_VERSION_VANILLA, + 1.0, + GridLayout.GridValueType.PERCENTAGE, (state) -> { netherLegacy.setEnabled(state); }); @@ -95,15 +96,17 @@ public class WorldSetupScreen extends BCLibScreen { row.addSpacer(32); endLegacy = row.addCheckbox(Component.translatable("title.screen.bclib.worldgen.legacy_square"), - endVersion == BCLChunkGenerator.BIOME_SOURCE_VERSION_SQUARE, - font, + endVersion == BCLBiomeSource.BIOME_SOURCE_VERSION_SQUARE, + 1.0, + GridLayout.GridValueType.PERCENTAGE, (state) -> { }); bclibEnd = mainSettingsRow.addCheckbox(Component.translatable( "title.screen.bclib.worldgen.custom_biome_source"), - endVersion != BCLChunkGenerator.BIOME_SOURCE_VERSION_VANILLA, - font, + endVersion != BCLBiomeSource.BIOME_SOURCE_VERSION_VANILLA, + 1.0, + GridLayout.GridValueType.PERCENTAGE, (state) -> { endLegacy.setEnabled(state); }); @@ -119,31 +122,43 @@ public class WorldSetupScreen extends BCLibScreen { } private void updateSettings() { - int endVersion = BCLChunkGenerator.DEFAULT_BIOME_SOURCE_VERSION; + int endVersion = BCLBiomeSource.DEFAULT_BIOME_SOURCE_VERSION; if (bclibEnd.isChecked()) { - if (endLegacy.isChecked()) endVersion = BCLChunkGenerator.BIOME_SOURCE_VERSION_SQUARE; - else endVersion = BCLChunkGenerator.BIOME_SOURCE_VERSION_HEX; + if (endLegacy.isChecked()) endVersion = BCLBiomeSource.BIOME_SOURCE_VERSION_SQUARE; + else endVersion = BCLBiomeSource.BIOME_SOURCE_VERSION_HEX; } else { - endVersion = BCLChunkGenerator.BIOME_SOURCE_VERSION_VANILLA; + endVersion = BCLBiomeSource.BIOME_SOURCE_VERSION_VANILLA; } - int netherVersion = BCLChunkGenerator.DEFAULT_BIOME_SOURCE_VERSION; + int netherVersion = BCLBiomeSource.DEFAULT_BIOME_SOURCE_VERSION; if (bclibNether.isChecked()) { - if (netherLegacy.isChecked()) netherVersion = BCLChunkGenerator.BIOME_SOURCE_VERSION_SQUARE; - else netherVersion = BCLChunkGenerator.BIOME_SOURCE_VERSION_HEX; + if (netherLegacy.isChecked()) netherVersion = BCLBiomeSource.BIOME_SOURCE_VERSION_SQUARE; + else netherVersion = BCLBiomeSource.BIOME_SOURCE_VERSION_HEX; } else { - netherVersion = BCLChunkGenerator.BIOME_SOURCE_VERSION_VANILLA; + netherVersion = BCLBiomeSource.BIOME_SOURCE_VERSION_VANILLA; } BCLib.LOGGER.info("Custom World Versions: end=" + endVersion + ", nether=" + netherVersion); + updateConfiguration(LevelStem.END, BuiltinDimensionTypes.END, endVersion); + updateConfiguration(LevelStem.NETHER, BuiltinDimensionTypes.NETHER, netherVersion); } - private WorldCreationContext.Updater worldConfiguration(FlatLevelGeneratorSettings flatLevelGeneratorSettings) { - return (frozen, worldGenSettings) -> { - Registry registry = frozen.registryOrThrow(Registry.STRUCTURE_SET_REGISTRY); - ChunkGenerator chunkGenerator = new FlatLevelSource(registry, flatLevelGeneratorSettings); - return WorldGenSettings.replaceOverworldGenerator(frozen, worldGenSettings, chunkGenerator); - }; + private void updateConfiguration( + ResourceKey dimensionKey, + ResourceKey dimensionTypeKey, + int biomeSourceVersion + ) { + createWorldScreen.worldGenSettingsComponent.updateSettings( + (registryAccess, worldGenSettings) -> WorldPresets.replaceGenerator( + dimensionKey, + dimensionTypeKey, + biomeSourceVersion, + registryAccess, + worldGenSettings + ) + ); } + + } diff --git a/src/main/java/org/betterx/bclib/mixin/common/WorldPresetsBootstrapMixin.java b/src/main/java/org/betterx/bclib/mixin/common/WorldPresetsBootstrapMixin.java index cb194357..0ff95234 100644 --- a/src/main/java/org/betterx/bclib/mixin/common/WorldPresetsBootstrapMixin.java +++ b/src/main/java/org/betterx/bclib/mixin/common/WorldPresetsBootstrapMixin.java @@ -12,7 +12,7 @@ import net.minecraft.world.level.levelgen.presets.WorldPresets; import net.minecraft.world.level.levelgen.structure.StructureSet; import net.minecraft.world.level.levelgen.synth.NormalNoise; -import org.betterx.bclib.presets.worldgen.BCLChunkGenerator; +import org.betterx.bclib.world.generator.BCLBiomeSource; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -82,14 +82,14 @@ public abstract class WorldPresetsBootstrapMixin { this.structureSets, this.noises, this.netherNoiseSettings, - Optional.of(BCLChunkGenerator.BIOME_SOURCE_VERSION_SQUARE)), + Optional.of(BCLBiomeSource.BIOME_SOURCE_VERSION_SQUARE)), LevelStem.END, org.betterx.bclib.presets.worldgen.WorldPresets.getBCLEndLevelStem(this.biomes, this.endDimensionType, this.structureSets, this.noises, this.endNoiseSettings, - Optional.of(BCLChunkGenerator.BIOME_SOURCE_VERSION_SQUARE)) + Optional.of(BCLBiomeSource.BIOME_SOURCE_VERSION_SQUARE)) ), 0 ); diff --git a/src/main/java/org/betterx/bclib/presets/worldgen/BCLChunkGenerator.java b/src/main/java/org/betterx/bclib/presets/worldgen/BCLChunkGenerator.java index dbef40be..2eb70567 100644 --- a/src/main/java/org/betterx/bclib/presets/worldgen/BCLChunkGenerator.java +++ b/src/main/java/org/betterx/bclib/presets/worldgen/BCLChunkGenerator.java @@ -26,11 +26,6 @@ import org.betterx.bclib.world.generator.BCLBiomeSource; import java.util.Optional; public class BCLChunkGenerator extends NoiseBasedChunkGenerator { - public static int BIOME_SOURCE_VERSION_NONE = -1; - public static int BIOME_SOURCE_VERSION_VANILLA = 0; - public static int BIOME_SOURCE_VERSION_SQUARE = 17; - public static int BIOME_SOURCE_VERSION_HEX = 18; - public static int DEFAULT_BIOME_SOURCE_VERSION = BIOME_SOURCE_VERSION_HEX; private static String TAG_GENERATOR = "generator"; private static final String TAG_VERSION = "version"; @@ -81,13 +76,8 @@ public class BCLChunkGenerator extends NoiseBasedChunkGenerator { } public static int getBiomeVersionForGenerator(ChunkGenerator generator) { - if (generator == null) return BIOME_SOURCE_VERSION_NONE; - - if (generator.getBiomeSource() instanceof BCLBiomeSource bcl) { - return bcl.biomeSourceVersion; - } else { - return BIOME_SOURCE_VERSION_VANILLA; - } + if (generator == null) return BCLBiomeSource.getVersionBiomeSource(null); + return BCLBiomeSource.getVersionBiomeSource(generator.getBiomeSource()); } public static Optional> referenceStemForVersion( @@ -99,13 +89,13 @@ public class BCLChunkGenerator extends NoiseBasedChunkGenerator { boolean generateBonusChest ) { final WorldGenSettings referenceSettings; - if (biomeSourceVersion == BIOME_SOURCE_VERSION_VANILLA) { + if (biomeSourceVersion == BCLBiomeSource.BIOME_SOURCE_VERSION_VANILLA) { referenceSettings = net.minecraft.world.level.levelgen.presets.WorldPresets.createNormalWorldFromPreset( registryAccess, seed, generateStructures, generateBonusChest); - } else if (biomeSourceVersion == BIOME_SOURCE_VERSION_SQUARE) { + } else if (biomeSourceVersion == BCLBiomeSource.BIOME_SOURCE_VERSION_SQUARE) { referenceSettings = WorldPresets.createWorldFromPreset( WorldPresets.BCL_WORLD_17, registryAccess, @@ -124,7 +114,7 @@ public class BCLChunkGenerator extends NoiseBasedChunkGenerator { public static int getBiomeVersionForCurrentWorld(ResourceKey key) { final CompoundTag settingsNbt = getSettingsNbt(); - if (!settingsNbt.contains(key.location().toString())) return DEFAULT_BIOME_SOURCE_VERSION; + if (!settingsNbt.contains(key.location().toString())) return BCLBiomeSource.DEFAULT_BIOME_SOURCE_VERSION; return settingsNbt.getInt(key.location().toString()); } @@ -155,7 +145,7 @@ public class BCLChunkGenerator extends NoiseBasedChunkGenerator { if (settingsNbt.size() == 0) { BCLib.LOGGER.info("Found World without generator Settings. Setting up data..."); - int biomeSourceVersion = DEFAULT_BIOME_SOURCE_VERSION; + int biomeSourceVersion = BCLBiomeSource.DEFAULT_BIOME_SOURCE_VERSION; final CompoundTag bclRoot = WorldDataAPI.getRootTag(BCLib.MOD_ID); @@ -167,15 +157,15 @@ public class BCLChunkGenerator extends NoiseBasedChunkGenerator { if (isPre18) { BCLib.LOGGER.info("World was create pre 1.18!"); - biomeSourceVersion = BIOME_SOURCE_VERSION_SQUARE; + biomeSourceVersion = BCLBiomeSource.BIOME_SOURCE_VERSION_SQUARE; } if (WorldDataAPI.hasMod("betternether")) { BCLib.LOGGER.info("Found Data from BetterNether, using for migration."); final CompoundTag bnRoot = WorldDataAPI.getRootTag("betternether"); biomeSourceVersion = "1.17".equals(bnRoot.getString(TAG_BN_GEN_VERSION)) - ? BIOME_SOURCE_VERSION_SQUARE - : BIOME_SOURCE_VERSION_HEX; + ? BCLBiomeSource.BIOME_SOURCE_VERSION_SQUARE + : BCLBiomeSource.BIOME_SOURCE_VERSION_HEX; } BCLib.LOGGER.info("Set world to BiomeSource Version " + biomeSourceVersion); diff --git a/src/main/java/org/betterx/bclib/presets/worldgen/WorldPresets.java b/src/main/java/org/betterx/bclib/presets/worldgen/WorldPresets.java index b8d1bdd5..e2890e7f 100644 --- a/src/main/java/org/betterx/bclib/presets/worldgen/WorldPresets.java +++ b/src/main/java/org/betterx/bclib/presets/worldgen/WorldPresets.java @@ -1,6 +1,7 @@ package org.betterx.bclib.presets.worldgen; import net.minecraft.core.Holder; +import net.minecraft.core.MappedRegistry; import net.minecraft.core.Registry; import net.minecraft.core.RegistryAccess; import net.minecraft.data.BuiltinRegistries; @@ -9,6 +10,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.WorldPresetTags; import net.minecraft.util.RandomSource; import net.minecraft.world.level.biome.Biome; +import net.minecraft.world.level.chunk.ChunkGenerator; import net.minecraft.world.level.dimension.DimensionType; import net.minecraft.world.level.dimension.LevelStem; import net.minecraft.world.level.levelgen.NoiseGeneratorSettings; @@ -18,6 +20,7 @@ import net.minecraft.world.level.levelgen.structure.StructureSet; import net.minecraft.world.level.levelgen.synth.NormalNoise; import com.mojang.datafixers.util.Pair; +import com.mojang.serialization.Lifecycle; import org.betterx.bclib.BCLib; import org.betterx.bclib.api.tag.TagAPI; import org.betterx.bclib.api.tag.TagType; @@ -129,6 +132,63 @@ public class WorldPresets { return createDefaultWorldFromPreset(registryAccess, RandomSource.create().nextLong()); } + public static WorldGenSettings replaceGenerator( + ResourceKey dimensionKey, + ResourceKey dimensionTypeKey, + int biomeSourceVersion, + RegistryAccess registryAccess, + WorldGenSettings worldGenSettings + ) { + Optional> oLevelStem = BCLChunkGenerator.referenceStemForVersion( + dimensionKey, + biomeSourceVersion, + registryAccess, + worldGenSettings.seed(), + worldGenSettings.generateStructures(), + worldGenSettings.generateStructures() + ); + + Registry registry = registryAccess.registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY); + Registry registry2 = withDimension(dimensionKey, dimensionTypeKey, registry, + worldGenSettings.dimensions(), + oLevelStem.map(l -> l.value().generator()).orElseThrow()); + return new WorldGenSettings(worldGenSettings.seed(), + worldGenSettings.generateStructures(), + worldGenSettings.generateBonusChest(), + registry2); + } + + public static Registry withDimension(ResourceKey dimensionKey, + ResourceKey dimensionTypeKey, + Registry registry, + Registry registry2, + ChunkGenerator chunkGenerator) { + LevelStem levelStem = registry2.get(dimensionKey); + Holder holder = levelStem == null + ? registry.getOrCreateHolderOrThrow(dimensionTypeKey) + : levelStem.typeHolder(); + return withDimension(dimensionKey, registry2, holder, chunkGenerator); + } + + public static Registry withDimension(ResourceKey dimensionKey, Registry registry, + Holder holder, + ChunkGenerator chunkGenerator) { + MappedRegistry writableRegistry = new MappedRegistry(Registry.LEVEL_STEM_REGISTRY, + Lifecycle.experimental(), + null); + writableRegistry.register(dimensionKey, + new LevelStem(holder, chunkGenerator), + Lifecycle.stable()); + for (Map.Entry, LevelStem> entry : registry.entrySet()) { + ResourceKey resourceKey = entry.getKey(); + if (resourceKey == dimensionKey) continue; + writableRegistry.register(resourceKey, + entry.getValue(), + registry.lifecycle(entry.getValue())); + } + return writableRegistry; + } + /** * Registers a custom WorldPreset (with custom rules and behaviour) *

diff --git a/src/main/java/org/betterx/bclib/world/generator/BCLBiomeSource.java b/src/main/java/org/betterx/bclib/world/generator/BCLBiomeSource.java index 9d7edc87..feac7454 100644 --- a/src/main/java/org/betterx/bclib/world/generator/BCLBiomeSource.java +++ b/src/main/java/org/betterx/bclib/world/generator/BCLBiomeSource.java @@ -6,12 +6,16 @@ import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.BiomeSource; import org.betterx.bclib.api.biomes.BiomeAPI; -import org.betterx.bclib.presets.worldgen.BCLChunkGenerator; import java.util.List; import java.util.Optional; public abstract class BCLBiomeSource extends BiomeSource { + public static int BIOME_SOURCE_VERSION_NONE = -1; + public static int BIOME_SOURCE_VERSION_VANILLA = 0; + public static int BIOME_SOURCE_VERSION_SQUARE = 17; + public static int BIOME_SOURCE_VERSION_HEX = 18; + public static int DEFAULT_BIOME_SOURCE_VERSION = BIOME_SOURCE_VERSION_HEX; protected final Registry biomeRegistry; protected long currentSeed; @@ -29,7 +33,7 @@ public abstract class BCLBiomeSource extends BiomeSource { super(preInit(biomeRegistry, list)); this.biomeRegistry = biomeRegistry; - this.biomeSourceVersion = biomeSourceVersion.orElse(BCLChunkGenerator.DEFAULT_BIOME_SOURCE_VERSION); + this.biomeSourceVersion = biomeSourceVersion.orElse(DEFAULT_BIOME_SOURCE_VERSION); this.currentSeed = seed; System.out.println(this + " with Registry: " + biomeRegistry.getClass().getName() + "@" + Integer.toHexString( @@ -52,4 +56,14 @@ public abstract class BCLBiomeSource extends BiomeSource { } protected abstract void onInitMap(long newSeed); + + public static int getVersionBiomeSource(BiomeSource biomeSource) { + if (biomeSource == null) return BCLBiomeSource.BIOME_SOURCE_VERSION_NONE; + + if (biomeSource instanceof BCLBiomeSource bcl) { + return bcl.biomeSourceVersion; + } else { + return BCLBiomeSource.BIOME_SOURCE_VERSION_VANILLA; + } + } } diff --git a/src/main/java/org/betterx/bclib/world/generator/BCLibEndBiomeSource.java b/src/main/java/org/betterx/bclib/world/generator/BCLibEndBiomeSource.java index ca626fda..e9a62930 100644 --- a/src/main/java/org/betterx/bclib/world/generator/BCLibEndBiomeSource.java +++ b/src/main/java/org/betterx/bclib/world/generator/BCLibEndBiomeSource.java @@ -22,7 +22,6 @@ import org.betterx.bclib.config.ConfigKeeper.StringArrayEntry; import org.betterx.bclib.config.Configs; import org.betterx.bclib.interfaces.BiomeMap; import org.betterx.bclib.noise.OpenSimplexNoise; -import org.betterx.bclib.presets.worldgen.BCLChunkGenerator; import org.betterx.bclib.world.biomes.BCLBiome; import org.betterx.bclib.world.generator.map.hex.HexBiomeMap; import org.betterx.bclib.world.generator.map.square.SquareBiomeMap; @@ -187,7 +186,7 @@ public class BCLibEndBiomeSource extends BCLBiomeSource { @Override protected void onInitMap(long seed) { - if ((biomeSourceVersion != BCLChunkGenerator.BIOME_SOURCE_VERSION_HEX)) { + if ((biomeSourceVersion != BCLBiomeSource.BIOME_SOURCE_VERSION_HEX)) { this.mapLand = new SquareBiomeMap(seed, GeneratorOptions.getBiomeSizeEndLand(), endLandBiomePicker); diff --git a/src/main/java/org/betterx/bclib/world/generator/BCLibNetherBiomeSource.java b/src/main/java/org/betterx/bclib/world/generator/BCLibNetherBiomeSource.java index bb312867..da7fb447 100644 --- a/src/main/java/org/betterx/bclib/world/generator/BCLibNetherBiomeSource.java +++ b/src/main/java/org/betterx/bclib/world/generator/BCLibNetherBiomeSource.java @@ -19,7 +19,6 @@ import org.betterx.bclib.api.biomes.BiomeAPI; import org.betterx.bclib.config.ConfigKeeper.StringArrayEntry; import org.betterx.bclib.config.Configs; import org.betterx.bclib.interfaces.BiomeMap; -import org.betterx.bclib.presets.worldgen.BCLChunkGenerator; import org.betterx.bclib.world.biomes.BCLBiome; import org.betterx.bclib.world.generator.map.MapStack; import org.betterx.bclib.world.generator.map.hex.HexBiomeMap; @@ -156,7 +155,7 @@ public class BCLibNetherBiomeSource extends BCLBiomeSource { @Override protected void onInitMap(long seed) { - TriFunction mapConstructor = (biomeSourceVersion != BCLChunkGenerator.BIOME_SOURCE_VERSION_HEX) + TriFunction mapConstructor = (biomeSourceVersion != BCLBiomeSource.BIOME_SOURCE_VERSION_HEX) ? SquareBiomeMap::new : HexBiomeMap::new; if (worldHeight > 128 && GeneratorOptions.useVerticalBiomes()) { diff --git a/src/main/resources/bclib.accesswidener b/src/main/resources/bclib.accesswidener index ec86b702..37195b58 100644 --- a/src/main/resources/bclib.accesswidener +++ b/src/main/resources/bclib.accesswidener @@ -10,3 +10,6 @@ accessible class net/minecraft/world/level/levelgen/SurfaceRules$LazyCondition accessible class net/minecraft/world/level/levelgen/SurfaceRules$SequenceRuleSource accessible class net/minecraft/world/level/levelgen/presets/WorldPresets$Bootstrap extendable class net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator + +#Methods +accessible method net/minecraft/client/gui/screens/worldselection/WorldGenSettingsComponent updateSettings (Lnet/minecraft/client/gui/screens/worldselection/WorldCreationContext$Updater;)V \ No newline at end of file