More task scheduling. Fixes #199

This commit is contained in:
garbagemule
2013-07-30 21:57:36 +02:00
parent 7d27e52d7c
commit 9230f823fb
+9 -19
View File
@@ -833,30 +833,20 @@ public class ArenaImpl implements Arena
@Override
public void storeContainerContents()
{
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,
new Runnable() {
public void run() {
for (Location loc : region.getContainers()) {
BlockState state = world.getBlockAt(loc).getState();
if (state instanceof InventoryHolder) {
containables.add(new RepairableContainer(state, false));
}
}
}
});
for (Location loc : region.getContainers()) {
BlockState state = world.getBlockAt(loc).getState();
if (state instanceof InventoryHolder) {
containables.add(new RepairableContainer(state, false));
}
}
}
@Override
public void restoreContainerContents()
{
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,
new Runnable() {
public void run() {
for (Repairable r : containables) {
r.repair();
}
}
});
for (Repairable r : containables) {
r.repair();
}
}
@Override