3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-09 21:10:05 +01:00

Merge branch 'master' into feature/mapping

Dieser Commit ist enthalten in:
sk89q 2014-07-14 22:50:57 -07:00
Commit bf7185d173
3 geänderte Dateien mit 24 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -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 5.6.1
- Added support for Minecraft 1.7.5 on Bukkit. - Added support for Minecraft 1.7.5 on Bukkit.
- Added //flora command to place flora over grass. - Added //flora command to place flora over grass.

Binäre Datei nicht angezeigt.

Datei anzeigen

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