From 81c53d5db170e6347d9b93fdce2c574ce782170d Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Fri, 8 Nov 2024 23:44:28 -0800 Subject: [PATCH] only load vanilla pack for registry access --- src/api/java/baritone/api/utils/BlockOptionalMeta.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/api/java/baritone/api/utils/BlockOptionalMeta.java b/src/api/java/baritone/api/utils/BlockOptionalMeta.java index bca2875c3..ce8c41e96 100644 --- a/src/api/java/baritone/api/utils/BlockOptionalMeta.java +++ b/src/api/java/baritone/api/utils/BlockOptionalMeta.java @@ -37,6 +37,8 @@ import net.minecraft.server.level.progress.ChunkProgressListener; import net.minecraft.server.packs.PackType; import net.minecraft.server.packs.VanillaPackResources; +import net.minecraft.server.packs.repository.BuiltInPackSource; +import net.minecraft.server.packs.repository.Pack; import net.minecraft.server.packs.repository.PackRepository; import net.minecraft.server.packs.repository.ServerPacksSource; import net.minecraft.server.packs.resources.CloseableResourceManager; @@ -44,6 +46,7 @@ import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.world.RandomSequences; import net.minecraft.world.flag.FeatureFlagSet; +import net.minecraft.world.flag.FeatureFlags; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; @@ -306,14 +309,17 @@ public static Unsafe getUnsafe() { public static CompletableFuture load() { PackRepository packRepository = Minecraft.getInstance().getResourcePackRepository(); - CloseableResourceManager closeableResourceManager = new MultiPackResourceManager(PackType.SERVER_DATA, packRepository.openAllSelected()); + CloseableResourceManager closeableResourceManager = new MultiPackResourceManager( + PackType.SERVER_DATA, + List.of(packRepository.getPack(BuiltInPackSource.VANILLA_ID).open()) + ); LayeredRegistryAccess layeredRegistryAccess = loadAndReplaceLayer( closeableResourceManager, RegistryLayer.createRegistryAccess(), RegistryLayer.WORLDGEN, RegistryDataLoader.WORLDGEN_REGISTRIES ); return ReloadableServerResources.loadResources( closeableResourceManager, layeredRegistryAccess, - WorldDataConfiguration.DEFAULT.enabledFeatures(), + FeatureFlags.VANILLA_SET, Commands.CommandSelection.INTEGRATED, 2, Runnable::run,