Fix for Fill command potentially running on wrong world if specified by player with "fill confirm" command not specifying world

This commit is contained in:
Brettflan 2013-04-21 20:08:36 -05:00
parent b074a34ee3
commit 0eec9a007a
2 changed files with 3 additions and 4 deletions

View File

@ -613,7 +613,7 @@ public class WBCommand implements CommandExecutor
pad = split[2]; pad = split[2];
String world = ""; String world = "";
if (player != null) if (player != null && !cancel && !confirm && !pause)
world = player.getWorld().getName(); world = player.getWorld().getName();
if (!cancel && !confirm && !pause && world.isEmpty()) if (!cancel && !confirm && !pause && world.isEmpty())
@ -949,7 +949,7 @@ public class WBCommand implements CommandExecutor
{ {
int task = plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, Config.fillTask, ticks, ticks); int task = plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, Config.fillTask, ticks, ticks);
Config.fillTask.setTaskID(task); Config.fillTask.setTaskID(task);
sender.sendMessage("WorldBorder map generation task started."); sender.sendMessage("WorldBorder map generation for world \"" + fillWorld + "\" task started.");
} }
else else
sender.sendMessage(clrErr + "The world map generation task failed to start."); sender.sendMessage(clrErr + "The world map generation task failed to start.");
@ -1053,7 +1053,7 @@ public class WBCommand implements CommandExecutor
{ {
int task = plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, Config.trimTask, ticks, ticks); int task = plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, Config.trimTask, ticks, ticks);
Config.trimTask.setTaskID(task); Config.trimTask.setTaskID(task);
sender.sendMessage("WorldBorder map trimming task started."); sender.sendMessage("WorldBorder map trimming task for world \"" + trimWorld + "\" started.");
} }
else else
sender.sendMessage(clrErr + "The world map trimming task failed to start."); sender.sendMessage(clrErr + "The world map trimming task failed to start.");

View File

@ -328,7 +328,6 @@ public class WorldFillTask implements Runnable
if (!originalChunks.contains(coord)) if (!originalChunks.contains(coord))
world.unloadChunkRequest(coord.x, coord.z); world.unloadChunkRequest(coord.x, coord.z);
} }
} }
// is this task still valid/workable? // is this task still valid/workable?