Try now
This commit is contained in:
parent
03b756b4d9
commit
f31c4fda82
|
@ -125,24 +125,9 @@ public class AsyncWorld implements World {
|
||||||
* @param creator
|
* @param creator
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static AsyncWorld create(final WorldCreator creator) {
|
public synchronized static AsyncWorld create(final WorldCreator creator) {
|
||||||
if (!loading.compareAndSet(false, true)) {
|
|
||||||
synchronized (loading) {
|
|
||||||
while (loading.get()) {
|
|
||||||
try {
|
|
||||||
loading.wait(10000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BukkitQueue_0 queue = (BukkitQueue_0) SetQueue.IMP.getNewQueue(creator.name(), true, false);
|
BukkitQueue_0 queue = (BukkitQueue_0) SetQueue.IMP.getNewQueue(creator.name(), true, false);
|
||||||
World world = queue.createWorld(creator);
|
World world = queue.createWorld(creator);
|
||||||
synchronized (loading) {
|
|
||||||
loading.set(false);
|
|
||||||
loading.notifyAll();
|
|
||||||
}
|
|
||||||
return wrap(world);
|
return wrap(world);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue