From 644c3f591d42d91c8445b199202b37ba05b0bf93 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Tue, 17 Sep 2024 21:36:09 +0800 Subject: Use InstanceHelper to get registryAccess --- runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime') diff --git a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java index 3f99fa7cb..8f4738fe9 100644 --- a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java +++ b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java @@ -55,8 +55,10 @@ import me.shedaniel.rei.impl.common.plugins.ReloadManagerImpl; import me.shedaniel.rei.impl.common.registry.RecipeManagerContextImpl; import me.shedaniel.rei.impl.common.transfer.MenuInfoRegistryImpl; import me.shedaniel.rei.impl.common.transfer.SlotAccessorRegistryImpl; +import me.shedaniel.rei.impl.common.util.InstanceHelper; import me.shedaniel.rei.impl.init.PluginDetector; import me.shedaniel.rei.impl.init.PrimitivePlatformAdapter; +import net.minecraft.core.RegistryAccess; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.PackType; import net.minecraft.util.Unit; @@ -69,6 +71,7 @@ import java.util.Comparator; import java.util.ServiceLoader; import java.util.function.Consumer; import java.util.function.Function; +import java.util.function.Supplier; import java.util.function.UnaryOperator; @ApiStatus.Internal @@ -126,6 +129,7 @@ public class RoughlyEnoughItemsCore { Internals.attachInstanceSupplier(LOGGER, "logger"); CategoryIdentifierImpl.attach(); Internals.attachInstance((Function>) DeferringEntryTypeProviderImpl.INSTANCE, "entryTypeDeferred"); + Internals.attachInstance((Supplier) () -> InstanceHelper.getInstance().registryAccess(), "registryAccess"); Internals.attachInstance(EntryStackProviderImpl.INSTANCE, Internals.EntryStackProvider.class); Internals.attachInstance(NbtHasherProviderImpl.INSTANCE, Internals.NbtHasherProvider.class); Internals.attachInstance(EntryIngredientImpl.INSTANCE, Internals.EntryIngredientProvider.class); -- cgit