3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-05 11:00:05 +01:00
Dieser Commit ist enthalten in:
Jesse Boyd 2019-04-07 17:41:51 +10:00
Commit 1529c187d2
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F
17 geänderte Dateien mit 111 neuen und 91 gelöschten Zeilen

Datei anzeigen

@ -168,7 +168,7 @@ public class BukkitPlayer extends AbstractPlayerActor {
Extent extent = loc.getExtent(); Extent extent = loc.getExtent();
if (extent instanceof World) { if (extent instanceof World) {
org.bukkit.World world = Bukkit.getWorld(((World) extent).getName()); org.bukkit.World world = Bukkit.getWorld(((World) extent).getName());
System.out.println("Teleport to world " + world); // System.out.println("Teleport to world " + world);
player.teleport(new Location(world, pos.getX(), pos.getY(), player.teleport(new Location(world, pos.getX(), pos.getY(),
pos.getZ(), yaw, pitch)); pos.getZ(), yaw, pitch));
} }

Datei anzeigen

@ -72,7 +72,6 @@ public enum BBC {
COMMAND_COPY("%s0 blocks were copied.", "WorldEdit.Copy"), COMMAND_COPY("%s0 blocks were copied.", "WorldEdit.Copy"),
COMMAND_CUT_SLOW("%s0 blocks were cut.", "WorldEdit.Cut"), COMMAND_CUT_SLOW("%s0 blocks were cut.", "WorldEdit.Cut"),
COMMAND_CUT_LAZY("%s0 blocks will be removed on paste", "WorldEdit.Cut"), COMMAND_CUT_LAZY("%s0 blocks will be removed on paste", "WorldEdit.Cut"),
@ -156,6 +155,7 @@ public enum BBC {
TOOL_NONE("Tool unbound from your current item.", "WorldEdit.Tool"), TOOL_NONE("Tool unbound from your current item.", "WorldEdit.Tool"),
TOOL_INFO("Info tool bound to %s0.", "WorldEdit.Tool"), TOOL_INFO("Info tool bound to %s0.", "WorldEdit.Tool"),
TOOL_TREE("Tree tool bound to %s0.", "WorldEdit.Tool"), TOOL_TREE("Tree tool bound to %s0.", "WorldEdit.Tool"),
TOOL_TREE_ERROR_BLOCK("A tree can't go here", "WorldEdit.Tool"),
TOOL_TREE_ERROR("Tree type %s0 is unknown.", "WorldEdit.Tool"), TOOL_TREE_ERROR("Tree type %s0 is unknown.", "WorldEdit.Tool"),
TOOL_REPL("Block replacer tool bound to %s0.", "WorldEdit.Tool"), TOOL_REPL("Block replacer tool bound to %s0.", "WorldEdit.Tool"),
TOOL_CYCLER("Block data cycler tool bound to %s0.", "WorldEdit.Tool"), TOOL_CYCLER("Block data cycler tool bound to %s0.", "WorldEdit.Tool"),
@ -163,6 +163,8 @@ public enum BBC {
TOOL_RANGE_ERROR("Maximum range: %s0.", "WorldEdit.Tool"), TOOL_RANGE_ERROR("Maximum range: %s0.", "WorldEdit.Tool"),
TOOL_RADIUS_ERROR("Maximum allowed brush radius: %s0.", "WorldEdit.Tool"), TOOL_RADIUS_ERROR("Maximum allowed brush radius: %s0.", "WorldEdit.Tool"),
TOOL_DELTREE("Floating tree remover tool bound to %s0.", "WorldEdit.Tool"), TOOL_DELTREE("Floating tree remover tool bound to %s0.", "WorldEdit.Tool"),
TOOL_DELTREE_ERROR("That's not a tree", "WorldEdit.Tool"),
TOOL_DELTREE_FLOATING_ERROR("That's not a floating tree", "WorldEdit.Tool"),
TOOL_FARWAND("Far wand tool bound to %s0.", "WorldEdit.Tool"), TOOL_FARWAND("Far wand tool bound to %s0.", "WorldEdit.Tool"),
TOOL_LRBUILD_BOUND("Long-range building tool bound to %s0.", "WorldEdit.Tool"), TOOL_LRBUILD_BOUND("Long-range building tool bound to %s0.", "WorldEdit.Tool"),
TOOL_LRBUILD_INFO("Left-click set to %s0; right-click set to %s1.", "WorldEdit.Tool"), TOOL_LRBUILD_INFO("Left-click set to %s0; right-click set to %s1.", "WorldEdit.Tool"),
@ -175,6 +177,14 @@ public enum BBC {
SNAPSHOT_NEWEST("Now using newest snapshot.", "WorldEdit.Snapshot"), SNAPSHOT_NEWEST("Now using newest snapshot.", "WorldEdit.Snapshot"),
SNAPSHOT_LIST_HEADER("Snapshots for world (%s0):", "WorldEdit.Snapshot"), SNAPSHOT_LIST_HEADER("Snapshots for world (%s0):", "WorldEdit.Snapshot"),
SNAPSHOT_LIST_FOOTER("Use /snap use [snapshot] or /snap use latest.", "WorldEdit.Snapshot"), SNAPSHOT_LIST_FOOTER("Use /snap use [snapshot] or /snap use latest.", "WorldEdit.Snapshot"),
SNAPSHOT_NOT_CONFIGURED("Snapshot/backup restore is not configured.", "WorldEdit.Snapshot"),
SNAPSHOT_NOT_AVAILABLE("No snapshots are available. See console for details.", "WorldEdit.Snapshot"),
SNAPSHOT_NOT_FOUND_WORLD("No snapshots were found for this world.", "WorldEdit.Snapshot"),
SNAPSHOT_NOT_FOUND("No snapshots were found.", "WorldEdit.Snapshot"),
SNAPSHOT_INVALID_INDEX("Invalid index, must be equal or higher then 1.", "WorldEdit.Snapshot"),
SNAPSHOT_ERROR_DATE("Could not detect the date inputted.", "WorldEdit.Snapshot"),
SNAPSHOT_ERROR_RESTORE("Errors prevented any blocks from being restored.", "WorldEdit.Snapshot"),
SNAPSHOT_ERROR_RESTORE_CHUNKS("No chunks could be loaded. (Bad archive?)", "WorldEdit.Snapshot"),
BIOME_LIST_HEADER("Biomes (page %s0/%s1):", "WorldEdit.Biome"), BIOME_LIST_HEADER("Biomes (page %s0/%s1):", "WorldEdit.Biome"),
BIOME_CHANGED("Biomes were changed in %s0 columns.", "WorldEdit.Biome"), BIOME_CHANGED("Biomes were changed in %s0 columns.", "WorldEdit.Biome"),
@ -299,6 +309,10 @@ public enum BBC {
SEL_LIST("For a list of selection types use:&c //sel list", "Selection"), SEL_LIST("For a list of selection types use:&c //sel list", "Selection"),
SEL_MODES("Select one of the modes below:", "Selection"), SEL_MODES("Select one of the modes below:", "Selection"),
SCRIPTING_NO_PERM("&cYou do not have permission to execute this craft script", "WorldEdit.Scripting"),
SCRIPTING_CS("Use /cs with a script name first.", "WorldEdit.Scripting"),
SCRIPTING_ERROR("An error occured while executing a craft script", "WorldEdit.Scripting"),
TIP_SEL_LIST("Tip: See the different selection modes with &c//sel list", "Tips"), TIP_SEL_LIST("Tip: See the different selection modes with &c//sel list", "Tips"),
TIP_SELECT_CONNECTED("Tip: Select all connected blocks with //sel fuzzy", "Tips"), TIP_SELECT_CONNECTED("Tip: Select all connected blocks with //sel fuzzy", "Tips"),
TIP_SET_POS1("Tip: Use pos1 as a pattern with &c//set pos1", "Tips"), TIP_SET_POS1("Tip: Use pos1 as a pattern with &c//set pos1", "Tips"),

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit; package com.sk89q.worldedit;
import com.boydti.fawe.config.BBC;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItem;
@ -611,7 +612,7 @@ public final class WorldEdit {
String ext = filename.substring(index + 1); String ext = filename.substring(index + 1);
if (!ext.equalsIgnoreCase("js")) { if (!ext.equalsIgnoreCase("js")) {
player.printError("Only .js scripts are currently supported"); player.printError(BBC.getPrefix() + "Only .js scripts are currently supported");
return; return;
} }
@ -624,7 +625,7 @@ public final class WorldEdit {
file = WorldEdit.class.getResourceAsStream("craftscripts/" + filename); file = WorldEdit.class.getResourceAsStream("craftscripts/" + filename);
if (file == null) { if (file == null) {
player.printError("Script does not exist: " + filename); player.printError(BBC.getPrefix() + "Script does not exist: " + filename);
return; return;
} }
} else { } else {
@ -637,7 +638,7 @@ public final class WorldEdit {
in.close(); in.close();
script = new String(data, 0, data.length, StandardCharsets.UTF_8); script = new String(data, 0, data.length, StandardCharsets.UTF_8);
} catch (IOException e) { } catch (IOException e) {
player.printError("Script read error: " + e.getMessage()); player.printError(BBC.getPrefix() + "Script read error: " + e.getMessage());
return; return;
} }
@ -650,8 +651,8 @@ public final class WorldEdit {
try { try {
engine = new RhinoCraftScriptEngine(); engine = new RhinoCraftScriptEngine();
} catch (NoClassDefFoundError e) { } catch (NoClassDefFoundError e) {
player.printError("Failed to find an installed script engine."); player.printError(BBC.getPrefix() + "Failed to find an installed script engine.");
player.printError("Please see http://wiki.sk89q.com/wiki/WorldEdit/Installation"); player.printError(BBC.getPrefix() + "Please see http://wiki.sk89q.com/wiki/WorldEdit/Installation");
return; return;
} }
@ -665,15 +666,15 @@ public final class WorldEdit {
try { try {
engine.evaluate(script, filename, vars); engine.evaluate(script, filename, vars);
} catch (ScriptException e) { } catch (ScriptException e) {
player.printError("Failed to execute:"); player.printError(BBC.getPrefix() + "Failed to execute:");
player.printRaw(e.getMessage()); player.printRaw(e.getMessage());
logger.warn("Failed to execute script", e); logger.warn(BBC.getPrefix() + "Failed to execute script", e);
} catch (NumberFormatException | WorldEditException e) { } catch (NumberFormatException | WorldEditException e) {
throw e; throw e;
} catch (Throwable e) { } catch (Throwable e) {
player.printError("Failed to execute (see console):"); player.printError(BBC.getPrefix() + "Failed to execute (see console):");
player.printRaw(e.getClass().getCanonicalName()); player.printRaw(e.getClass().getCanonicalName());
logger.warn("Failed to execute script", e); logger.warn(BBC.getPrefix() + "Failed to execute script", e);
} finally { } finally {
for (EditSession editSession : scriptContext.getEditSessions()) { for (EditSession editSession : scriptContext.getEditSessions()) {
editSession.flushSession(); editSession.flushSession();

Datei anzeigen

@ -115,7 +115,7 @@ public class ChunkCommands {
FileOutputStream out = null; FileOutputStream out = null;
if (config.shellSaveType == null) { if (config.shellSaveType == null) {
player.printError("Shell script type must be configured: 'bat' or 'bash' expected."); player.printError(BBC.getPrefix() + "Shell script type must be configured: 'bat' or 'bash' expected.");
} else if (config.shellSaveType.equalsIgnoreCase("bat")) { } else if (config.shellSaveType.equalsIgnoreCase("bat")) {
try { try {
out = new FileOutputStream("worldedit-delchunks.bat"); out = new FileOutputStream("worldedit-delchunks.bat");

Datei anzeigen

@ -68,7 +68,7 @@ public class GeneralCommands {
int limit = args.argsLength() == 0 ? config.defaultChangeLimit : Math.max(-1, args.getInteger(0)); int limit = args.argsLength() == 0 ? config.defaultChangeLimit : Math.max(-1, args.getInteger(0));
if (!mayDisable && config.maxChangeLimit > -1) { if (!mayDisable && config.maxChangeLimit > -1) {
if (limit > config.maxChangeLimit) { if (limit > config.maxChangeLimit) {
player.printError("Your maximum allowable limit is " + config.maxChangeLimit + "."); player.printError(BBC.getPrefix() + "Your maximum allowable limit is " + config.maxChangeLimit + ".");
return; return;
} }
} }
@ -76,9 +76,9 @@ public class GeneralCommands {
session.setBlockChangeLimit(limit); session.setBlockChangeLimit(limit);
if (limit != config.defaultChangeLimit) { if (limit != config.defaultChangeLimit) {
player.print("Block change limit set to " + limit + ". (Use //limit to go back to the default.)"); player.print(BBC.getPrefix() + "Block change limit set to " + limit + ". (Use //limit to go back to the default.)");
} else { } else {
player.print("Block change limit set to " + limit + "."); player.print(BBC.getPrefix() + "Block change limit set to " + limit + ".");
} }
} }
@ -98,7 +98,7 @@ public class GeneralCommands {
int limit = args.argsLength() == 0 ? config.calculationTimeout : Math.max(-1, args.getInteger(0)); int limit = args.argsLength() == 0 ? config.calculationTimeout : Math.max(-1, args.getInteger(0));
if (!mayDisable && config.maxCalculationTimeout > -1) { if (!mayDisable && config.maxCalculationTimeout > -1) {
if (limit > config.maxCalculationTimeout) { if (limit > config.maxCalculationTimeout) {
player.printError("Your maximum allowable timeout is " + config.maxCalculationTimeout + " ms."); player.printError(BBC.getPrefix() + "Your maximum allowable timeout is " + config.maxCalculationTimeout + " ms.");
return; return;
} }
} }
@ -106,9 +106,9 @@ public class GeneralCommands {
session.setTimeout(limit); session.setTimeout(limit);
if (limit != config.calculationTimeout) { if (limit != config.calculationTimeout) {
player.print("Timeout time set to " + limit + " ms. (Use //timeout to go back to the default.)"); player.print(BBC.getPrefix() + "Timeout time set to " + limit + " ms. (Use //timeout to go back to the default.)");
} else { } else {
player.print("Timeout time set to " + limit + " ms."); player.print(BBC.getPrefix() + "Timeout time set to " + limit + " ms.");
} }
} }
@ -125,7 +125,7 @@ public class GeneralCommands {
String newState = args.getString(0, null); String newState = args.getString(0, null);
if (session.hasFastMode()) { if (session.hasFastMode()) {
if ("on".equals(newState)) { if ("on".equals(newState)) {
player.printError("Fast mode already enabled."); player.printError(BBC.getPrefix() + "Fast mode already enabled.");
return; return;
} }
@ -133,7 +133,7 @@ public class GeneralCommands {
player.print("Fast mode disabled."); player.print("Fast mode disabled.");
} else { } else {
if ("off".equals(newState)) { if ("off".equals(newState)) {
player.printError("Fast mode already disabled."); player.printError(BBC.getPrefix() + "Fast mode already disabled.");
return; return;
} }
@ -158,7 +158,7 @@ public class GeneralCommands {
String newState = args.getString(0, null); String newState = args.getString(0, null);
if (session.shouldUseServerCUI()) { if (session.shouldUseServerCUI()) {
if ("on".equals(newState)) { if ("on".equals(newState)) {
player.printError("Server CUI already enabled."); player.printError(BBC.getPrefix() + "Server CUI already enabled.");
return; return;
} }
@ -167,7 +167,7 @@ public class GeneralCommands {
player.print("Server CUI disabled."); player.print("Server CUI disabled.");
} else { } else {
if ("off".equals(newState)) { if ("off".equals(newState)) {
player.printError("Server CUI already disabled."); player.printError(BBC.getPrefix() + "Server CUI already disabled.");
return; return;
} }

Datei anzeigen

@ -249,7 +249,7 @@ public class RegionCommands extends MethodCommands {
@Switch('h') boolean shell) throws WorldEditException { @Switch('h') boolean shell) throws WorldEditException {
if (!(region instanceof CuboidRegion)) { if (!(region instanceof CuboidRegion)) {
player.printError("//line only works with cuboid selections"); player.printError(BBC.getPrefix() + "//line only works with cuboid selections");
return; return;
} }
@ -770,7 +770,7 @@ public class RegionCommands extends MethodCommands {
public void forest(Player player, EditSession editSession, @Selection Region region, @Optional("tree") TreeType type, public void forest(Player player, EditSession editSession, @Selection Region region, @Optional("tree") TreeType type,
@Optional("5") @Range(min = 0, max = 100) double density) throws WorldEditException { @Optional("5") @Range(min = 0, max = 100) double density) throws WorldEditException {
int affected = editSession.makeForest(region, density / 100, type); int affected = editSession.makeForest(region, density / 100, type);
player.print(affected + " trees created."); BBC.COMMAND_TREE.send(player, affected);
} }
@Command( @Command(

Datei anzeigen

@ -243,7 +243,7 @@ public class SchematicCommands extends MethodCommands {
} }
f = player.openFileOpenDialog(extensions); f = player.openFileOpenDialog(extensions);
if (f == null || !f.exists()) { if (f == null || !f.exists()) {
player.printError("Schematic " + filename + " does not exist! (" + f + ")"); player.printError(BBC.getPrefix() + "Schematic " + filename + " does not exist! (" + f + ")");
return; return;
} }
} else { } else {
@ -264,7 +264,7 @@ public class SchematicCommands extends MethodCommands {
} }
} }
if (f == null || !f.exists() || !MainUtil.isInSubDirectory(working, f)) { if (f == null || !f.exists() || !MainUtil.isInSubDirectory(working, f)) {
player.printError("Schematic " + filename + " does not exist! (" + ((f == null) ? false : f.exists()) + "|" + f + "|" + (f == null ? false : !MainUtil.isInSubDirectory(working, f)) + ")"); player.printError(BBC.getPrefix() + "Schematic " + filename + " does not exist! (" + ((f == null) ? false : f.exists()) + "|" + f + "|" + (f == null ? false : !MainUtil.isInSubDirectory(working, f)) + ")");
return; return;
} }
if (format == null) { if (format == null) {
@ -280,9 +280,9 @@ public class SchematicCommands extends MethodCommands {
format.hold(player, uri, in); format.hold(player, uri, in);
BBC.SCHEMATIC_LOADED.send(player, filename); BBC.SCHEMATIC_LOADED.send(player, filename);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
player.printError("Unknown filename: " + filename); player.printError(BBC.getPrefix() + "Unknown filename: " + filename);
} catch (URISyntaxException | IOException e) { } catch (URISyntaxException | IOException e) {
player.printError("File could not be read or it does not exist: " + e.getMessage()); player.printError(BBC.getPrefix() + "File could not be read or it does not exist: " + e.getMessage());
log.warn("Failed to load a saved clipboard", e); log.warn("Failed to load a saved clipboard", e);
} finally { } finally {
if (in != null) { if (in != null) {
@ -301,7 +301,7 @@ public class SchematicCommands extends MethodCommands {
final LocalConfiguration config = this.worldEdit.getConfiguration(); final LocalConfiguration config = this.worldEdit.getConfiguration();
final ClipboardFormat format = ClipboardFormats.findByAlias(formatName); final ClipboardFormat format = ClipboardFormats.findByAlias(formatName);
if (format == null) { if (format == null) {
player.printError("Unknown schematic format: " + formatName); player.printError(BBC.getPrefix() + "Unknown schematic format: " + formatName);
return; return;
} }
File working = this.worldEdit.getWorkingDirectoryFile(config.saveDir); File working = this.worldEdit.getWorkingDirectoryFile(config.saveDir);
@ -333,7 +333,7 @@ public class SchematicCommands extends MethodCommands {
Files.createDirectories(parent.toPath()); Files.createDirectories(parent.toPath());
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
log.info("Could not create folder for schematics!"); log.info(BBC.getPrefix() + "Could not create folder for schematics!");
return; return;
} }
} }
@ -378,11 +378,11 @@ public class SchematicCommands extends MethodCommands {
} }
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
e.printStackTrace(); e.printStackTrace();
player.printError("Unknown filename: " + filename); player.printError(BBC.getPrefix() + "Unknown filename: " + filename);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
player.printError("Schematic could not written: " + e.getMessage()); player.printError(BBC.getPrefix() + "Schematic could not written: " + e.getMessage());
log.warn("Failed to write a saved clipboard", e); log.warn(BBC.getPrefix() + "Failed to write a saved clipboard", e);
} }
} }
@ -394,7 +394,7 @@ public class SchematicCommands extends MethodCommands {
final File dir = Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS ? new File(working, player.getUniqueId().toString()) : working; final File dir = Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS ? new File(working, player.getUniqueId().toString()) : working;
File destDir = new File(dir, directory); File destDir = new File(dir, directory);
if (!MainUtil.isInSubDirectory(working, destDir)) { if (!MainUtil.isInSubDirectory(working, destDir)) {
player.printError("Directory " + destDir + " does not exist!"); player.printError(BBC.getPrefix() + "Directory " + destDir + " does not exist!");
return; return;
} }
if (Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS && !MainUtil.isInSubDirectory(dir, destDir) && !player.hasPermission("worldedit.schematic.move.other")) { if (Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS && !MainUtil.isInSubDirectory(dir, destDir) && !player.hasPermission("worldedit.schematic.move.other")) {
@ -408,7 +408,7 @@ public class SchematicCommands extends MethodCommands {
return; return;
} }
if (!destDir.exists() && !destDir.mkdirs()) { if (!destDir.exists() && !destDir.mkdirs()) {
player.printError("Creation of " + destDir + " failed! (check file permissions)"); player.printError(BBC.getPrefix() + "Creation of " + destDir + " failed! (check file permissions)");
return; return;
} }
for (File source : sources) { for (File source : sources) {
@ -454,7 +454,7 @@ public class SchematicCommands extends MethodCommands {
} }
for (File f : files) { for (File f : files) {
if (!MainUtil.isInSubDirectory(working, f) || !f.exists()) { if (!MainUtil.isInSubDirectory(working, f) || !f.exists()) {
player.printError("Schematic " + filename + " does not exist! (" + f.exists() + "|" + f + "|" + (!MainUtil.isInSubDirectory(working, f)) + ")"); player.printError(BBC.getPrefix() + "Schematic " + filename + " does not exist! (" + f.exists() + "|" + f + "|" + (!MainUtil.isInSubDirectory(working, f)) + ")");
continue; continue;
} }
if (Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS && !MainUtil.isInSubDirectory(dir, f) && !player.hasPermission("worldedit.schematic.delete.other")) { if (Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS && !MainUtil.isInSubDirectory(dir, f) && !player.hasPermission("worldedit.schematic.delete.other")) {
@ -462,7 +462,7 @@ public class SchematicCommands extends MethodCommands {
continue; continue;
} }
if (!delete(f)) { if (!delete(f)) {
player.printError("Deletion of " + filename + " failed! Maybe it is read-only."); player.printError(BBC.getPrefix() + "Deletion of " + filename + " failed! Maybe it is read-only.");
continue; continue;
} }
BBC.FILE_DELETED.send(player, filename); BBC.FILE_DELETED.send(player, filename);

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.BBC;
import com.boydti.fawe.wrappers.LocationMaskedPlayerWrapper; import com.boydti.fawe.wrappers.LocationMaskedPlayerWrapper;
import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandContext;
@ -84,7 +85,7 @@ public class ScriptingCommands {
String ext = filename.substring(index + 1, filename.length()); String ext = filename.substring(index + 1, filename.length());
if (!ext.equalsIgnoreCase("js")) { if (!ext.equalsIgnoreCase("js")) {
actor.printError("Only .js scripts are currently supported"); actor.printError(BBC.getPrefix() + "Only .js scripts are currently supported");
return null; return null;
} }
@ -97,7 +98,7 @@ public class ScriptingCommands {
file = WorldEdit.class.getResourceAsStream("craftscripts/" + filename); file = WorldEdit.class.getResourceAsStream("craftscripts/" + filename);
if (file == null) { if (file == null) {
actor.printError("Script does not exist: " + filename); actor.printError(BBC.getPrefix() + "Script does not exist: " + filename);
return null; return null;
} }
} else { } else {
@ -110,7 +111,7 @@ public class ScriptingCommands {
in.close(); in.close();
script = new String(data, 0, data.length, "utf-8"); script = new String(data, 0, data.length, "utf-8");
} catch (IOException e) { } catch (IOException e) {
actor.printError("Script read error: " + e.getMessage()); actor.printError(BBC.getPrefix() + "Script read error: " + e.getMessage());
return null; return null;
} }
@ -145,14 +146,14 @@ public class ScriptingCommands {
result = engine.evaluate(script, filename, vars); result = engine.evaluate(script, filename, vars);
} catch (ScriptException e) { } catch (ScriptException e) {
e.printStackTrace(); e.printStackTrace();
actor.printError("Failed to execute:"); actor.printError(BBC.getPrefix() + "Failed to execute:");
actor.printRaw(e.getMessage()); actor.printRaw(e.getMessage());
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
throw e; throw e;
} catch (WorldEditException e) { } catch (WorldEditException e) {
throw e; throw e;
} catch (Throwable e) { } catch (Throwable e) {
actor.printError("Failed to execute (see console):"); actor.printError(BBC.getPrefix() + "Failed to execute (see console):");
actor.printRaw(e.getClass().getCanonicalName()); actor.printRaw(e.getClass().getCanonicalName());
} }
if (result instanceof NativeJavaObject) { if (result instanceof NativeJavaObject) {
@ -169,7 +170,7 @@ public class ScriptingCommands {
final String name = args.getString(0); final String name = args.getString(0);
if (!player.hasPermission("worldedit.scripting.execute." + name)) { if (!player.hasPermission("worldedit.scripting.execute." + name)) {
player.printError("You don't have permission to use that script."); BBC.SCRIPTING_NO_PERM.send(player);
return; return;
} }
@ -197,12 +198,12 @@ public class ScriptingCommands {
String lastScript = session.getLastScript(); String lastScript = session.getLastScript();
if (!player.hasPermission("worldedit.scripting.execute." + lastScript)) { if (!player.hasPermission("worldedit.scripting.execute." + lastScript)) {
player.printError("You don't have permission to use that script."); BBC.SCRIPTING_NO_PERM.send(player);
return; return;
} }
if (lastScript == null) { if (lastScript == null) {
player.printError("Use /cs with a script name first."); BBC.SCRIPTING_CS.send(player);
return; return;
} }
@ -214,7 +215,7 @@ public class ScriptingCommands {
try { try {
this.worldEdit.runScript(LocationMaskedPlayerWrapper.unwrap(player), f, scriptArgs); this.worldEdit.runScript(LocationMaskedPlayerWrapper.unwrap(player), f, scriptArgs);
} catch (final WorldEditException ex) { } catch (final WorldEditException ex) {
player.printError("Error while executing CraftScript."); BBC.SCRIPTING_ERROR.send(player);
} }
} }

Datei anzeigen

@ -181,7 +181,7 @@ public class SelectionCommands {
session.getRegionSelector(player.getWorld()) session.getRegionSelector(player.getWorld())
.explainPrimarySelection(player, session, pos); .explainPrimarySelection(player, session, pos);
} else { } else {
player.printError("No block in sight!"); BBC.NO_BLOCK.send(player);
} }
} }
@ -205,7 +205,7 @@ public class SelectionCommands {
session.getRegionSelector(player.getWorld()) session.getRegionSelector(player.getWorld())
.explainSecondarySelection(player, session, pos); .explainSecondarySelection(player, session, pos);
} else { } else {
player.printError("No block in sight!"); BBC.NO_BLOCK.send(player);
} }
} }
@ -713,7 +713,7 @@ public class SelectionCommands {
size = session.getSelection(player.getWorld()).getArea(); size = session.getSelection(player.getWorld()).getArea();
if (distributionData.size() <= 0) { if (distributionData.size() <= 0) {
player.printError("No blocks counted."); player.printError(BBC.getPrefix() + "No blocks counted.");
return; return;
} }
BBC.SELECTION_DISTR.send(player, size); BBC.SELECTION_DISTR.send(player, size);

Datei anzeigen

@ -68,7 +68,7 @@ public class SnapshotCommands {
LocalConfiguration config = we.getConfiguration(); LocalConfiguration config = we.getConfiguration();
if (config.snapshotRepo == null) { if (config.snapshotRepo == null) {
player.printError("Snapshot/backup restore is not configured."); BBC.SNAPSHOT_NOT_CONFIGURED.send(player);
return; return;
} }
@ -86,22 +86,22 @@ public class SnapshotCommands {
BBC.SNAPSHOT_LIST_FOOTER.send(player); BBC.SNAPSHOT_LIST_FOOTER.send(player);
} else { } else {
player.printError("No snapshots are available. See console for details."); BBC.SNAPSHOT_NOT_AVAILABLE.send(player);
// Okay, let's toss some debugging information! // Okay, let's toss some debugging information!
File dir = config.snapshotRepo.getDirectory(); File dir = config.snapshotRepo.getDirectory();
try { try {
WorldEdit.logger.info("WorldEdit found no snapshots: looked in: " WorldEdit.logger.info(BBC.getPrefix() + "WorldEdit found no snapshots: looked in: "
+ dir.getCanonicalPath()); + dir.getCanonicalPath());
} catch (IOException e) { } catch (IOException e) {
WorldEdit.logger.info("WorldEdit found no snapshots: looked in " WorldEdit.logger.info(BBC.getPrefix() + "WorldEdit found no snapshots: looked in "
+ "(NON-RESOLVABLE PATH - does it exist?): " + "(NON-RESOLVABLE PATH - does it exist?): "
+ dir.getPath()); + dir.getPath());
} }
} }
} catch (MissingWorldException ex) { } catch (MissingWorldException ex) {
player.printError("No snapshots were found for this world."); BBC.SNAPSHOT_NOT_FOUND_WORLD.send(player);
} }
} }
@ -118,7 +118,7 @@ public class SnapshotCommands {
LocalConfiguration config = we.getConfiguration(); LocalConfiguration config = we.getConfiguration();
if (config.snapshotRepo == null) { if (config.snapshotRepo == null) {
player.printError("Snapshot/backup restore is not configured."); BBC.SNAPSHOT_NOT_CONFIGURED.send(player);
return; return;
} }
@ -133,17 +133,17 @@ public class SnapshotCommands {
session.setSnapshot(null); session.setSnapshot(null);
BBC.SNAPSHOT_NEWEST.send(player); BBC.SNAPSHOT_NEWEST.send(player);
} else { } else {
player.printError("No snapshots were found."); BBC.SNAPSHOT_NOT_FOUND.send(player);
} }
} catch (MissingWorldException ex) { } catch (MissingWorldException ex) {
player.printError("No snapshots were found for this world."); BBC.SNAPSHOT_NOT_FOUND_WORLD.send(player);
} }
} else { } else {
try { try {
session.setSnapshot(config.snapshotRepo.getSnapshot(name)); session.setSnapshot(config.snapshotRepo.getSnapshot(name));
BBC.SNAPSHOT_SET.send(player, name); BBC.SNAPSHOT_SET.send(player, name);
} catch (InvalidSnapshotException e) { } catch (InvalidSnapshotException e) {
player.printError("That snapshot does not exist or is not available."); BBC.SNAPSHOT_NOT_AVAILABLE.send(player);
} }
} }
} }
@ -160,7 +160,7 @@ public class SnapshotCommands {
LocalConfiguration config = we.getConfiguration(); LocalConfiguration config = we.getConfiguration();
if (config.snapshotRepo == null) { if (config.snapshotRepo == null) {
player.printError("Snapshot/backup restore is not configured."); BBC.SNAPSHOT_NOT_CONFIGURED.send(player);
return; return;
} }
@ -168,30 +168,30 @@ public class SnapshotCommands {
try { try {
index = Integer.parseInt(args.getString(0)); index = Integer.parseInt(args.getString(0));
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
player.printError("Invalid index, " + args.getString(0) + " is not a valid integer."); player.printError(BBC.getPrefix() + "Invalid index, " + args.getString(0) + " is not a valid integer.");
return; return;
} }
if (index < 1) { if (index < 1) {
player.printError("Invalid index, must be equal or higher then 1."); BBC.SNAPSHOT_INVALID_INDEX.send(player);
return; return;
} }
try { try {
List<Snapshot> snapshots = config.snapshotRepo.getSnapshots(true, player.getWorld().getName()); List<Snapshot> snapshots = config.snapshotRepo.getSnapshots(true, player.getWorld().getName());
if (snapshots.size() < index) { if (snapshots.size() < index) {
player.printError("Invalid index, must be between 1 and " + snapshots.size() + "."); player.printError(BBC.getPrefix() + "Invalid index, must be between 1 and " + snapshots.size() + ".");
return; return;
} }
Snapshot snapshot = snapshots.get(index - 1); Snapshot snapshot = snapshots.get(index - 1);
if (snapshot == null) { if (snapshot == null) {
player.printError("That snapshot does not exist or is not available."); BBC.SNAPSHOT_NOT_AVAILABLE.send(player);
return; return;
} }
session.setSnapshot(snapshot); session.setSnapshot(snapshot);
BBC.SNAPSHOT_SET.send(player, snapshot.getName()); BBC.SNAPSHOT_SET.send(player, snapshot.getName());
} catch (MissingWorldException e) { } catch (MissingWorldException e) {
player.printError("No snapshots were found for this world."); BBC.SNAPSHOT_NOT_FOUND_WORLD.send(player);
} }
} }
@ -208,28 +208,28 @@ public class SnapshotCommands {
LocalConfiguration config = we.getConfiguration(); LocalConfiguration config = we.getConfiguration();
if (config.snapshotRepo == null) { if (config.snapshotRepo == null) {
player.printError("Snapshot/backup restore is not configured."); BBC.SNAPSHOT_NOT_CONFIGURED.send(player);
return; return;
} }
Calendar date = session.detectDate(args.getJoinedStrings(0)); Calendar date = session.detectDate(args.getJoinedStrings(0));
if (date == null) { if (date == null) {
player.printError("Could not detect the date inputted."); BBC.SNAPSHOT_ERROR_DATE.send(player);
} else { } else {
try { try {
Snapshot snapshot = config.snapshotRepo.getSnapshotBefore(date, player.getWorld().getName()); Snapshot snapshot = config.snapshotRepo.getSnapshotBefore(date, player.getWorld().getName());
if (snapshot == null) { if (snapshot == null) {
dateFormat.setTimeZone(session.getTimeZone()); dateFormat.setTimeZone(session.getTimeZone());
player.printError("Couldn't find a snapshot before " player.printError(BBC.getPrefix() + "Couldn't find a snapshot before "
+ dateFormat.format(date.getTime()) + "."); + dateFormat.format(date.getTime()) + ".");
} else { } else {
session.setSnapshot(snapshot); session.setSnapshot(snapshot);
BBC.SNAPSHOT_SET.send(player, snapshot.getName()); BBC.SNAPSHOT_SET.send(player, snapshot.getName());
} }
} catch (MissingWorldException ex) { } catch (MissingWorldException ex) {
player.printError("No snapshots were found for this world."); BBC.SNAPSHOT_NOT_FOUND_WORLD.send(player);
} }
} }
} }
@ -247,27 +247,27 @@ public class SnapshotCommands {
LocalConfiguration config = we.getConfiguration(); LocalConfiguration config = we.getConfiguration();
if (config.snapshotRepo == null) { if (config.snapshotRepo == null) {
player.printError("Snapshot/backup restore is not configured."); BBC.SNAPSHOT_NOT_CONFIGURED.send(player);
return; return;
} }
Calendar date = session.detectDate(args.getJoinedStrings(0)); Calendar date = session.detectDate(args.getJoinedStrings(0));
if (date == null) { if (date == null) {
player.printError("Could not detect the date inputted."); BBC.SNAPSHOT_ERROR_DATE.send(player);
} else { } else {
try { try {
Snapshot snapshot = config.snapshotRepo.getSnapshotAfter(date, player.getWorld().getName()); Snapshot snapshot = config.snapshotRepo.getSnapshotAfter(date, player.getWorld().getName());
if (snapshot == null) { if (snapshot == null) {
dateFormat.setTimeZone(session.getTimeZone()); dateFormat.setTimeZone(session.getTimeZone());
player.printError("Couldn't find a snapshot after " player.printError(BBC.getPrefix() + "Couldn't find a snapshot after "
+ dateFormat.format(date.getTime()) + "."); + dateFormat.format(date.getTime()) + ".");
} else { } else {
session.setSnapshot(snapshot); session.setSnapshot(snapshot);
BBC.SNAPSHOT_SET.send(player, snapshot.getName()); BBC.SNAPSHOT_SET.send(player, snapshot.getName());
} }
} catch (MissingWorldException ex) { } catch (MissingWorldException ex) {
player.printError("No snapshots were found for this world."); BBC.SNAPSHOT_NOT_FOUND_WORLD.send(player);
} }
} }
} }

Datei anzeigen

@ -66,7 +66,7 @@ public class SnapshotUtilCommands {
LocalConfiguration config = we.getConfiguration(); LocalConfiguration config = we.getConfiguration();
if (config.snapshotRepo == null) { if (config.snapshotRepo == null) {
player.printError("Snapshot/backup restore is not configured."); BBC.SNAPSHOT_NOT_CONFIGURED.send(player);
return; return;
} }
@ -77,7 +77,7 @@ public class SnapshotUtilCommands {
try { try {
snapshot = config.snapshotRepo.getSnapshot(args.getString(0)); snapshot = config.snapshotRepo.getSnapshot(args.getString(0));
} catch (InvalidSnapshotException e) { } catch (InvalidSnapshotException e) {
player.printError("That snapshot does not exist or is not available."); BBC.SNAPSHOT_NOT_AVAILABLE.send(player);
return; return;
} }
} else { } else {
@ -90,7 +90,7 @@ public class SnapshotUtilCommands {
snapshot = config.snapshotRepo.getDefaultSnapshot(player.getWorld().getName()); snapshot = config.snapshotRepo.getDefaultSnapshot(player.getWorld().getName());
if (snapshot == null) { if (snapshot == null) {
player.printError("No snapshots were found. See console for details."); BBC.SNAPSHOT_NOT_AVAILABLE.send(player);
// Okay, let's toss some debugging information! // Okay, let's toss some debugging information!
File dir = config.snapshotRepo.getDirectory(); File dir = config.snapshotRepo.getDirectory();
@ -107,7 +107,7 @@ public class SnapshotUtilCommands {
return; return;
} }
} catch (MissingWorldException ex) { } catch (MissingWorldException ex) {
player.printError("No snapshots were found for this world."); BBC.SNAPSHOT_NOT_FOUND_WORLD.send(player);
return; return;
} }
} }
@ -119,10 +119,10 @@ public class SnapshotUtilCommands {
chunkStore = snapshot.getChunkStore(); chunkStore = snapshot.getChunkStore();
BBC.SNAPSHOT_LOADED.send(player, snapshot.getName()); BBC.SNAPSHOT_LOADED.send(player, snapshot.getName());
} catch (DataException e) { } catch (DataException e) {
player.printError("Failed to load snapshot: " + e.getMessage()); player.printError(BBC.getPrefix() + "Failed to load snapshot: " + e.getMessage());
return; return;
} catch (IOException e) { } catch (IOException e) {
player.printError("Failed to load snapshot: " + e.getMessage()); player.printError(BBC.getPrefix() + "Failed to load snapshot: " + e.getMessage());
return; return;
} }
@ -136,10 +136,10 @@ public class SnapshotUtilCommands {
if (restore.hadTotalFailure()) { if (restore.hadTotalFailure()) {
String error = restore.getLastErrorMessage(); String error = restore.getLastErrorMessage();
if (error != null) { if (error != null) {
player.printError("Errors prevented any blocks from being restored."); BBC.SNAPSHOT_ERROR_RESTORE.send(player);
player.printError("Last error: " + error); player.printError(BBC.getPrefix() + "Last error: " + error);
} else { } else {
player.printError("No chunks could be loaded. (Bad archive?)"); BBC.SNAPSHOT_ERROR_RESTORE_CHUNKS.send(player);
} }
} else { } else {
player.print(BBC.getPrefix() + String.format("Restored; %d " player.print(BBC.getPrefix() + String.format("Restored; %d "

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.BBC;
import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandContext;
import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.CommandPermissions;
@ -55,7 +56,7 @@ public class ToolUtilCommands {
String newState = args.getString(0, null); String newState = args.getString(0, null);
if (session.hasSuperPickAxe()) { if (session.hasSuperPickAxe()) {
if ("on".equals(newState)) { if ("on".equals(newState)) {
player.printError("Super pick axe already enabled."); player.printError(BBC.getPrefix() + "Super pick axe already enabled.");
return; return;
} }
@ -63,7 +64,7 @@ public class ToolUtilCommands {
player.print("Super pick axe disabled."); player.print("Super pick axe disabled.");
} else { } else {
if ("off".equals(newState)) { if ("off".equals(newState)) {
player.printError("Super pick axe already disabled."); player.printError(BBC.getPrefix() + "Super pick axe already disabled.");
return; return;
} }
session.enableSuperPickAxe(); session.enableSuperPickAxe();

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.config.BBC;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.entity.Player;
@ -87,7 +88,7 @@ public class DistanceWand extends BrushTool implements DoubleActionTraceTool {
} }
if (target == null) { if (target == null) {
player.printError("No block in sight!"); BBC.NO_BLOCK.send(player);
return null; return null;
} }

Datei anzeigen

@ -20,6 +20,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.object.collection.BlockVectorSet; import com.boydti.fawe.object.collection.BlockVectorSet;
import com.boydti.fawe.config.BBC;
import com.boydti.fawe.object.collection.LocalBlockVectorSet; import com.boydti.fawe.object.collection.LocalBlockVectorSet;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
@ -75,7 +76,7 @@ public class FloatingTreeRemover implements BlockTool {
final BlockState state = world.getBlock(clicked.toVector().toBlockPoint()); final BlockState state = world.getBlock(clicked.toVector().toBlockPoint());
if (!isTreeBlock(state.getBlockType())) { if (!isTreeBlock(state.getBlockType())) {
player.printError("That's not a tree."); BBC.TOOL_DELTREE_ERROR.send(player);
return true; return true;
} }
@ -83,7 +84,7 @@ public class FloatingTreeRemover implements BlockTool {
try { try {
final Set<BlockVector3> blockSet = bfs(world, clicked.toVector().toBlockPoint()); final Set<BlockVector3> blockSet = bfs(world, clicked.toVector().toBlockPoint());
if (blockSet == null) { if (blockSet == null) {
player.printError("That's not a floating tree."); BBC.TOOL_DELTREE_FLOATING_ERROR.send(player);
return true; return true;
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.config.BBC;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
@ -60,10 +61,10 @@ public class TreePlanter implements BlockTool {
} }
if (!successful) { if (!successful) {
player.printError("A tree can't go there."); BBC.TOOL_TREE_ERROR_BLOCK.send(player);
} }
} catch (MaxChangedBlocksException e) { } catch (MaxChangedBlocksException e) {
player.printError("Max. blocks changed reached."); BBC.WORLDEDIT_CANCEL_REASON_MAX_CHANGES.send(player);
} finally { } finally {
session.remember(editSession); session.remember(editSession);
} }

Datei anzeigen

@ -511,7 +511,7 @@ public class PlatformManager {
if (faweException != null) { if (faweException != null) {
BBC.WORLDEDIT_CANCEL_REASON.send(player, faweException.getMessage()); BBC.WORLDEDIT_CANCEL_REASON.send(player, faweException.getMessage());
} else { } else {
player.printError("Please report this error: [See console]"); player.printError(BBC.getPrefix() + "Please report this error: [See console]");
player.printRaw(e.getClass().getName() + ": " + e.getMessage()); player.printRaw(e.getClass().getName() + ": " + e.getMessage());
MainUtil.handleError(e); MainUtil.handleError(e);
} }

Datei anzeigen

@ -210,7 +210,7 @@ public class ClipboardFormats {
} }
f = player.openFileOpenDialog(extensions); f = player.openFileOpenDialog(extensions);
if (f == null || !f.exists()) { if (f == null || !f.exists()) {
if (message) player.printError("Schematic " + input + " does not exist! (" + f + ")"); if (message) player.printError(BBC.getPrefix() + "Schematic " + input + " does not exist! (" + f + ")");
return null; return null;
} }
} else { } else {
@ -231,7 +231,7 @@ public class ClipboardFormats {
} }
} }
if (f == null || !f.exists() || !MainUtil.isInSubDirectory(working, f)) { if (f == null || !f.exists() || !MainUtil.isInSubDirectory(working, f)) {
if (message) player.printError("Schematic " + input + " does not exist! (" + ((f == null) ? false : f.exists()) + "|" + f + "|" + (f == null ? false : !MainUtil.isInSubDirectory(working, f)) + ")"); if (message) player.printError(BBC.getPrefix() + "Schematic " + input + " does not exist! (" + ((f == null) ? false : f.exists()) + "|" + f + "|" + (f == null ? false : !MainUtil.isInSubDirectory(working, f)) + ")");
return null; return null;
} }
if (format == null && f.isFile()) { if (format == null && f.isFile()) {