package info.u_team.u_team_test.init;

import info.u_team.u_team_core.tileentitytype.UTileEntityType;
import info.u_team.u_team_core.util.registry.BaseRegistryUtil;
import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.tileentity.*;
import net.minecraft.tileentity.TileEntityType;
import net.minecraftforge.event.RegistryEvent.Register;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;

@EventBusSubscriber(modid = TestMod.MODID, bus = Bus.MOD)
public class TestTileEntityTypes {
	
	public static final TileEntityType<BasicTileEntityTileEntity> BASIC = UTileEntityType.UBuilder.create("tileentity", BasicTileEntityTileEntity::new, TestBlocks.BASIC_TILEENTITY).build();
	
	public static final TileEntityType<BasicEnergyCreatorTileEntity> BASIC_ENERGY_CREATOR = UTileEntityType.UBuilder.create("energy_creator", BasicEnergyCreatorTileEntity::new, TestBlocks.BASIC_ENERGY_CREATOR).build();
	
	public static final TileEntityType<BasicFluidInventoryTileEntity> BASIC_FLUID_INVENTORY = UTileEntityType.UBuilder.create("fluid_inventory", BasicFluidInventoryTileEntity::new, TestBlocks.BASIC_FLUID_INVENTORY).build();
	
	@SubscribeEvent
	public static void register(Register<TileEntityType<?>> event) {
		BaseRegistryUtil.getAllGenericRegistryEntriesAndApplyNames(TestMod.MODID, TileEntityType.class).forEach(event.getRegistry()::register);
	}
	
}

@@ -99,71 +99,8 @@
 pe;%0A
-import info.u_team.u_team_core.util.registry.BaseRegistryUtil;%0A
 impo
@@ -135,16 +135,16 @@
 estMod;%0A
+
 import i
@@ -232,64 +232,8 @@
 pe;%0A
-import net.minecraftforge.event.RegistryEvent.Register;%0A
 impo
@@ -267,30 +267,25 @@
 bus.api.
-Subscribe
+I
 Event
+Bus
 ;%0Aimport
@@ -403,16 +403,56 @@
 ber.Bus;
+%0Aimport net.minecraftforge.registries.*;
 %0A%0A@Event
@@ -540,16 +540,166 @@
 pes %7B%0A%09%0A
+%09public static final DeferredRegister%3CTileEntityType%3C?%3E%3E TILE_ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, TestMod.MODID);%0A%09%0A
 %09public 
@@ -1324,25 +1324,8 @@
 ;%0A%09%0A
-%09@SubscribeEvent%0A
 %09pub
@@ -1353,180 +1353,57 @@
 ter(
-Register%3CTileEntityType%3C?%3E%3E event) %7B%0A%09%09BaseRegistryUtil.getAllGenericRegistryEntriesAndApplyNames(TestMod.MODID, TileEntityType.class).forEach(event.getRegistry()::register
+IEventBus bus) %7B%0A%09%09TILE_ENTITY_TYPES.register(bus
 );%0A%09

Add deferred register for tile entity types