Java 类cpw.mods.fml.common.IScheduledTickHandler 实例源码

项目:RuneCraftery    文件:TickRegistry.java   
public static void updateTickQueue(List<IScheduledTickHandler> ticks, Side side)
{
    synchronized (ticks)
    {
        ticks.clear();
        long tick = getCounter(side).incrementAndGet();
        PriorityQueue<TickQueueElement> tickHandlers = getQueue(side);

        while (true)
        {
            if (tickHandlers.size()==0 || !tickHandlers.peek().scheduledNow(tick))
            {
                break;
            }
            TickRegistry.TickQueueElement tickQueueElement  = tickHandlers.poll();
            tickQueueElement.update(tick);
            tickHandlers.offer(tickQueueElement);
            ticks.add(tickQueueElement.ticker);
        }
    }
}
项目:RuneCraftery    文件:TickRegistry.java   
public static void updateTickQueue(List<IScheduledTickHandler> ticks, Side side)
{
    synchronized (ticks)
    {
        ticks.clear();
        long tick = getCounter(side).incrementAndGet();
        PriorityQueue<TickQueueElement> tickHandlers = getQueue(side);

        while (true)
        {
            if (tickHandlers.size()==0 || !tickHandlers.peek().scheduledNow(tick))
            {
                break;
            }
            TickRegistry.TickQueueElement tickQueueElement  = tickHandlers.poll();
            tickQueueElement.update(tick);
            tickHandlers.offer(tickQueueElement);
            ticks.add(tickQueueElement.ticker);
        }
    }
}
项目:BetterNutritionMod    文件:TickRegistry.java   
public static void updateTickQueue(List<IScheduledTickHandler> ticks, Side side)
{
    synchronized (ticks)
    {
        ticks.clear();
        long tick = getCounter(side).incrementAndGet();
        PriorityQueue<TickQueueElement> tickHandlers = getQueue(side);

        while (true)
        {
            if (tickHandlers.size()==0 || !tickHandlers.peek().scheduledNow(tick))
            {
                break;
            }
            TickRegistry.TickQueueElement tickQueueElement  = tickHandlers.poll();
            tickQueueElement.update(tick);
            tickHandlers.offer(tickQueueElement);
            ticks.add(tickQueueElement.ticker);
        }
    }
}
项目:RuneCraftery    文件:TickRegistry.java   
public TickQueueElement(IScheduledTickHandler ticker, long tickCounter)
{
    this.ticker = ticker;
    update(tickCounter);
}
项目:RuneCraftery    文件:TickRegistry.java   
public static void registerScheduledTickHandler(IScheduledTickHandler handler, Side side)
{
    getQueue(side).add(new TickQueueElement(handler, getCounter(side).get()));
}
项目:RuneCraftery    文件:TickRegistry.java   
public TickQueueElement(IScheduledTickHandler ticker, long tickCounter)
{
    this.ticker = ticker;
    update(tickCounter);
}
项目:RuneCraftery    文件:TickRegistry.java   
public static void registerScheduledTickHandler(IScheduledTickHandler handler, Side side)
{
    getQueue(side).add(new TickQueueElement(handler, getCounter(side).get()));
}
项目:BetterNutritionMod    文件:TickRegistry.java   
public TickQueueElement(IScheduledTickHandler ticker, long tickCounter)
{
    this.ticker = ticker;
    update(tickCounter);
}
项目:BetterNutritionMod    文件:TickRegistry.java   
public static void registerScheduledTickHandler(IScheduledTickHandler handler, Side side)
{
    getQueue(side).add(new TickQueueElement(handler, getCounter(side).get()));
}