Handling for Datapack overrides (#20)

This commit is contained in:
Frank 2022-07-09 04:38:57 +02:00
parent 72e8d8ff0f
commit c56c15fc02
2 changed files with 12 additions and 9 deletions

View file

@ -79,8 +79,6 @@ public class LevelGenEvents {
//We probably loaded a Datapack for the End
if (!(endStem.generator().getBiomeSource() instanceof BCLibEndBiomeSource)) {
if (currentPreset.isPresent()) {
if (currentPreset.get().value() instanceof TogetherWorldPreset worldPreset) {
ResourceKey worldPresetKey = currentPreset.get().unwrapKey().orElse(null);

View file

@ -245,6 +245,10 @@ public class WorldGenUtil {
ChunkGenerator referenceGenerator = dimensions.get(key);
if (referenceGenerator instanceof EnforceableChunkGenerator enforcer) {
// probably not a datapack, so we need to check what other mods would have
// added to the vanilla settings
if (loadedStem.generator() instanceof EnforceableChunkGenerator) {
// This list contains the vanilla default level stem (only available if a new world is loaded) as well as
// The currently loaded stem
var vanillaDimensionMap = WorldGenUtil.getDimensionsWithModData(net.minecraft.world.level.levelgen.presets.WorldPresets.NORMAL);
@ -253,6 +257,7 @@ public class WorldGenUtil {
if (vanillaDefaultStem != null) {
loadedStem = vanillaDefaultStem;
}
}
// now compare the reference world settings (the ones that were created when the world was