Skip to content

Commit

Permalink
use proper registires, still issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
gnembon committed Mar 24, 2022
1 parent 7c353d4 commit 2743908
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/carpet/script/api/Auxiliary.java
Original file line number Diff line number Diff line change
Expand Up @@ -1119,13 +1119,13 @@ else if (fdesc.type == FileArgument.Type.JSON)
WorldLoader.InitConfig initConfig = new WorldLoader.InitConfig(new WorldLoader.PackConfig(resourcePackManager, dataPackSettings == null ? DataPackConfig.DEFAULT : dataPackSettings, false), Commands.CommandSelection.DEDICATED, 4);


final WorldData data = WorldLoader.load(initConfig, (resourceManager, dataPackConfigx) -> {
final WorldStem stem = WorldLoader.load(initConfig, (resourceManager, dataPackConfigx) -> {
RegistryAccess.Writable writable = RegistryAccess.builtinCopy();
DynamicOps<Tag> dynamicOps = RegistryOps.createAndLoad(NbtOps.INSTANCE, writable, (ResourceManager) resourceManager);
WorldData worldData = session.getDataTag(dynamicOps, dataPackConfigx, writable.allElementsLifecycle());
return Pair.of(worldData, writable.freeze());
}, WorldStem::new, Util.backgroundExecutor(), Runnable::run).join().worldData();
WorldGenSettings generatorOptions = data.worldGenSettings();
}, WorldStem::new, Util.backgroundExecutor(), Runnable::run).join();
WorldGenSettings generatorOptions = stem.worldData().worldGenSettings();

boolean bl = generatorOptions.isDebug();
long l = generatorOptions.seed();
Expand All @@ -1137,14 +1137,14 @@ else if (fdesc.type == FileArgument.Type.JSON)
if (!existing_worlds.containsKey(registryKey))
{
ResourceKey<Level> resourceKey2 = ResourceKey.create(Registry.DIMENSION_REGISTRY, registryKey.location());
DerivedLevelData derivedLevelData = new DerivedLevelData(data, ((ServerWorldInterface) server.overworld()).getWorldPropertiesCM());
DerivedLevelData derivedLevelData = new DerivedLevelData(stem.worldData(), ((ServerWorldInterface) server.overworld()).getWorldPropertiesCM());
ServerLevel serverLevel2 = new ServerLevel(server, Util.backgroundExecutor(), session, derivedLevelData, resourceKey2, entry.getValue(), WorldTools.NOOP_LISTENER, bl, m, ImmutableList.of(), false);
server.overworld().getWorldBorder().addListener(new BorderChangeListener.DelegateBorderChangeListener(serverLevel2.getWorldBorder()));
existing_worlds.put(resourceKey2, serverLevel2);
addeds.add(ValueConversions.of(registryKey.location()));
}
}
((MinecraftServerInterface)server).reloadAfterReload(data.registryAccess());
((MinecraftServerInterface)server).reloadAfterReload(stem.registryAccess());
return ListValue.wrap(addeds);
});
}
Expand Down

0 comments on commit 2743908

Please sign in to comment.