Moved WorldPreset creating to DataGen step
This commit is contained in:
parent
ad0a82c2f0
commit
a592c05b4d
26 changed files with 452 additions and 431 deletions
|
@ -20,6 +20,7 @@ import org.betterx.bclib.recipes.AnvilRecipe;
|
|||
import org.betterx.bclib.recipes.CraftingRecipes;
|
||||
import org.betterx.bclib.registry.BaseBlockEntities;
|
||||
import org.betterx.bclib.registry.BaseRegistry;
|
||||
import org.betterx.bclib.registry.PresetsRegistry;
|
||||
import org.betterx.worlds.together.WorldsTogether;
|
||||
import org.betterx.worlds.together.util.Logger;
|
||||
import org.betterx.worlds.together.world.WorldConfig;
|
||||
|
@ -48,6 +49,7 @@ public class BCLib implements ModInitializer {
|
|||
@Override
|
||||
public void onInitialize() {
|
||||
WorldsTogether.onInitialize();
|
||||
PresetsRegistry.register();
|
||||
LevelGenEvents.register();
|
||||
BlockPredicates.ensureStaticInitialization();
|
||||
BCLBiomeRegistry.ensureStaticallyLoaded();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.betterx.bclib.api.v2.generator;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiome;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.InternalBiomeAPI;
|
||||
import org.betterx.worlds.together.biomesource.BiomeSourceFromRegistry;
|
||||
import org.betterx.worlds.together.biomesource.BiomeSourceHelper;
|
||||
|
@ -10,6 +11,7 @@ import org.betterx.worlds.together.world.BiomeSourceWithSeed;
|
|||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.HolderGetter;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.BiomeSource;
|
||||
|
@ -17,13 +19,13 @@ import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
|
|||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public abstract class BCLBiomeSource extends BiomeSource implements BiomeSourceWithSeed, MergeableBiomeSource<BCLBiomeSource>, BiomeSourceWithNoiseRelatedSettings, BiomeSourceFromRegistry<BCLBiomeSource> {
|
||||
protected final HolderGetter<Biome> biomeRegistry;
|
||||
protected final HolderGetter<BCLBiome> bclBiomeRegistry;
|
||||
private int registryModificationCounter;
|
||||
protected long currentSeed;
|
||||
protected int maxHeight;
|
||||
|
@ -42,12 +44,14 @@ public abstract class BCLBiomeSource extends BiomeSource implements BiomeSourceW
|
|||
|
||||
protected BCLBiomeSource(
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry,
|
||||
List<Holder<Biome>> list,
|
||||
long seed
|
||||
) {
|
||||
super(preInit(biomeRegistry, list));
|
||||
this.registryModificationCounter = InternalBiomeAPI.getBiomeRegistryModificationCount(biomeRegistry);
|
||||
this.biomeRegistry = biomeRegistry;
|
||||
this.bclBiomeRegistry = bclBiomeRegistry;
|
||||
this.currentSeed = seed;
|
||||
}
|
||||
|
||||
|
@ -103,15 +107,21 @@ public abstract class BCLBiomeSource extends BiomeSource implements BiomeSourceW
|
|||
}
|
||||
|
||||
protected static List<Holder<Biome>> getBiomes(
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<Biome> getter,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry,
|
||||
List<String> exclude,
|
||||
List<String> include,
|
||||
BCLibNetherBiomeSource.ValidBiomePredicate test
|
||||
) {
|
||||
//TODO: 1.19.3 restore this code
|
||||
return List.of();/*biomeRegistry.stream()
|
||||
.filter(biome -> biomeRegistry.getResourceKey(biome).isPresent())
|
||||
Optional<Field> res = Arrays.stream(getter.getClass().getFields())
|
||||
.filter(f -> Registry.class.isAssignableFrom(f.getType()))
|
||||
.findFirst();
|
||||
if (res.isPresent()) {
|
||||
try {
|
||||
Registry<Biome> biomeRegistry = (Registry<Biome>) res.get().get(getter);
|
||||
|
||||
return biomeRegistry.stream()
|
||||
.filter(biome -> biomeRegistry.getResourceKey(biome).isPresent())
|
||||
.map(biome -> (Holder<Biome>) biomeRegistry.getHolderOrThrow(
|
||||
biomeRegistry.getResourceKey(biome).get())
|
||||
)
|
||||
|
@ -123,7 +133,15 @@ public abstract class BCLBiomeSource extends BiomeSource implements BiomeSourceW
|
|||
|
||||
return test.isValid(biome, location);
|
||||
})
|
||||
.toList();*/
|
||||
.toList();
|
||||
} catch (IllegalAccessException e) {
|
||||
BCLib.LOGGER.error("Unable to load field", e);
|
||||
return List.of();
|
||||
}
|
||||
} else {
|
||||
BCLib.LOGGER.error("Unable to access Biome Registry..");
|
||||
return List.of();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.betterx.bclib.config.Configs;
|
|||
import org.betterx.bclib.interfaces.BiomeMap;
|
||||
import org.betterx.worlds.together.biomesource.BiomeSourceWithConfig;
|
||||
import org.betterx.worlds.together.biomesource.ReloadableBiomeSource;
|
||||
import org.betterx.worlds.together.world.event.WorldBootstrap;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||
|
@ -35,9 +36,10 @@ import org.jetbrains.annotations.NotNull;
|
|||
|
||||
public class BCLibEndBiomeSource extends BCLBiomeSource implements BiomeSourceWithConfig<BCLibEndBiomeSource, BCLEndBiomeSourceConfig>, ReloadableBiomeSource {
|
||||
public static Codec<BCLibEndBiomeSource> CODEC
|
||||
= RecordCodecBuilder.create((instance) -> instance.group(
|
||||
RegistryOps
|
||||
.retrieveElement(Registries.BIOME),
|
||||
= RecordCodecBuilder.create((instance) -> instance
|
||||
.group(
|
||||
RegistryOps.retrieveGetter(Registries.BIOME),
|
||||
RegistryOps.retrieveGetter(BCLBiomeRegistry.BCL_BIOMES_REGISTRY),
|
||||
Codec
|
||||
.LONG
|
||||
.fieldOf("seed")
|
||||
|
@ -69,38 +71,41 @@ public class BCLibEndBiomeSource extends BCLBiomeSource implements BiomeSourceWi
|
|||
private BCLEndBiomeSourceConfig config;
|
||||
|
||||
private BCLibEndBiomeSource(
|
||||
Holder.Reference<Registry<Biome>> registryReference,
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry,
|
||||
long seed,
|
||||
BCLEndBiomeSourceConfig bclEndBiomeSourceConfig
|
||||
BCLEndBiomeSourceConfig config
|
||||
) {
|
||||
this(registryReference.value().asLookup(), seed, bclEndBiomeSourceConfig);
|
||||
this(biomeRegistry, bclBiomeRegistry, seed, config, true);
|
||||
}
|
||||
|
||||
private BCLibEndBiomeSource(HolderGetter<Biome> biomeRegistry, long seed, BCLEndBiomeSourceConfig config) {
|
||||
this(biomeRegistry, seed, config, true);
|
||||
}
|
||||
|
||||
public BCLibEndBiomeSource(HolderGetter<Biome> biomeRegistry, BCLEndBiomeSourceConfig config) {
|
||||
this(biomeRegistry, 0, config, false);
|
||||
public BCLibEndBiomeSource(
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry,
|
||||
BCLEndBiomeSourceConfig config
|
||||
) {
|
||||
this(biomeRegistry, bclBiomeRegistry, 0, config, false);
|
||||
}
|
||||
|
||||
private BCLibEndBiomeSource(
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry,
|
||||
long seed,
|
||||
BCLEndBiomeSourceConfig config,
|
||||
boolean initMaps
|
||||
) {
|
||||
this(biomeRegistry, getBiomes(biomeRegistry), seed, config, initMaps);
|
||||
this(biomeRegistry, bclBiomeRegistry, getBiomes(biomeRegistry, bclBiomeRegistry), seed, config, initMaps);
|
||||
}
|
||||
|
||||
private BCLibEndBiomeSource(
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry,
|
||||
List<Holder<Biome>> list,
|
||||
long seed,
|
||||
BCLEndBiomeSourceConfig config,
|
||||
boolean initMaps
|
||||
) {
|
||||
super(biomeRegistry, list, seed);
|
||||
super(biomeRegistry, bclBiomeRegistry, list, seed);
|
||||
this.config = config;
|
||||
rebuildBiomePickers();
|
||||
|
||||
|
@ -114,6 +119,21 @@ public class BCLibEndBiomeSource extends BCLBiomeSource implements BiomeSourceWi
|
|||
|
||||
@NotNull
|
||||
private void rebuildBiomePickers() {
|
||||
if (WorldBootstrap.getLastRegistryAccess() == null) {
|
||||
this.endLandBiomePicker = null;
|
||||
this.endVoidBiomePicker = null;
|
||||
this.endCenterBiomePicker = null;
|
||||
this.endBarrensBiomePicker = null;
|
||||
this.deciders = List.of();
|
||||
return;
|
||||
}
|
||||
|
||||
HolderLookup.RegistryLookup<Biome> biomeRegistry = WorldBootstrap.getLastRegistryAccess()
|
||||
.lookupOrThrow(Registries.BIOME);
|
||||
Registry<BCLBiome> bclBiomeRegistry = WorldBootstrap.getLastRegistryAccess()
|
||||
.registryOrThrow(BCLBiomeRegistry.BCL_BIOMES_REGISTRY);
|
||||
|
||||
|
||||
var includeMap = Configs.BIOMES_CONFIG.getBiomeIncludeMap();
|
||||
var excludeList = Configs.BIOMES_CONFIG.getExcludeMatching(BiomeAPI.BiomeType.END);
|
||||
|
||||
|
@ -144,11 +164,11 @@ public class BCLibEndBiomeSource extends BCLBiomeSource implements BiomeSourceWi
|
|||
return;
|
||||
}
|
||||
final BCLBiome bclBiome;
|
||||
if (!BiomeAPI.hasBiome(biomeID)) {
|
||||
if (!bclBiomeRegistry.containsKey(biomeID)) {
|
||||
bclBiome = new BCLBiome(biomeID, BiomeAPI.BiomeType.END_LAND);
|
||||
InternalBiomeAPI.registerBCLBiomeData(bclBiome);
|
||||
} else {
|
||||
bclBiome = BiomeAPI.getBiome(biomeID);
|
||||
bclBiome = bclBiomeRegistry.get(biomeID);
|
||||
}
|
||||
|
||||
|
||||
|
@ -238,7 +258,7 @@ public class BCLibEndBiomeSource extends BCLBiomeSource implements BiomeSourceWi
|
|||
}
|
||||
|
||||
protected BCLBiomeSource cloneForDatapack(Set<Holder<Biome>> datapackBiomes) {
|
||||
datapackBiomes.addAll(getNonVanillaBiomes(this.biomeRegistry));
|
||||
datapackBiomes.addAll(getNonVanillaBiomes(this.biomeRegistry, this.bclBiomeRegistry));
|
||||
datapackBiomes.addAll(possibleBiomes().stream()
|
||||
.filter(h -> !h.unwrapKey()
|
||||
.orElseThrow()
|
||||
|
@ -249,6 +269,7 @@ public class BCLibEndBiomeSource extends BCLBiomeSource implements BiomeSourceWi
|
|||
|
||||
return new BCLibEndBiomeSource(
|
||||
this.biomeRegistry,
|
||||
this.bclBiomeRegistry,
|
||||
datapackBiomes.stream()
|
||||
.filter(b -> b.unwrapKey()
|
||||
.orElse(null) != BCLBiomeRegistry.EMPTY_BIOME.getBiomeKey())
|
||||
|
@ -259,18 +280,26 @@ public class BCLibEndBiomeSource extends BCLBiomeSource implements BiomeSourceWi
|
|||
);
|
||||
}
|
||||
|
||||
private static List<Holder<Biome>> getNonVanillaBiomes(HolderGetter<Biome> biomeRegistry) {
|
||||
private static List<Holder<Biome>> getNonVanillaBiomes(
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry
|
||||
) {
|
||||
return getBiomes(
|
||||
biomeRegistry,
|
||||
bclBiomeRegistry,
|
||||
Configs.BIOMES_CONFIG.getExcludeMatching(BiomeAPI.BiomeType.END),
|
||||
Configs.BIOMES_CONFIG.getIncludeMatching(BiomeAPI.BiomeType.END),
|
||||
BCLibEndBiomeSource::isValidNonVanillaEndBiome
|
||||
);
|
||||
}
|
||||
|
||||
private static List<Holder<Biome>> getBiomes(HolderGetter<Biome> biomeRegistry) {
|
||||
private static List<Holder<Biome>> getBiomes(
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry
|
||||
) {
|
||||
return getBiomes(
|
||||
biomeRegistry,
|
||||
bclBiomeRegistry,
|
||||
Configs.BIOMES_CONFIG.getExcludeMatching(BiomeAPI.BiomeType.END),
|
||||
Configs.BIOMES_CONFIG.getIncludeMatching(BiomeAPI.BiomeType.END),
|
||||
BCLibEndBiomeSource::isValidEndBiome
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.betterx.bclib.config.Configs;
|
|||
import org.betterx.bclib.interfaces.BiomeMap;
|
||||
import org.betterx.worlds.together.biomesource.BiomeSourceWithConfig;
|
||||
import org.betterx.worlds.together.biomesource.ReloadableBiomeSource;
|
||||
import org.betterx.worlds.together.world.event.WorldBootstrap;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||
|
@ -36,7 +37,8 @@ public class BCLibNetherBiomeSource extends BCLBiomeSource implements BiomeSourc
|
|||
public static final Codec<BCLibNetherBiomeSource> CODEC = RecordCodecBuilder
|
||||
.create(instance -> instance
|
||||
.group(
|
||||
RegistryOps.retrieveElement(Registries.BIOME),
|
||||
RegistryOps.retrieveGetter(Registries.BIOME),
|
||||
RegistryOps.retrieveGetter(BCLBiomeRegistry.BCL_BIOMES_REGISTRY),
|
||||
Codec
|
||||
.LONG
|
||||
.fieldOf("seed")
|
||||
|
@ -56,41 +58,42 @@ public class BCLibNetherBiomeSource extends BCLBiomeSource implements BiomeSourc
|
|||
private BiomePicker biomePicker;
|
||||
private BCLNetherBiomeSourceConfig config;
|
||||
|
||||
|
||||
private BCLibNetherBiomeSource(
|
||||
Holder.Reference<Registry<Biome>> registryReference,
|
||||
long seed,
|
||||
BCLNetherBiomeSourceConfig bclNetherBiomeSourceConfig
|
||||
public BCLibNetherBiomeSource(
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry,
|
||||
BCLNetherBiomeSourceConfig config
|
||||
) {
|
||||
this(registryReference.value().asLookup(), seed, bclNetherBiomeSourceConfig);
|
||||
}
|
||||
|
||||
|
||||
public BCLibNetherBiomeSource(HolderGetter<Biome> biomeRegistry, BCLNetherBiomeSourceConfig config) {
|
||||
this(biomeRegistry, 0, config, false);
|
||||
}
|
||||
|
||||
private BCLibNetherBiomeSource(HolderGetter<Biome> biomeRegistry, long seed, BCLNetherBiomeSourceConfig config) {
|
||||
this(biomeRegistry, seed, config, true);
|
||||
this(biomeRegistry, bclBiomeRegistry, 0, config, false);
|
||||
}
|
||||
|
||||
private BCLibNetherBiomeSource(
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry,
|
||||
long seed,
|
||||
BCLNetherBiomeSourceConfig config
|
||||
) {
|
||||
this(biomeRegistry, bclBiomeRegistry, seed, config, true);
|
||||
}
|
||||
|
||||
private BCLibNetherBiomeSource(
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry,
|
||||
long seed,
|
||||
BCLNetherBiomeSourceConfig config,
|
||||
boolean initMaps
|
||||
) {
|
||||
this(biomeRegistry, getBiomes(biomeRegistry), seed, config, initMaps);
|
||||
this(biomeRegistry, bclBiomeRegistry, getBiomes(biomeRegistry, bclBiomeRegistry), seed, config, initMaps);
|
||||
}
|
||||
|
||||
private BCLibNetherBiomeSource(
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry,
|
||||
List<Holder<Biome>> list,
|
||||
long seed,
|
||||
BCLNetherBiomeSourceConfig config,
|
||||
boolean initMaps
|
||||
) {
|
||||
super(biomeRegistry, list, seed);
|
||||
super(biomeRegistry, bclBiomeRegistry, list, seed);
|
||||
this.config = config;
|
||||
rebuildBiomePicker();
|
||||
if (initMaps) {
|
||||
|
@ -99,20 +102,27 @@ public class BCLibNetherBiomeSource extends BCLBiomeSource implements BiomeSourc
|
|||
}
|
||||
|
||||
private void rebuildBiomePicker() {
|
||||
biomePicker = new BiomePicker(biomeRegistry);
|
||||
|
||||
if (WorldBootstrap.getLastRegistryAccess() == null) {
|
||||
biomePicker = new BiomePicker(null);
|
||||
return;
|
||||
}
|
||||
biomePicker = new BiomePicker(WorldBootstrap.getLastRegistryAccess().lookupOrThrow(Registries.BIOME));
|
||||
Registry<BCLBiome> bclBiomeRegistry = WorldBootstrap.getLastRegistryAccess()
|
||||
.registryOrThrow(BCLBiomeRegistry.BCL_BIOMES_REGISTRY);
|
||||
this.possibleBiomes().forEach(biome -> {
|
||||
ResourceLocation biomeID = biome.unwrapKey().orElseThrow().location();
|
||||
if (!biome.isBound()) {
|
||||
BCLib.LOGGER.warning("Biome " + biomeID.toString() + " is requested but not yet bound.");
|
||||
return;
|
||||
}
|
||||
if (!BiomeAPI.hasBiome(biomeID)) {
|
||||
|
||||
|
||||
if (!bclBiomeRegistry.containsKey(biomeID)) {
|
||||
BCLBiome bclBiome = new BCLBiome(biomeID, BiomeAPI.BiomeType.NETHER);
|
||||
InternalBiomeAPI.registerBCLBiomeData(bclBiome);
|
||||
biomePicker.addBiome(bclBiome);
|
||||
} else {
|
||||
BCLBiome bclBiome = BiomeAPI.getBiome(biomeID);
|
||||
BCLBiome bclBiome = bclBiomeRegistry.get(biomeID);
|
||||
|
||||
if (!BCLBiomeRegistry.isEmptyBiome(bclBiome)) {
|
||||
if (bclBiome.getParentBiome() == null) {
|
||||
|
@ -126,7 +136,7 @@ public class BCLibNetherBiomeSource extends BCLBiomeSource implements BiomeSourc
|
|||
}
|
||||
|
||||
protected BCLBiomeSource cloneForDatapack(Set<Holder<Biome>> datapackBiomes) {
|
||||
datapackBiomes.addAll(getNonVanillaBiomes(this.biomeRegistry));
|
||||
datapackBiomes.addAll(getNonVanillaBiomes(this.biomeRegistry, this.bclBiomeRegistry));
|
||||
datapackBiomes.addAll(possibleBiomes().stream()
|
||||
.filter(h -> !h.unwrapKey()
|
||||
.orElseThrow()
|
||||
|
@ -136,6 +146,7 @@ public class BCLibNetherBiomeSource extends BCLBiomeSource implements BiomeSourc
|
|||
.toList());
|
||||
return new BCLibNetherBiomeSource(
|
||||
this.biomeRegistry,
|
||||
this.bclBiomeRegistry,
|
||||
datapackBiomes.stream()
|
||||
.filter(b -> b.unwrapKey()
|
||||
.orElse(null) != BCLBiomeRegistry.EMPTY_BIOME.getBiomeKey())
|
||||
|
@ -146,19 +157,31 @@ public class BCLibNetherBiomeSource extends BCLBiomeSource implements BiomeSourc
|
|||
);
|
||||
}
|
||||
|
||||
private static List<Holder<Biome>> getNonVanillaBiomes(HolderGetter<Biome> biomeRegistry) {
|
||||
private static List<Holder<Biome>> getNonVanillaBiomes(
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry
|
||||
) {
|
||||
List<String> include = Configs.BIOMES_CONFIG.getIncludeMatching(BiomeAPI.BiomeType.NETHER);
|
||||
List<String> exclude = Configs.BIOMES_CONFIG.getExcludeMatching(BiomeAPI.BiomeType.NETHER);
|
||||
|
||||
return getBiomes(biomeRegistry, exclude, include, BCLibNetherBiomeSource::isValidNonVanillaNetherBiome);
|
||||
return getBiomes(
|
||||
biomeRegistry,
|
||||
bclBiomeRegistry,
|
||||
exclude,
|
||||
include,
|
||||
BCLibNetherBiomeSource::isValidNonVanillaNetherBiome
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
private static List<Holder<Biome>> getBiomes(HolderGetter<Biome> biomeRegistry) {
|
||||
private static List<Holder<Biome>> getBiomes(
|
||||
HolderGetter<Biome> biomeRegistry,
|
||||
HolderGetter<BCLBiome> bclBiomeRegistry
|
||||
) {
|
||||
List<String> include = Configs.BIOMES_CONFIG.getIncludeMatching(BiomeAPI.BiomeType.NETHER);
|
||||
List<String> exclude = Configs.BIOMES_CONFIG.getExcludeMatching(BiomeAPI.BiomeType.NETHER);
|
||||
|
||||
return getBiomes(biomeRegistry, exclude, include, BCLibNetherBiomeSource::isValidNetherBiome);
|
||||
return getBiomes(biomeRegistry, bclBiomeRegistry, exclude, include, BCLibNetherBiomeSource::isValidNetherBiome);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ public class BiomePicker {
|
|||
Registries.BIOME,
|
||||
bclBiome.getID()
|
||||
);//biomeRegistry.getResourceKey(biomeRegistry.get(bclBiome.getID())).orElse(null);
|
||||
this.biome = key != null ? biomeRegistry.getOrThrow(key) : null;
|
||||
this.biome = (key != null && biomeRegistry != null) ? biomeRegistry.getOrThrow(key) : null;
|
||||
this.isValid = key != null && biome != null && biome.isBound() && biomeRegistry.get(key).isPresent();
|
||||
bclBiome.forEachSubBiome((b, w) -> {
|
||||
if (isAllowed(b))
|
||||
|
|
|
@ -37,7 +37,7 @@ public class LevelGenUtil {
|
|||
|
||||
@NotNull
|
||||
public static LevelStem getBCLNetherLevelStem(WorldGenUtil.Context context, BCLNetherBiomeSourceConfig config) {
|
||||
BCLibNetherBiomeSource netherSource = new BCLibNetherBiomeSource(context.biomes, config);
|
||||
BCLibNetherBiomeSource netherSource = new BCLibNetherBiomeSource(context.biomes, context.bclBiomes, config);
|
||||
|
||||
return new LevelStem(
|
||||
context.dimension,
|
||||
|
@ -49,7 +49,7 @@ public class LevelGenUtil {
|
|||
}
|
||||
|
||||
public static LevelStem getBCLEndLevelStem(WorldGenUtil.Context context, BCLEndBiomeSourceConfig config) {
|
||||
BCLibEndBiomeSource endSource = new BCLibEndBiomeSource(context.biomes, config);
|
||||
BCLibEndBiomeSource endSource = new BCLibEndBiomeSource(context.biomes, context.bclBiomes, config);
|
||||
return new LevelStem(
|
||||
context.dimension,
|
||||
new BCLChunkGenerator(
|
||||
|
|
|
@ -5,7 +5,6 @@ import org.betterx.worlds.together.WorldsTogether;
|
|||
import org.betterx.worlds.together.world.event.WorldBootstrap;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import com.mojang.serialization.Lifecycle;
|
||||
import net.minecraft.core.MappedRegistry;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
|
@ -30,10 +29,7 @@ public class BCLBiomeRegistry {
|
|||
BCL_BIOME_CODEC_REGISTRY,
|
||||
BCLBiomeRegistry::bootstrapCodecs
|
||||
);
|
||||
public static MappedRegistry<BCLBiome> BUILTIN_BCL_BIOMES = new MappedRegistry<>(
|
||||
BCL_BIOMES_REGISTRY,
|
||||
Lifecycle.stable()
|
||||
);
|
||||
public static MappedRegistry<BCLBiome> BUILTIN_BCL_BIOMES = null;
|
||||
|
||||
/**
|
||||
* Empty biome used as default value if requested biome doesn't exist or linked. Shouldn't be registered anywhere to prevent bugs.
|
||||
|
@ -76,6 +72,7 @@ public class BCLBiomeRegistry {
|
|||
*/
|
||||
@ApiStatus.Internal
|
||||
public static ResourceKey<BCLBiome> register(RegistryAccess access, BCLBiome biome) {
|
||||
if (access != null && BUILTIN_BCL_BIOMES == null) return biome.getBCLBiomeKey();
|
||||
Registry.register(
|
||||
access == null ? BUILTIN_BCL_BIOMES : access.registryOrThrow(BCL_BIOMES_REGISTRY),
|
||||
biome.getBCLBiomeKey(),
|
||||
|
@ -134,7 +131,9 @@ public class BCLBiomeRegistry {
|
|||
}
|
||||
|
||||
public static BCLBiome get(@Nullable RegistryAccess access, ResourceLocation loc) {
|
||||
return getBclBiomesRegistry(access).get(loc);
|
||||
var reg = getBclBiomesRegistry(access);
|
||||
if (reg == null) return null;
|
||||
return reg.get(loc);
|
||||
}
|
||||
|
||||
public static BCLBiome getOrElseEmpty(ResourceLocation loc) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.betterx.bclib.mixin.common;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeRegistry;
|
||||
|
||||
import com.mojang.serialization.Lifecycle;
|
||||
|
@ -29,11 +30,17 @@ public abstract class BuiltinRegistriesMixin {
|
|||
//this needs to be added BEFORE the WORLD_PRESET-Registry. Otherwise decoding will fail!
|
||||
@Inject(method = "<clinit>", at = @At(value = "INVOKE", ordinal = 0, target = "Lnet/minecraft/core/registries/BuiltInRegistries;registerSimple(Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/core/registries/BuiltInRegistries$RegistryBootstrap;)Lnet/minecraft/core/Registry;"))
|
||||
private static void bcl_registerBuiltin(CallbackInfo ci) {
|
||||
BCLBiomeRegistry.BUILTIN_BCL_BIOMES = internalRegister(
|
||||
BCLBiomeRegistry.BCL_BIOMES_REGISTRY,
|
||||
BCLBiomeRegistry.BUILTIN_BCL_BIOMES,
|
||||
BCLBiomeRegistry::bootstrap,
|
||||
Lifecycle.stable()
|
||||
);
|
||||
BCLBiomeRegistry.ensureStaticallyLoaded();
|
||||
if (BCLib.isDatagen()) {
|
||||
// BCLBiomeRegistry.BUILTIN_BCL_BIOMES = internalRegister(
|
||||
// BCLBiomeRegistry.BCL_BIOMES_REGISTRY,
|
||||
// new MappedRegistry<>(
|
||||
// BCLBiomeRegistry.BCL_BIOMES_REGISTRY,
|
||||
// Lifecycle.stable()
|
||||
// ),
|
||||
// BCLBiomeRegistry::bootstrap,
|
||||
// Lifecycle.stable()
|
||||
// );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,132 +1,22 @@
|
|||
package org.betterx.bclib.registry;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.v2.generator.BCLChunkGenerator;
|
||||
import org.betterx.bclib.api.v2.generator.config.BCLEndBiomeSourceConfig;
|
||||
import org.betterx.bclib.api.v2.generator.config.BCLNetherBiomeSourceConfig;
|
||||
import org.betterx.bclib.api.v2.levelgen.LevelGenUtil;
|
||||
import org.betterx.bclib.config.Configs;
|
||||
import org.betterx.worlds.together.entrypoints.WorldPresetBootstrap;
|
||||
import org.betterx.worlds.together.levelgen.WorldGenUtil;
|
||||
import org.betterx.worlds.together.worldPreset.TogetherWorldPreset;
|
||||
import org.betterx.worlds.together.worldPreset.WorldPresets;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.level.dimension.LevelStem;
|
||||
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
|
||||
import net.minecraft.world.level.levelgen.presets.WorldPreset;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class PresetsRegistry implements WorldPresetBootstrap {
|
||||
|
||||
public class PresetsRegistry {
|
||||
public static ResourceKey<WorldPreset> BCL_WORLD = WorldPresets.createKey(BCLib.makeID("normal"));
|
||||
public static ResourceKey<WorldPreset> BCL_WORLD_LARGE = WorldPresets.createKey(BCLib.makeID("large"));
|
||||
public static ResourceKey<WorldPreset> BCL_WORLD_AMPLIFIED = WorldPresets.createKey(BCLib.makeID("amplified"));
|
||||
public static ResourceKey<WorldPreset> BCL_WORLD_17 = WorldPresets.createKey(BCLib.makeID("legacy_17"));
|
||||
|
||||
public void bootstrapWorldPresets() {
|
||||
WorldPresets.register(
|
||||
BCL_WORLD,
|
||||
(overworldStem, netherContext, endContext, noiseSettings, noiseBasedOverworld) ->
|
||||
buildPreset(
|
||||
overworldStem,
|
||||
netherContext, BCLNetherBiomeSourceConfig.DEFAULT,
|
||||
endContext, BCLEndBiomeSourceConfig.DEFAULT
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
WorldPresets.register(
|
||||
BCL_WORLD_LARGE,
|
||||
(overworldStem, netherContext, endContext, noiseSettings, noiseBasedOverworld) -> {
|
||||
Holder<NoiseGeneratorSettings> largeBiomeGenerator = noiseSettings
|
||||
.getOrThrow(NoiseGeneratorSettings.LARGE_BIOMES);
|
||||
return buildPreset(
|
||||
noiseBasedOverworld.make(
|
||||
overworldStem.generator().getBiomeSource(),
|
||||
largeBiomeGenerator
|
||||
),
|
||||
netherContext, BCLNetherBiomeSourceConfig.MINECRAFT_18_LARGE,
|
||||
endContext, BCLEndBiomeSourceConfig.MINECRAFT_18_LARGE
|
||||
);
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
WorldPresets.register(
|
||||
BCL_WORLD_AMPLIFIED,
|
||||
(overworldStem, netherContext, endContext, noiseSettings, noiseBasedOverworld) -> {
|
||||
Holder<NoiseGeneratorSettings> amplifiedBiomeGenerator = noiseSettings
|
||||
.getOrThrow(NoiseGeneratorSettings.AMPLIFIED);
|
||||
|
||||
WorldGenUtil.Context amplifiedNetherContext = new WorldGenUtil.Context(
|
||||
netherContext.biomes,
|
||||
netherContext.dimension,
|
||||
netherContext.structureSets,
|
||||
noiseSettings.getOrThrow(BCLChunkGenerator.AMPLIFIED_NETHER)
|
||||
);
|
||||
|
||||
return buildPreset(
|
||||
noiseBasedOverworld.make(
|
||||
overworldStem.generator().getBiomeSource(),
|
||||
amplifiedBiomeGenerator
|
||||
),
|
||||
amplifiedNetherContext, BCLNetherBiomeSourceConfig.MINECRAFT_18_AMPLIFIED,
|
||||
endContext, BCLEndBiomeSourceConfig.MINECRAFT_18_AMPLIFIED
|
||||
);
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
WorldPresets.register(
|
||||
BCL_WORLD_17,
|
||||
(overworldStem, netherContext, endContext, noiseSettings, noiseBasedOverworld) ->
|
||||
buildPreset(
|
||||
overworldStem,
|
||||
netherContext,
|
||||
BCLNetherBiomeSourceConfig.MINECRAFT_17, endContext,
|
||||
BCLEndBiomeSourceConfig.MINECRAFT_17
|
||||
),
|
||||
false
|
||||
);
|
||||
|
||||
public static void register() {
|
||||
if (Configs.CLIENT_CONFIG.forceBetterXPreset())
|
||||
WorldPresets.setDEFAULT(BCL_WORLD);
|
||||
else
|
||||
WorldPresets.setDEFAULT(net.minecraft.world.level.levelgen.presets.WorldPresets.NORMAL);
|
||||
}
|
||||
|
||||
public static TogetherWorldPreset buildPreset(
|
||||
LevelStem overworldStem,
|
||||
WorldGenUtil.Context netherContext,
|
||||
BCLNetherBiomeSourceConfig netherConfig,
|
||||
WorldGenUtil.Context endContext,
|
||||
BCLEndBiomeSourceConfig endConfig
|
||||
) {
|
||||
return new TogetherWorldPreset(buildDimensionMap(
|
||||
overworldStem,
|
||||
netherContext,
|
||||
netherConfig, endContext,
|
||||
endConfig
|
||||
), 1000);
|
||||
}
|
||||
|
||||
public static Map<ResourceKey<LevelStem>, LevelStem> buildDimensionMap(
|
||||
LevelStem overworldStem,
|
||||
WorldGenUtil.Context netherContext,
|
||||
BCLNetherBiomeSourceConfig netherConfig,
|
||||
WorldGenUtil.Context endContext,
|
||||
BCLEndBiomeSourceConfig endConfig
|
||||
) {
|
||||
return Map.of(
|
||||
LevelStem.OVERWORLD,
|
||||
overworldStem,
|
||||
LevelStem.NETHER,
|
||||
LevelGenUtil.getBCLNetherLevelStem(netherContext, netherConfig),
|
||||
LevelStem.END,
|
||||
LevelGenUtil.getBCLEndLevelStem(endContext, endConfig)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
package org.betterx.bclib.datagen;
|
||||
package org.betterx.datagen.bclib;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.datagen.bclib.preset.WorldPresetDataProvider;
|
||||
import org.betterx.datagen.bclib.tests.TestBiomes;
|
||||
import org.betterx.datagen.bclib.tests.TestConfiguredFeatures;
|
||||
import org.betterx.datagen.bclib.tests.TestPlacedFeatures;
|
||||
import org.betterx.datagen.bclib.tests.TestWorldgenProvider;
|
||||
import org.betterx.datagen.bclib.worldgen.BCLibRegistriesDataProvider;
|
||||
import org.betterx.datagen.bclib.worldgen.NoiseTypesDataProvider;
|
||||
import org.betterx.datagen.bclib.worldgen.WorldgenRegistriesDataProvider;
|
||||
|
||||
import net.minecraft.core.RegistrySetBuilder;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
|
@ -9,7 +17,7 @@ import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
|
|||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
|
||||
|
||||
public class BCLibDatagen implements DataGeneratorEntrypoint {
|
||||
static boolean ADD_TESTS = true;
|
||||
public static final boolean ADD_TESTS = true;
|
||||
|
||||
@Override
|
||||
public void onInitializeDataGenerator(FabricDataGenerator dataGenerator) {
|
||||
|
@ -19,10 +27,10 @@ public class BCLibDatagen implements DataGeneratorEntrypoint {
|
|||
if (ADD_TESTS) {
|
||||
pack.addProvider(TestWorldgenProvider::new);
|
||||
}
|
||||
pack.addProvider(WorldgenProvider::new);
|
||||
//pack.addProvider(BiomeProvider::new);
|
||||
//pack.addProvider(new BiomeProvider());
|
||||
pack.addProvider(CustomRegistriesDataProvider::new);
|
||||
|
||||
pack.addProvider(WorldgenRegistriesDataProvider::new);
|
||||
pack.addProvider(WorldPresetDataProvider::new);
|
||||
pack.addProvider(BCLibRegistriesDataProvider::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,6 +41,7 @@ public class BCLibDatagen implements DataGeneratorEntrypoint {
|
|||
registryBuilder.add(Registries.PLACED_FEATURE, TestPlacedFeatures::bootstrap);
|
||||
}
|
||||
registryBuilder.add(Registries.BIOME, TestBiomes::bootstrap);
|
||||
registryBuilder.add(Registries.NOISE_SETTINGS, NoiseDatagen::bootstrap);
|
||||
registryBuilder.add(Registries.NOISE_SETTINGS, NoiseTypesDataProvider::bootstrap);
|
||||
registryBuilder.add(Registries.WORLD_PRESET, WorldPresetDataProvider::bootstrap);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,143 @@
|
|||
package org.betterx.datagen.bclib.preset;
|
||||
|
||||
import org.betterx.bclib.api.v2.generator.BCLChunkGenerator;
|
||||
import org.betterx.bclib.api.v2.generator.config.BCLEndBiomeSourceConfig;
|
||||
import org.betterx.bclib.api.v2.generator.config.BCLNetherBiomeSourceConfig;
|
||||
import org.betterx.bclib.api.v2.levelgen.LevelGenUtil;
|
||||
import org.betterx.bclib.registry.PresetsRegistry;
|
||||
import org.betterx.worlds.together.levelgen.WorldGenUtil;
|
||||
import org.betterx.worlds.together.worldPreset.TogetherWorldPreset;
|
||||
import org.betterx.worlds.together.worldPreset.WorldPresets;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.data.worldgen.BootstapContext;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.tags.WorldPresetTags;
|
||||
import net.minecraft.world.level.dimension.LevelStem;
|
||||
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
|
||||
import net.minecraft.world.level.levelgen.presets.WorldPreset;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class WorldPresetDataProvider extends FabricTagProvider<WorldPreset> {
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a new {@link FabricTagProvider} with the default computed path.
|
||||
*
|
||||
* <p>Common implementations of this class are provided.
|
||||
*
|
||||
* @param output the {@link FabricDataOutput} instance
|
||||
* @param registriesFuture the backing registry for the tag type
|
||||
*/
|
||||
public WorldPresetDataProvider(
|
||||
FabricDataOutput output,
|
||||
CompletableFuture<HolderLookup.Provider> registriesFuture
|
||||
) {
|
||||
super(output, Registries.WORLD_PRESET, registriesFuture);
|
||||
}
|
||||
|
||||
public static void bootstrap(BootstapContext<WorldPreset> bootstrapContext) {
|
||||
final WorldPresets.BootstrapData ctx = new WorldPresets.BootstrapData(bootstrapContext);
|
||||
|
||||
bootstrapContext.register(PresetsRegistry.BCL_WORLD, createNormal(ctx));
|
||||
bootstrapContext.register(PresetsRegistry.BCL_WORLD_LARGE, createLarge(ctx));
|
||||
bootstrapContext.register(PresetsRegistry.BCL_WORLD_AMPLIFIED, createAmplified(ctx));
|
||||
bootstrapContext.register(PresetsRegistry.BCL_WORLD_17, createLegacy(ctx));
|
||||
}
|
||||
|
||||
private static WorldPreset createLegacy(WorldPresets.BootstrapData ctx) {
|
||||
return buildPreset(
|
||||
ctx.overworldStem,
|
||||
ctx.netherContext,
|
||||
BCLNetherBiomeSourceConfig.MINECRAFT_17, ctx.endContext,
|
||||
BCLEndBiomeSourceConfig.MINECRAFT_17
|
||||
);
|
||||
}
|
||||
|
||||
private static WorldPreset createAmplified(WorldPresets.BootstrapData ctx) {
|
||||
Holder<NoiseGeneratorSettings> amplifiedBiomeGenerator = ctx.noiseSettings
|
||||
.getOrThrow(NoiseGeneratorSettings.AMPLIFIED);
|
||||
|
||||
WorldGenUtil.Context amplifiedNetherContext = new WorldGenUtil.Context(
|
||||
ctx.netherContext.biomes,
|
||||
ctx.netherContext.bclBiomes,
|
||||
ctx.netherContext.dimension,
|
||||
ctx.netherContext.structureSets,
|
||||
ctx.noiseSettings.getOrThrow(BCLChunkGenerator.AMPLIFIED_NETHER)
|
||||
);
|
||||
|
||||
return buildPreset(
|
||||
ctx.makeNoiseBasedOverworld(
|
||||
ctx.overworldStem.generator().getBiomeSource(),
|
||||
amplifiedBiomeGenerator
|
||||
),
|
||||
amplifiedNetherContext, BCLNetherBiomeSourceConfig.MINECRAFT_18_AMPLIFIED,
|
||||
ctx.endContext, BCLEndBiomeSourceConfig.MINECRAFT_18_AMPLIFIED
|
||||
);
|
||||
}
|
||||
|
||||
private static WorldPreset createLarge(WorldPresets.BootstrapData ctx) {
|
||||
Holder<NoiseGeneratorSettings> largeBiomeGenerator = ctx.noiseSettings
|
||||
.getOrThrow(NoiseGeneratorSettings.LARGE_BIOMES);
|
||||
return buildPreset(
|
||||
ctx.makeNoiseBasedOverworld(
|
||||
ctx.overworldStem.generator().getBiomeSource(),
|
||||
largeBiomeGenerator
|
||||
),
|
||||
ctx.netherContext, BCLNetherBiomeSourceConfig.MINECRAFT_18_LARGE,
|
||||
ctx.endContext, BCLEndBiomeSourceConfig.MINECRAFT_18_LARGE
|
||||
);
|
||||
}
|
||||
|
||||
private static WorldPreset createNormal(WorldPresets.BootstrapData ctx) {
|
||||
return buildPreset(
|
||||
ctx.overworldStem,
|
||||
ctx.netherContext, BCLNetherBiomeSourceConfig.DEFAULT,
|
||||
ctx.endContext, BCLEndBiomeSourceConfig.DEFAULT
|
||||
);
|
||||
}
|
||||
|
||||
private static TogetherWorldPreset buildPreset(
|
||||
LevelStem overworldStem,
|
||||
WorldGenUtil.Context netherContext,
|
||||
BCLNetherBiomeSourceConfig netherConfig,
|
||||
WorldGenUtil.Context endContext,
|
||||
BCLEndBiomeSourceConfig endConfig
|
||||
) {
|
||||
return new TogetherWorldPreset(buildDimensionMap(
|
||||
overworldStem, netherContext, netherConfig, endContext, endConfig
|
||||
), 1000);
|
||||
}
|
||||
|
||||
public static Map<ResourceKey<LevelStem>, LevelStem> buildDimensionMap(
|
||||
LevelStem overworldStem,
|
||||
WorldGenUtil.Context netherContext,
|
||||
BCLNetherBiomeSourceConfig netherConfig,
|
||||
WorldGenUtil.Context endContext,
|
||||
BCLEndBiomeSourceConfig endConfig
|
||||
) {
|
||||
return Map.of(
|
||||
LevelStem.OVERWORLD,
|
||||
overworldStem,
|
||||
LevelStem.NETHER,
|
||||
LevelGenUtil.getBCLNetherLevelStem(netherContext, netherConfig),
|
||||
LevelStem.END,
|
||||
LevelGenUtil.getBCLEndLevelStem(endContext, endConfig)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addTags(HolderLookup.Provider arg) {
|
||||
final FabricTagProvider<WorldPreset>.FabricTagBuilder builder = getOrCreateTagBuilder(WorldPresetTags.NORMAL);
|
||||
builder.add(PresetsRegistry.BCL_WORLD);
|
||||
builder.add(PresetsRegistry.BCL_WORLD_AMPLIFIED);
|
||||
builder.add(PresetsRegistry.BCL_WORLD_LARGE);
|
||||
}
|
||||
}
|
|
@ -1,9 +1,10 @@
|
|||
package org.betterx.bclib.datagen;
|
||||
package org.betterx.datagen.bclib.tests;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiome;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeBuilder;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeContainer;
|
||||
import org.betterx.datagen.bclib.BCLibDatagen;
|
||||
|
||||
import net.minecraft.data.worldgen.BootstapContext;
|
||||
import net.minecraft.world.level.biome.Biome;
|
|
@ -1,8 +1,9 @@
|
|||
package org.betterx.bclib.datagen;
|
||||
package org.betterx.datagen.bclib.tests;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.v3.levelgen.features.BCLConfigureFeature;
|
||||
import org.betterx.bclib.api.v3.levelgen.features.BCLFeatureBuilder;
|
||||
import org.betterx.datagen.bclib.BCLibDatagen;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.registries.Registries;
|
|
@ -1,7 +1,8 @@
|
|||
package org.betterx.bclib.datagen;
|
||||
package org.betterx.datagen.bclib.tests;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.v3.levelgen.features.BCLFeature;
|
||||
import org.betterx.datagen.bclib.BCLibDatagen;
|
||||
|
||||
import net.minecraft.data.worldgen.BootstapContext;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep;
|
|
@ -1,4 +1,6 @@
|
|||
package org.betterx.bclib.datagen;
|
||||
package org.betterx.datagen.bclib.tests;
|
||||
|
||||
import org.betterx.datagen.bclib.BCLibDatagen;
|
||||
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.core.registries.Registries;
|
|
@ -1,4 +1,4 @@
|
|||
package org.betterx.bclib.datagen;
|
||||
package org.betterx.datagen.bclib.worldgen;
|
||||
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeRegistry;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BiomeData;
|
||||
|
@ -29,13 +29,14 @@ import java.util.List;
|
|||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class CustomRegistriesDataProvider implements DataProvider {
|
||||
public class BCLibRegistriesDataProvider implements DataProvider {
|
||||
public static final List<RegistryDataLoader.RegistryData<?>> REGISTRIES = List.of(
|
||||
new RegistryDataLoader.RegistryData<>(BCLBiomeRegistry.BCL_BIOMES_REGISTRY, BiomeData.CODEC),
|
||||
new RegistryDataLoader.RegistryData<>(
|
||||
SurfaceRuleRegistry.SURFACE_RULES_REGISTRY,
|
||||
AssignedSurfaceRule.CODEC
|
||||
)
|
||||
//new RegistryDataLoader.RegistryData<>(Registries.WORLD_PRESET, WorldPreset.DIRECT_CODEC)
|
||||
// new RegistryDataLoader.RegistryData<>(Registries.BIOME, Biome.DIRECT_CODEC),
|
||||
// new RegistryDataLoader.RegistryData<>(Registries.CONFIGURED_FEATURE, ConfiguredFeature.DIRECT_CODEC),
|
||||
// new RegistryDataLoader.RegistryData<>(Registries.PLACED_FEATURE, PlacedFeature.DIRECT_CODEC),
|
||||
|
@ -45,7 +46,7 @@ public class CustomRegistriesDataProvider implements DataProvider {
|
|||
|
||||
private final PackOutput output;
|
||||
|
||||
public CustomRegistriesDataProvider(FabricDataOutput generator) {
|
||||
public BCLibRegistriesDataProvider(FabricDataOutput generator) {
|
||||
this.output = generator;
|
||||
}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
package org.betterx.bclib.datagen;
|
||||
package org.betterx.datagen.bclib.worldgen;
|
||||
|
||||
import org.betterx.bclib.api.v2.generator.BCLChunkGenerator;
|
||||
|
||||
import net.minecraft.data.worldgen.BootstapContext;
|
||||
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
|
||||
|
||||
public class NoiseDatagen {
|
||||
public class NoiseTypesDataProvider {
|
||||
public static void bootstrap(BootstapContext<NoiseGeneratorSettings> bootstrapContext) {
|
||||
bootstrapContext.register(
|
||||
BCLChunkGenerator.AMPLIFIED_NETHER,
|
|
@ -1,4 +1,4 @@
|
|||
package org.betterx.bclib.datagen;
|
||||
package org.betterx.datagen.bclib.worldgen;
|
||||
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeRegistry;
|
||||
import org.betterx.worlds.together.surfaceRules.SurfaceRuleRegistry;
|
||||
|
@ -11,8 +11,8 @@ import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider
|
|||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class WorldgenProvider extends FabricDynamicRegistryProvider {
|
||||
public WorldgenProvider(
|
||||
public class WorldgenRegistriesDataProvider extends FabricDynamicRegistryProvider {
|
||||
public WorldgenRegistriesDataProvider(
|
||||
FabricDataOutput output,
|
||||
CompletableFuture<HolderLookup.Provider> registriesFuture
|
||||
) {
|
|
@ -1,5 +0,0 @@
|
|||
package org.betterx.worlds.together.entrypoints;
|
||||
|
||||
public interface WorldPresetBootstrap extends WorldsTogetherEntrypoint {
|
||||
void bootstrapWorldPresets();
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package org.betterx.worlds.together.levelgen;
|
||||
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiome;
|
||||
import org.betterx.worlds.together.WorldsTogether;
|
||||
import org.betterx.worlds.together.biomesource.BiomeSourceWithConfig;
|
||||
import org.betterx.worlds.together.biomesource.ReloadableBiomeSource;
|
||||
|
@ -100,15 +101,18 @@ public class WorldGenUtil {
|
|||
|
||||
public static class Context extends StemContext {
|
||||
public final HolderGetter<Biome> biomes;
|
||||
public final HolderGetter<BCLBiome> bclBiomes;
|
||||
|
||||
public Context(
|
||||
HolderGetter<Biome> biomes,
|
||||
HolderGetter<BCLBiome> bclBiomes,
|
||||
Holder<DimensionType> dimension,
|
||||
HolderGetter<StructureSet> structureSets,
|
||||
Holder<NoiseGeneratorSettings> generatorSettings
|
||||
) {
|
||||
super(dimension, structureSets, generatorSettings);
|
||||
this.biomes = biomes;
|
||||
this.bclBiomes = bclBiomes;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,8 +20,6 @@ import java.util.function.Function;
|
|||
|
||||
@Mixin(WorldPreset.class)
|
||||
public class WorldPresetMixin {
|
||||
|
||||
|
||||
@ModifyArg(method = "<clinit>", at = @At(value = "INVOKE", target = "Lcom/mojang/serialization/codecs/RecordCodecBuilder;create(Ljava/util/function/Function;)Lcom/mojang/serialization/Codec;"))
|
||||
private static Function<RecordCodecBuilder.Instance<WorldPreset>, ? extends App<RecordCodecBuilder.Mu<WorldPreset>, WorldPreset>> foo(
|
||||
Function<RecordCodecBuilder.Instance<WorldPreset>, ? extends App<RecordCodecBuilder.Mu<WorldPreset>, WorldPreset>> builder
|
||||
|
|
|
@ -1,97 +0,0 @@
|
|||
package org.betterx.worlds.together.mixin.common;
|
||||
|
||||
import org.betterx.worlds.together.levelgen.WorldGenUtil;
|
||||
import org.betterx.worlds.together.worldPreset.WorldPresets;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.HolderGetter;
|
||||
import net.minecraft.data.worldgen.BootstapContext;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.BiomeSource;
|
||||
import net.minecraft.world.level.dimension.LevelStem;
|
||||
import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
import net.minecraft.world.level.levelgen.presets.WorldPreset;
|
||||
import net.minecraft.world.level.levelgen.structure.StructureSet;
|
||||
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
|
||||
@Mixin(net.minecraft.world.level.levelgen.presets.WorldPresets.Bootstrap.class)
|
||||
public abstract class WorldPresetsBootstrapMixin {
|
||||
@Shadow
|
||||
@Final
|
||||
private HolderGetter<Biome> biomes;
|
||||
@Shadow
|
||||
@Final
|
||||
private HolderGetter<StructureSet> structureSets;
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private BootstapContext<WorldPreset> context;
|
||||
@Shadow
|
||||
@Final
|
||||
private HolderGetter<PlacedFeature> placedFeatures;
|
||||
@Shadow
|
||||
@Final
|
||||
private LevelStem netherStem;
|
||||
@Shadow
|
||||
@Final
|
||||
private LevelStem endStem;
|
||||
//see WorldPresets.register
|
||||
|
||||
@Shadow
|
||||
protected abstract LevelStem makeNoiseBasedOverworld(
|
||||
BiomeSource biomeSource,
|
||||
Holder<NoiseGeneratorSettings> holder
|
||||
);
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private HolderGetter<NoiseGeneratorSettings> noiseSettings;
|
||||
|
||||
@ModifyArg(method = "run", at = @At(value = "INVOKE", ordinal = 0, target = "Lnet/minecraft/world/level/levelgen/presets/WorldPresets$Bootstrap;registerCustomOverworldPreset(Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/world/level/dimension/LevelStem;)V"))
|
||||
private LevelStem bcl_getOverworldStem(LevelStem overworldStem) {
|
||||
Holder<NoiseGeneratorSettings> netherSettings, endSettings;
|
||||
if (this.netherStem.generator() instanceof NoiseBasedChunkGenerator nether) {
|
||||
netherSettings = nether.generatorSettings();
|
||||
} else {
|
||||
netherSettings = this.noiseSettings.getOrThrow(NoiseGeneratorSettings.NETHER);
|
||||
}
|
||||
|
||||
if (this.endStem.generator() instanceof NoiseBasedChunkGenerator nether) {
|
||||
endSettings = nether.generatorSettings();
|
||||
} else {
|
||||
endSettings = this.noiseSettings.getOrThrow(NoiseGeneratorSettings.END);
|
||||
}
|
||||
|
||||
WorldGenUtil.Context netherContext = new WorldGenUtil.Context(
|
||||
this.biomes,
|
||||
this.netherStem.type(),
|
||||
this.structureSets,
|
||||
netherSettings
|
||||
);
|
||||
WorldGenUtil.Context endContext = new WorldGenUtil.Context(
|
||||
this.biomes,
|
||||
this.endStem.type(),
|
||||
this.structureSets,
|
||||
endSettings
|
||||
);
|
||||
|
||||
WorldPresets.bootstrapPresets(
|
||||
context,
|
||||
overworldStem,
|
||||
netherContext,
|
||||
endContext,
|
||||
noiseSettings,
|
||||
this::makeNoiseBasedOverworld
|
||||
);
|
||||
|
||||
return overworldStem;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,12 +1,8 @@
|
|||
package org.betterx.worlds.together.worldPreset;
|
||||
|
||||
import org.betterx.worlds.together.WorldsTogether;
|
||||
import org.betterx.worlds.together.entrypoints.EntrypointUtil;
|
||||
import org.betterx.worlds.together.entrypoints.WorldPresetBootstrap;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiome;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeRegistry;
|
||||
import org.betterx.worlds.together.levelgen.WorldGenUtil;
|
||||
import org.betterx.worlds.together.tag.v3.TagManager;
|
||||
import org.betterx.worlds.together.tag.v3.TagRegistry;
|
||||
import org.betterx.worlds.together.worldPreset.client.WorldPresetsClient;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.HolderGetter;
|
||||
|
@ -15,28 +11,23 @@ import net.minecraft.core.registries.Registries;
|
|||
import net.minecraft.data.worldgen.BootstapContext;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.WorldPresetTags;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.BiomeSource;
|
||||
import net.minecraft.world.level.biome.MultiNoiseBiomeSource;
|
||||
import net.minecraft.world.level.biome.TheEndBiomeSource;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
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.NoiseBasedChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
import net.minecraft.world.level.levelgen.presets.WorldPreset;
|
||||
import net.minecraft.world.level.levelgen.structure.StructureSet;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import java.util.Map;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
public class WorldPresets {
|
||||
@FunctionalInterface
|
||||
public interface OverworldBuilder {
|
||||
LevelStem make(BiomeSource biomeSource, Holder<NoiseGeneratorSettings> noiseGeneratorSettings);
|
||||
}
|
||||
|
||||
private static Map<ResourceKey<WorldPreset>, PresetBuilder> BUILDERS = Maps.newHashMap();
|
||||
|
||||
public static final TagRegistry.UnTyped<WorldPreset> WORLD_PRESETS =
|
||||
TagManager.registerType(Registries.WORLD_PRESET, "tags/worldgen/world_preset");
|
||||
|
||||
private static ResourceKey<WorldPreset> DEFAULT = net.minecraft.world.level.levelgen.presets.WorldPresets.NORMAL;
|
||||
|
||||
public static Holder<WorldPreset> get(RegistryAccess access, ResourceKey<WorldPreset> key) {
|
||||
|
@ -45,28 +36,6 @@ public class WorldPresets {
|
|||
.getHolderOrThrow(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a custom WorldPreset (with custom rules and behaviour)
|
||||
* <p>
|
||||
* See also {@link WorldPresetsClient} if you need to add a Customize Button/Screen
|
||||
* for your preset
|
||||
*
|
||||
* @param loc The ID of your Preset
|
||||
* @param visibleInUI if true, the preset will show up in the UI on world creataion
|
||||
* @return The key you may use to reference your new Preset
|
||||
*/
|
||||
private static ResourceKey<WorldPreset> register(ResourceKey<WorldPreset> key, boolean visibleInUI) {
|
||||
//ResourceKey<WorldPreset> key = ResourceKey.create(Registries.WORLD_PRESET, loc);
|
||||
if (visibleInUI) {
|
||||
if (!didExplicitlySetDefault && DEFAULT == net.minecraft.world.level.levelgen.presets.WorldPresets.NORMAL) {
|
||||
DEFAULT = key;
|
||||
}
|
||||
WORLD_PRESETS.addUntyped(WorldPresetTags.NORMAL, key.location());
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
public static void ensureStaticallyLoaded() {
|
||||
|
||||
}
|
||||
|
@ -75,68 +44,99 @@ public class WorldPresets {
|
|||
return ResourceKey.create(Registries.WORLD_PRESET, loc);
|
||||
}
|
||||
|
||||
public static ResourceKey<WorldPreset> register(
|
||||
ResourceKey<WorldPreset> loc,
|
||||
PresetBuilder builder,
|
||||
boolean visibleInUI
|
||||
) {
|
||||
ResourceKey<WorldPreset> key = register(loc, visibleInUI);
|
||||
|
||||
if (BUILDERS == null) {
|
||||
WorldsTogether.LOGGER.error("Unable to register WorldPreset '" + loc + "'.");
|
||||
|
||||
} else {
|
||||
BUILDERS.put(key, builder);
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
public static void bootstrapPresets(
|
||||
BootstapContext<WorldPreset> bootstrapContext,
|
||||
LevelStem overworldStem,
|
||||
WorldGenUtil.Context netherContext,
|
||||
WorldGenUtil.Context endContext,
|
||||
HolderGetter<NoiseGeneratorSettings> noiseSettings,
|
||||
OverworldBuilder noiseBasedOverworld
|
||||
) {
|
||||
if (BUILDERS == null)
|
||||
return;
|
||||
EntrypointUtil.getCommon(WorldPresetBootstrap.class)
|
||||
.forEach(e -> e.bootstrapWorldPresets());
|
||||
|
||||
for (Map.Entry<ResourceKey<WorldPreset>, PresetBuilder> e : BUILDERS.entrySet()) {
|
||||
TogetherWorldPreset preset = e.getValue()
|
||||
.create(
|
||||
overworldStem, netherContext, endContext,
|
||||
noiseSettings, noiseBasedOverworld
|
||||
);
|
||||
bootstrapContext.register(e.getKey(), preset);
|
||||
}
|
||||
BUILDERS = null;
|
||||
}
|
||||
|
||||
public static ResourceKey<WorldPreset> getDEFAULT() {
|
||||
return DEFAULT;
|
||||
}
|
||||
|
||||
private static boolean didExplicitlySetDefault = false;
|
||||
|
||||
@ApiStatus.Internal
|
||||
public static void setDEFAULT(ResourceKey<WorldPreset> DEFAULT) {
|
||||
didExplicitlySetDefault = true;
|
||||
WorldPresets.DEFAULT = DEFAULT;
|
||||
}
|
||||
|
||||
public static class BootstrapData {
|
||||
public final HolderGetter<NoiseGeneratorSettings> noiseSettings;
|
||||
public final HolderGetter<Biome> biomes;
|
||||
public final HolderGetter<PlacedFeature> placedFeatures;
|
||||
public final HolderGetter<StructureSet> structureSets;
|
||||
public final LevelStem netherStem;
|
||||
public final LevelStem endStem;
|
||||
public final LevelStem overworldStem;
|
||||
public final Holder<DimensionType> netherDimensionType;
|
||||
public final Holder<DimensionType> endDimensionType;
|
||||
public final Holder<DimensionType> overworldDimensionType;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface PresetBuilder {
|
||||
TogetherWorldPreset create(
|
||||
LevelStem overworldStem,
|
||||
WorldGenUtil.Context netherContext,
|
||||
WorldGenUtil.Context endContext,
|
||||
HolderGetter<NoiseGeneratorSettings> noiseSettings,
|
||||
OverworldBuilder noiseBasedOverworld
|
||||
public final WorldGenUtil.Context netherContext;
|
||||
public final WorldGenUtil.Context endContext;
|
||||
|
||||
public BootstrapData(BootstapContext<WorldPreset> bootstapContext) {
|
||||
final HolderGetter<DimensionType> dimensionTypes = bootstapContext.lookup(Registries.DIMENSION_TYPE);
|
||||
|
||||
this.noiseSettings = bootstapContext.lookup(Registries.NOISE_SETTINGS);
|
||||
this.biomes = bootstapContext.lookup(Registries.BIOME);
|
||||
this.placedFeatures = bootstapContext.lookup(Registries.PLACED_FEATURE);
|
||||
this.structureSets = bootstapContext.lookup(Registries.STRUCTURE_SET);
|
||||
|
||||
this.overworldDimensionType = dimensionTypes.getOrThrow(BuiltinDimensionTypes.OVERWORLD);
|
||||
MultiNoiseBiomeSource overworldBiomeSource = MultiNoiseBiomeSource.Preset.OVERWORLD.biomeSource(this.biomes);
|
||||
Holder<NoiseGeneratorSettings> defaultOverworldNoise = this.noiseSettings.getOrThrow(NoiseGeneratorSettings.OVERWORLD);
|
||||
this.overworldStem = makeNoiseBasedOverworld(overworldBiomeSource, defaultOverworldNoise);
|
||||
|
||||
this.netherDimensionType = dimensionTypes.getOrThrow(BuiltinDimensionTypes.NETHER);
|
||||
Holder<NoiseGeneratorSettings> defaultNetherNoise = this.noiseSettings.getOrThrow(NoiseGeneratorSettings.NETHER);
|
||||
this.netherStem = new LevelStem(
|
||||
netherDimensionType,
|
||||
new NoiseBasedChunkGenerator(
|
||||
MultiNoiseBiomeSource.Preset.NETHER.biomeSource(this.biomes),
|
||||
defaultNetherNoise
|
||||
)
|
||||
);
|
||||
|
||||
this.endDimensionType = dimensionTypes.getOrThrow(BuiltinDimensionTypes.END);
|
||||
Holder<NoiseGeneratorSettings> defaultEndNoise = this.noiseSettings.getOrThrow(NoiseGeneratorSettings.END);
|
||||
this.endStem = new LevelStem(
|
||||
endDimensionType,
|
||||
new NoiseBasedChunkGenerator(TheEndBiomeSource.create(this.biomes), defaultEndNoise)
|
||||
);
|
||||
|
||||
|
||||
Holder<NoiseGeneratorSettings> netherSettings, endSettings;
|
||||
if (this.netherStem.generator() instanceof NoiseBasedChunkGenerator nether) {
|
||||
netherSettings = nether.generatorSettings();
|
||||
} else {
|
||||
netherSettings = this.noiseSettings.getOrThrow(NoiseGeneratorSettings.NETHER);
|
||||
}
|
||||
|
||||
if (this.endStem.generator() instanceof NoiseBasedChunkGenerator nether) {
|
||||
endSettings = nether.generatorSettings();
|
||||
} else {
|
||||
endSettings = this.noiseSettings.getOrThrow(NoiseGeneratorSettings.END);
|
||||
}
|
||||
|
||||
HolderGetter<BCLBiome> bclBiomes = bootstapContext.lookup(BCLBiomeRegistry.BCL_BIOMES_REGISTRY);
|
||||
this.netherContext = new WorldGenUtil.Context(
|
||||
this.biomes,
|
||||
bclBiomes,
|
||||
this.netherStem.type(),
|
||||
this.structureSets,
|
||||
netherSettings
|
||||
);
|
||||
|
||||
this.endContext = new WorldGenUtil.Context(
|
||||
this.biomes,
|
||||
bclBiomes,
|
||||
this.endStem.type(),
|
||||
this.structureSets,
|
||||
endSettings
|
||||
);
|
||||
}
|
||||
|
||||
private LevelStem makeOverworld(ChunkGenerator chunkGenerator) {
|
||||
return new LevelStem(this.overworldDimensionType, chunkGenerator);
|
||||
}
|
||||
|
||||
public LevelStem makeNoiseBasedOverworld(BiomeSource biomeSource, Holder<NoiseGeneratorSettings> holder) {
|
||||
return this.makeOverworld(new NoiseBasedChunkGenerator(biomeSource, holder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ import java.util.Optional;
|
|||
public class WorldPresetsClient {
|
||||
public static void registerCustomizeUI(ResourceKey<WorldPreset> key, PresetEditor setupScreen) {
|
||||
if (setupScreen != null) {
|
||||
//TODO: 1.19.3 this is called out of order
|
||||
PresetEditor.EDITORS.put(Optional.of(key), setupScreen);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,14 +30,11 @@
|
|||
"modmenu": [
|
||||
"org.betterx.bclib.integration.modmenu.ModMenuEntryPoint"
|
||||
],
|
||||
"worlds_together": [
|
||||
"org.betterx.bclib.registry.PresetsRegistry"
|
||||
],
|
||||
"emi": [
|
||||
"org.betterx.bclib.integration.emi.EMIPlugin"
|
||||
],
|
||||
"fabric-datagen": [
|
||||
"org.betterx.bclib.datagen.BCLibDatagen"
|
||||
"org.betterx.datagen.bclib.BCLibDatagen"
|
||||
]
|
||||
},
|
||||
"accessWidener": "bclib.accesswidener",
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
"WorldLoaderMixin",
|
||||
"WorldPresetAccessor",
|
||||
"WorldPresetMixin",
|
||||
"WorldPresetsBootstrapMixin",
|
||||
"WorldStem_Mixin"
|
||||
],
|
||||
"injectors": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue