2019-09-03 08:34:02 +02:00
|
|
|
package com.simibubi.create;
|
|
|
|
|
2019-09-03 23:03:52 +02:00
|
|
|
import net.minecraft.world.IWorld;
|
2019-09-03 08:34:02 +02:00
|
|
|
import net.minecraftforge.event.TickEvent.Phase;
|
|
|
|
import net.minecraftforge.event.TickEvent.ServerTickEvent;
|
2019-09-03 23:03:52 +02:00
|
|
|
import net.minecraftforge.event.world.WorldEvent;
|
2019-09-03 08:34:02 +02:00
|
|
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|
|
|
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
|
|
|
|
import net.minecraftforge.fml.event.server.FMLServerStoppingEvent;
|
|
|
|
|
|
|
|
@EventBusSubscriber
|
|
|
|
public class Events {
|
|
|
|
|
|
|
|
@SubscribeEvent
|
|
|
|
public static void onTick(ServerTickEvent event) {
|
|
|
|
if (event.phase == Phase.START)
|
|
|
|
return;
|
|
|
|
|
|
|
|
Create.tick();
|
|
|
|
}
|
|
|
|
|
|
|
|
@SubscribeEvent
|
|
|
|
public static void onClose(FMLServerStoppingEvent event) {
|
|
|
|
Create.shutdown();
|
|
|
|
}
|
|
|
|
|
2019-09-03 23:03:52 +02:00
|
|
|
@SubscribeEvent
|
|
|
|
public static void onLoadWorld(WorldEvent.Load event) {
|
|
|
|
IWorld world = event.getWorld();
|
|
|
|
Create.itemProcessingHandler.onLoadWorld(world);
|
|
|
|
Create.frequencyHandler.onLoadWorld(world);
|
|
|
|
}
|
|
|
|
|
|
|
|
@SubscribeEvent
|
|
|
|
public static void onUnloadWorld(WorldEvent.Unload event) {
|
|
|
|
IWorld world = event.getWorld();
|
|
|
|
Create.itemProcessingHandler.onUnloadWorld(world);
|
|
|
|
Create.frequencyHandler.onUnloadWorld(world);
|
|
|
|
|
|
|
|
}
|
2019-09-03 08:34:02 +02:00
|
|
|
|
|
|
|
}
|