Search in sources :

Example 1 with ServerTickEvent

use of net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent in project Random-Things by lumien231.

the class RTEventHandler method tick.

@SubscribeEvent
public void tick(TickEvent tickEvent) {
    if (tickEvent.type == TickEvent.Type.WORLD && tickEvent.phase == TickEvent.Phase.START) {
        World world = ((WorldTickEvent) tickEvent).world;
        FestivalHandler.get(world).tick(world);
    }
    if ((tickEvent.type == TickEvent.Type.CLIENT || tickEvent.type == TickEvent.Type.SERVER) && tickEvent.phase == TickEvent.Phase.END) {
        TileEntityRainShield.rainCache.clear();
    }
    if ((tickEvent.type == TickEvent.Type.CLIENT)) {
        clientAnimationCounter++;
    }
    if (tickEvent instanceof ServerTickEvent) {
        ServerModelLibrary.getInstance().tick();
    }
    if (tickEvent instanceof WorldTickEvent) {
        WorldTickEvent worldTickEvent = (WorldTickEvent) tickEvent;
        if (worldTickEvent.phase == Phase.END && !worldTickEvent.world.isRemote && worldTickEvent.world.provider.getDimension() == 0) {
            RedstoneSignalHandler.getHandler().tick();
        }
    }
}
Also used : WorldTickEvent(net.minecraftforge.fml.common.gameevent.TickEvent.WorldTickEvent) ServerTickEvent(net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent) World(net.minecraft.world.World) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

World (net.minecraft.world.World)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 ServerTickEvent (net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent)1 WorldTickEvent (net.minecraftforge.fml.common.gameevent.TickEvent.WorldTickEvent)1