Handling for Datapack overrides (#20)
This commit is contained in:
parent
72e8d8ff0f
commit
c56c15fc02
2 changed files with 12 additions and 9 deletions
|
@ -79,8 +79,6 @@ public class LevelGenEvents {
|
||||||
|
|
||||||
//We probably loaded a Datapack for the End
|
//We probably loaded a Datapack for the End
|
||||||
if (!(endStem.generator().getBiomeSource() instanceof BCLibEndBiomeSource)) {
|
if (!(endStem.generator().getBiomeSource() instanceof BCLibEndBiomeSource)) {
|
||||||
|
|
||||||
|
|
||||||
if (currentPreset.isPresent()) {
|
if (currentPreset.isPresent()) {
|
||||||
if (currentPreset.get().value() instanceof TogetherWorldPreset worldPreset) {
|
if (currentPreset.get().value() instanceof TogetherWorldPreset worldPreset) {
|
||||||
ResourceKey worldPresetKey = currentPreset.get().unwrapKey().orElse(null);
|
ResourceKey worldPresetKey = currentPreset.get().unwrapKey().orElse(null);
|
||||||
|
|
|
@ -245,6 +245,10 @@ public class WorldGenUtil {
|
||||||
|
|
||||||
ChunkGenerator referenceGenerator = dimensions.get(key);
|
ChunkGenerator referenceGenerator = dimensions.get(key);
|
||||||
if (referenceGenerator instanceof EnforceableChunkGenerator enforcer) {
|
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
|
// This list contains the vanilla default level stem (only available if a new world is loaded) as well as
|
||||||
// The currently loaded stem
|
// The currently loaded stem
|
||||||
var vanillaDimensionMap = WorldGenUtil.getDimensionsWithModData(net.minecraft.world.level.levelgen.presets.WorldPresets.NORMAL);
|
var vanillaDimensionMap = WorldGenUtil.getDimensionsWithModData(net.minecraft.world.level.levelgen.presets.WorldPresets.NORMAL);
|
||||||
|
@ -253,6 +257,7 @@ public class WorldGenUtil {
|
||||||
if (vanillaDefaultStem != null) {
|
if (vanillaDefaultStem != null) {
|
||||||
loadedStem = vanillaDefaultStem;
|
loadedStem = vanillaDefaultStem;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// now compare the reference world settings (the ones that were created when the world was
|
// now compare the reference world settings (the ones that were created when the world was
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue