package info.u_team.u_team_core.util.registry;

import java.util.function.Consumer;

import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

public class BusRegistry {
	
	public static void registerMod(Consumer<IEventBus> consumer) {
		register(FMLJavaModLoadingContext.get().getModEventBus(), consumer);
	}
	
	public static void registerForge(Consumer<IEventBus> consumer) {
		register(MinecraftForge.EVENT_BUS, consumer);
	}
	
	public static void registerForge(Bus bus, Consumer<IEventBus> consumer) {
		register(bus.bus().get(), consumer);
	}
	
	public static void register(IEventBus bus, Consumer<IEventBus> consumer) {
		consumer.accept(bus);
	}
	
}

@@ -82,57 +82,8 @@
 r;%0A%0A
-import net.minecraftforge.common.MinecraftForge;%0A
 impo
@@ -196,75 +196,8 @@
 Bus;
-%0Aimport net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
 %0A%0Apu
@@ -302,55 +302,15 @@
 ter(
-FMLJavaModLoadingContext.get().getModEventBus()
+Bus.MOD
 , co
@@ -404,32 +404,17 @@
 ter(
-MinecraftForge.EVENT_BUS
+Bus.FORGE
 , co
@@ -455,21 +455,16 @@
 register
-Forge
 (Bus bus

Refactor and make it a bit easier to read