package info.u_team.u_team_core.util.registry;

import java.util.function.Supplier;

import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.*;

public class BlockDeferredRegister {
	
	public final DeferredRegister<Block> blocks;
	public final DeferredRegister<Item> items;
	
	public BlockDeferredRegister(String modid) {
		blocks = DeferredRegister.create(ForgeRegistries.BLOCKS, modid);
		items = DeferredRegister.create(ForgeRegistries.ITEMS, modid);
	}
	
	public <I extends Block> RegistryObject<I> registerCommon(String name, Supplier<? extends I> supplier) {
		return blocks.register(name, supplier);
	}
	
	public void register(IEventBus bus) {
		blocks.register(bus);
		items.register(bus);
	}
	
}

@@ -78,16 +78,126 @@
 plier;%0A%0A
+import org.apache.commons.lang3.tuple.Pair;%0A%0Aimport info.u_team.u_team_core.api.registry.IUBlockRegistryType;%0A
 import n
@@ -850,32 +850,307 @@
 supplier);%0A%09%7D%0A%09%0A
+%09public %3CI extends Block & IUBlockRegistryType%3E Pair%3CRegistryObject%3CI%3E, RegistryObject%3C? extends Item%3E%3E register(String name, Supplier%3C? extends I%3E supplier) %7B%0A%09%09return Pair.of(blocks.register(name, supplier), items.register(name, () -%3E supplier.get().getBlockItem()));%0A%09%7D%0A%09%0A
 %09public void reg

Add register method for both