forked from MagicBane/Server
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.5 KiB
42 lines
1.5 KiB
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . |
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· |
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ |
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ |
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ |
|
// Magicbane Emulator Project © 2013 - 2022 |
|
// www.magicbane.com |
|
|
|
|
|
package engine.mobileAI.Threads; |
|
import engine.objects.Mob; |
|
import org.pmw.tinylog.Logger; |
|
|
|
import java.util.concurrent.BlockingQueue; |
|
import java.util.concurrent.DelayQueue; |
|
|
|
public enum Respawner implements Runnable { |
|
RESPAWNER; |
|
public static BlockingQueue<Mob> respawnQueue = new DelayQueue(); |
|
|
|
@Override |
|
public void run() { |
|
|
|
while (true) { |
|
|
|
try { |
|
Mob mobile = respawnQueue.take(); |
|
mobile.respawn(); |
|
} catch (InterruptedException e) { |
|
Logger.error(e.toString()); |
|
} |
|
|
|
} |
|
} |
|
|
|
public static void start() { |
|
Thread respawnThread; |
|
respawnThread = new Thread(RESPAWNER); |
|
respawnThread.setName("respawnThread"); |
|
respawnThread.start(); |
|
} |
|
}
|
|
|