Merge branch 'master' into feature/mapping

This commit is contained in:
sk89q 2014-07-14 22:50:57 -07:00
commit bf7185d173
3 changed files with 24 additions and 12 deletions

View File

@ -1,3 +1,15 @@
5.6.3
Note: We are working on WorldEdit 6.x so 5.x are maintenance releases and will
mostly contain bug fixes and minor changes.
- Added support for CraftBukkit 1.7.10.
- Fixed activated hoppers rotating incorrectly.
- Fixed listing schematics with directories in the folder.
5.6.2
- Backport 1.7.9 support to WE 5.x
5.6.1
- Added support for Minecraft 1.7.5 on Bukkit.
- Added //flora command to place flora over grass.

Binary file not shown.

View File

@ -65,7 +65,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
public final class CommandManager {
public static final Pattern COMMAND_CLEAN_PATTERN = Pattern.compile("^[/]+");
private static final Logger logger = Logger.getLogger(CommandManager.class.getCanonicalName());
private static final Logger log = Logger.getLogger(CommandManager.class.getCanonicalName());
private static final Logger commandLog = Logger.getLogger(CommandManager.class.getCanonicalName() + ".CommandLog");
private static final java.util.regex.Pattern numberFormatExceptionPattern = java.util.regex.Pattern.compile("^For input string: \"(.*)\"$");
private final WorldEdit worldEdit;
@ -88,7 +89,7 @@ public final class CommandManager {
worldEdit.getEventBus().register(this);
// Setup the logger
logger.addHandler(dynamicHandler);
commandLog.addHandler(dynamicHandler);
dynamicHandler.setFormatter(new LogFormat());
// Set up the commands manager
@ -98,7 +99,7 @@ public final class CommandManager {
builder.addBinding(new WorldEditBinding(worldEdit));
builder.addExceptionConverter(new WorldEditExceptionConverter(worldEdit));
builder.addInvokeListener(new LegacyCommandsHandler());
builder.addInvokeListener(new CommandLoggingHandler(worldEdit, logger));
builder.addInvokeListener(new CommandLoggingHandler(worldEdit, commandLog));
dispatcher = new CommandGraph()
.builder(builder)
@ -146,7 +147,7 @@ public final class CommandManager {
}
void register(Platform platform) {
logger.log(Level.FINE, "Registering commands with " + platform.getClass().getCanonicalName());
log.log(Level.FINE, "Registering commands with " + platform.getClass().getCanonicalName());
LocalConfiguration config = platform.getConfiguration();
boolean logging = config.logCommands;
@ -155,18 +156,17 @@ public final class CommandManager {
// Register log
if (!logging || path.isEmpty()) {
dynamicHandler.setHandler(null);
logger.setLevel(Level.OFF);
commandLog.setLevel(Level.OFF);
} else {
File file = new File(config.getWorkingDirectory(), path);
commandLog.setLevel(Level.ALL);
logger.setLevel(Level.ALL);
logger.log(Level.INFO, "Logging WorldEdit commands to " + file.getAbsolutePath());
log.log(Level.INFO, "Logging WorldEdit commands to " + file.getAbsolutePath());
try {
dynamicHandler.setHandler(new FileHandler(file.getAbsolutePath(), true));
} catch (IOException e) {
logger.log(Level.WARNING, "Could not use command log file " + path + ": " + e.getMessage());
log.log(Level.WARNING, "Could not use command log file " + path + ": " + e.getMessage());
}
}
@ -241,14 +241,14 @@ public final class CommandManager {
Throwable t = e.getCause();
actor.printError("Please report this error: [See console]");
actor.printRaw(t.getClass().getName() + ": " + t.getMessage());
logger.log(Level.SEVERE, "An unexpected error while handling a WorldEdit command", t);
log.log(Level.SEVERE, "An unexpected error while handling a WorldEdit command", t);
} catch (CommandException e) {
String message = e.getMessage();
if (message != null) {
actor.printError(e.getMessage());
} else {
actor.printError("An unknown error has occurred! Please see console.");
logger.log(Level.SEVERE, "An unknown error occurred", e);
log.log(Level.SEVERE, "An unknown error occurred", e);
}
} finally {
EditSession editSession = locals.get(EditSession.class);
@ -298,7 +298,7 @@ public final class CommandManager {
}
public static Logger getLogger() {
return logger;
return commandLog;
}
}