diff --git a/common/src/main/java/net/caffeinemc/mods/lithium/common/world/LithiumData.java b/common/src/main/java/net/caffeinemc/mods/lithium/common/world/LithiumData.java index 9577a697d..c57056b9a 100644 --- a/common/src/main/java/net/caffeinemc/mods/lithium/common/world/LithiumData.java +++ b/common/src/main/java/net/caffeinemc/mods/lithium/common/world/LithiumData.java @@ -6,6 +6,7 @@ import net.caffeinemc.mods.lithium.common.tracking.block.SectionedBlockChangeTracker; import net.caffeinemc.mods.lithium.common.tracking.entity.SectionedEntityMovementTracker; import net.caffeinemc.mods.lithium.common.util.deduplication.LithiumInterner; +import net.minecraft.core.HolderLookup; import net.minecraft.core.RegistryAccess; import net.minecraft.core.registries.Registries; import net.minecraft.world.entity.ai.navigation.PathNavigation; @@ -35,10 +36,10 @@ record Data( // Block ChunkSection listeners Long2ReferenceOpenHashMap chunkSectionChangeCallbacks ) { - public Data(Level world) { + public Data(HolderLookup.Provider registries) { this( new GameEventDispatcherStorage(), - Objects.requireNonNullElse(world.registryAccess(), RegistryAccess.EMPTY).lookup(Registries.BANNER_PATTERN).map(Raid::getLeaderBannerInstance).orElse(null), + Objects.requireNonNullElse(registries, RegistryAccess.EMPTY).lookup(Registries.BANNER_PATTERN).map(Raid::getLeaderBannerInstance).orElse(null), new ReferenceOpenHashSet<>(), new LithiumInterner<>(), new LithiumInterner<>(), diff --git a/common/src/main/java/net/caffeinemc/mods/lithium/mixin/util/data_storage/LevelMixin.java b/common/src/main/java/net/caffeinemc/mods/lithium/mixin/util/data_storage/LevelMixin.java index 8aee2dc10..28545bd88 100644 --- a/common/src/main/java/net/caffeinemc/mods/lithium/mixin/util/data_storage/LevelMixin.java +++ b/common/src/main/java/net/caffeinemc/mods/lithium/mixin/util/data_storage/LevelMixin.java @@ -22,7 +22,7 @@ public class LevelMixin implements LithiumData { @Inject(method = "", at = @At("RETURN")) private void initLithiumData(WritableLevelData properties, ResourceKey registryRef, RegistryAccess registryManager, Holder dimensionEntry, Supplier profiler, boolean isClient, boolean debugWorld, long biomeAccess, int maxChainedNeighborUpdates, CallbackInfo ci) { - this.storage = new Data((Level) (Object) this); + this.storage = new Data(registryManager); } @Override