Package nallar.patched.forge

Source Code of nallar.patched.forge.PatchTickRegistry

package nallar.patched.forge;

import cpw.mods.fml.common.IScheduledTickHandler;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.SingleIntervalHandler;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import nallar.tickthreading.Log;
import nallar.tickthreading.util.WrappedScheduledTickHandler;

public abstract class PatchTickRegistry extends TickRegistry {
  public static void registerScheduledTickHandler(IScheduledTickHandler handler, Side side) {
    if (handler.getClass().getName().toLowerCase().contains("version")) {
      Log.info("Skipping version tick handler " + Log.toString(handler));
      return;
    }
    getQueue(side).add(new TickQueueElement(new WrappedScheduledTickHandler(handler), getCounter(side).get()));
  }

  public static void registerTickHandler(ITickHandler handler, Side side) {
    if (handler.getClass().getName().toLowerCase().contains("version")) {
      Log.info("Skipping version tick handler " + Log.toString(handler));
      return;
    }
    registerScheduledTickHandler(new SingleIntervalHandler(handler), side);
  }
}
TOP

Related Classes of nallar.patched.forge.PatchTickRegistry

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.