Make sure Registry is loaded after Bukkit.setServer() (#8853)

This commit is contained in:
Jake Potrebic
2023-02-15 15:00:22 -08:00
parent f9e1ad2c2d
commit b15172bc8e
3 changed files with 17 additions and 17 deletions

View File

@@ -130,13 +130,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import net.minecraft.SharedConstants;
import net.minecraft.commands.Commands;
@@ -0,0 +0,0 @@ public abstract class AbstractTestingBase {
public static final Registry<Biome> BIOMES;
static {
LayeredRegistryAccess<RegistryLayer> layers = RegistryLayer.createRegistryAccess();
layers = WorldLoader.loadAndReplaceLayer(resourceManager, layers, RegistryLayer.WORLDGEN, RegistryDataLoader.WORLDGEN_REGISTRIES);
REGISTRY_CUSTOM = layers.compositeAccess().freeze();
+ io.papermc.paper.testing.DummyServer.setup(); // Paper
SharedConstants.tryDetectVersion();
Bootstrap.bootStrap();
// Set up resource manager
// Register vanilla pack
DATA_PACK = ReloadableServerResources.loadResources(resourceManager, REGISTRY_CUSTOM, FeatureFlags.REGISTRY.allFlags(), Commands.CommandSelection.DEDICATED, 0, MoreExecutors.directExecutor(), MoreExecutors.directExecutor()).join();
// Bind tags
@@ -0,0 +0,0 @@ public abstract class AbstractTestingBase {
// Biome shortcut
BIOMES = REGISTRY_CUSTOM.registryOrThrow(Registries.BIOME);