Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CommonProxy {
- public CommonProxy() {
- // Life-cycle events
- final IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
- modEventBus.addListener(CommonProxy::commonSetup);
- // Other events
- MinecraftForge.EVENT_BUS.register(this);
- }
- private static void commonSetup(FMLCommonSetupEvent event) {
- DeferredWorkQueue.runLater(() -> {
- CapabilityManager.INSTANCE.register(IModTag.class, new ModTagStorage(), ModTagProvider::new);
- });
- }
- static class ClientProxy extends CommonProxy {
- ClientProxy() {
- final IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
- modEventBus.addListener(ClientProxy::clientSetup);
- modEventBus.addListener(ModEvents::registerItemColor);
- }
- private static void clientSetup(FMLClientSetupEvent event) { }
- }
- static class ServerProxy extends CommonProxy {
- ServerProxy() {
- final IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
- modEventBus.addListener(ServerProxy::serverSetup);
- }
- private static void serverSetup(FMLDedicatedServerSetupEvent event) { }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement