Fix forge events

This commit is contained in:
Sollace 2019-05-24 16:57:16 +02:00
parent 60f2f9590f
commit 27df5a9f4c
2 changed files with 3 additions and 12 deletions

View file

@ -21,6 +21,6 @@ public class PonyMod {
@SubscribeEvent @SubscribeEvent
public void initOnClient(FMLClientSetupEvent event) { public void initOnClient(FMLClientSetupEvent event) {
new ForgeModMineLittlePony(); new ForgeModMineLittlePony(event.getMinecraftSupplier().get());
} }
} }

View file

@ -10,8 +10,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLPaths; import net.minecraftforge.fml.loading.FMLPaths;
@ -19,19 +17,12 @@ public class ForgeModMineLittlePony implements IModUtilities {
private final MineLPClient mlp = new MineLPClient(this); private final MineLPClient mlp = new MineLPClient(this);
public ForgeModMineLittlePony() { public ForgeModMineLittlePony(Minecraft mc) {
FMLJavaModLoadingContext.get().getModEventBus().register(this); FMLJavaModLoadingContext.get().getModEventBus().register(this);
MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent
private void init(final FMLCommonSetupEvent event) {
mlp.init(Config.of(FMLPaths.CONFIGDIR.get().resolve("minelittlepony.json"))); mlp.init(Config.of(FMLPaths.CONFIGDIR.get().resolve("minelittlepony.json")));
} mlp.postInit(mc);
@SubscribeEvent
private void posInit(FMLClientSetupEvent event) {
mlp.postInit(event.getMinecraftSupplier().get());
} }
@SubscribeEvent @SubscribeEvent