Search in sources :

Example 1 with IWorkerThread

use of com.builtbroken.mc.api.process.IWorkerThread in project Engine by VoltzEngine-Project.

the class CommandThreadClear method handleConsoleCommand.

@Override
public boolean handleConsoleCommand(ICommandSender sender, String[] args) {
    for (IWorkerThread thread : VoltzEngineAPI.WORKER_THREADS.values()) {
        if (thread != null) {
            int process = thread.containedProcesses();
            thread.clearProcesses();
            sender.addChatMessage(new ChatComponentText("Cleared " + process + " process from thread " + thread.toString()));
        }
    }
    return true;
}
Also used : IWorkerThread(com.builtbroken.mc.api.process.IWorkerThread) ChatComponentText(net.minecraft.util.ChatComponentText)

Example 2 with IWorkerThread

use of com.builtbroken.mc.api.process.IWorkerThread in project Engine by VoltzEngine-Project.

the class Engine method serverStopping.

@EventHandler
public void serverStopping(FMLServerStoppingEvent event) {
    // TODO save qued objects
    synchronized (VoltzEngineAPI.WORKER_THREADS) {
        for (IWorkerThread thread : VoltzEngineAPI.WORKER_THREADS.values()) {
            logger().info("Killing thread " + thread);
            thread.kill();
        }
    }
}
Also used : IWorkerThread(com.builtbroken.mc.api.process.IWorkerThread) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Aggregations

IWorkerThread (com.builtbroken.mc.api.process.IWorkerThread)2 EventHandler (cpw.mods.fml.common.Mod.EventHandler)1 ChatComponentText (net.minecraft.util.ChatComponentText)1