package net.darkhax.bookshelf.api.registry;

import net.darkhax.bookshelf.api.function.CachedSupplier;
import net.minecraft.resources.ResourceLocation;

import java.util.function.Supplier;

public class RegistryObject<T> extends CachedSupplier<T> implements IRegistryObject<T> {

    private final ResourceLocation id;

    protected RegistryObject(ResourceLocation id, Supplier<T> delegate) {

        super(delegate);
        this.id = id;
    }

    @Override
    public ResourceLocation getRegistryName() {

        return this.id;
    }
}
@@ -96,16 +96,52 @@
 pplier;%0A
+import net.minecraft.core.Registry;%0A
 import n
@@ -570,10 +570,359 @@
 d;%0A    %7D
+%0A%0A    public static %3CT%3E RegistryObject%3C?%3E deferred(Registry%3CT%3E registry, String namespace, String id) %7B%0A%0A        return deferred(registry, new ResourceLocation(namespace, id));%0A    %7D%0A%0A    public static %3CT%3E RegistryObject%3C?%3E deferred(Registry%3CT%3E registry, ResourceLocation id) %7B%0A%0A        return new RegistryObject%3C%3E(id, () -%3E registry.get(id));%0A    %7D
 %0A%7D

Add RegistryObject that does delayed registry lookups.