This commit is contained in:
Jesse Boyd
2019-04-07 17:41:51 +10:00
17 changed files with 111 additions and 91 deletions

View File

@ -115,7 +115,7 @@ public class ChunkCommands {
FileOutputStream out = 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")) {
try {
out = new FileOutputStream("worldedit-delchunks.bat");

View File

@ -68,7 +68,7 @@ public class GeneralCommands {
int limit = args.argsLength() == 0 ? config.defaultChangeLimit : Math.max(-1, args.getInteger(0));
if (!mayDisable && config.maxChangeLimit > -1) {
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;
}
}
@ -76,9 +76,9 @@ public class GeneralCommands {
session.setBlockChangeLimit(limit);
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 {
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));
if (!mayDisable && config.maxCalculationTimeout > -1) {
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;
}
}
@ -106,9 +106,9 @@ public class GeneralCommands {
session.setTimeout(limit);
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 {
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);
if (session.hasFastMode()) {
if ("on".equals(newState)) {
player.printError("Fast mode already enabled.");
player.printError(BBC.getPrefix() + "Fast mode already enabled.");
return;
}
@ -133,7 +133,7 @@ public class GeneralCommands {
player.print("Fast mode disabled.");
} else {
if ("off".equals(newState)) {
player.printError("Fast mode already disabled.");
player.printError(BBC.getPrefix() + "Fast mode already disabled.");
return;
}
@ -158,7 +158,7 @@ public class GeneralCommands {
String newState = args.getString(0, null);
if (session.shouldUseServerCUI()) {
if ("on".equals(newState)) {
player.printError("Server CUI already enabled.");
player.printError(BBC.getPrefix() + "Server CUI already enabled.");
return;
}
@ -167,7 +167,7 @@ public class GeneralCommands {
player.print("Server CUI disabled.");
} else {
if ("off".equals(newState)) {
player.printError("Server CUI already disabled.");
player.printError(BBC.getPrefix() + "Server CUI already disabled.");
return;
}

View File

@ -249,7 +249,7 @@ public class RegionCommands extends MethodCommands {
@Switch('h') boolean shell) throws WorldEditException {
if (!(region instanceof CuboidRegion)) {
player.printError("//line only works with cuboid selections");
player.printError(BBC.getPrefix() + "//line only works with cuboid selections");
return;
}
@ -770,7 +770,7 @@ public class RegionCommands extends MethodCommands {
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 {
int affected = editSession.makeForest(region, density / 100, type);
player.print(affected + " trees created.");
BBC.COMMAND_TREE.send(player, affected);
}
@Command(

View File

@ -243,7 +243,7 @@ public class SchematicCommands extends MethodCommands {
}
f = player.openFileOpenDialog(extensions);
if (f == null || !f.exists()) {
player.printError("Schematic " + filename + " does not exist! (" + f + ")");
player.printError(BBC.getPrefix() + "Schematic " + filename + " does not exist! (" + f + ")");
return;
}
} else {
@ -264,7 +264,7 @@ public class SchematicCommands extends MethodCommands {
}
}
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;
}
if (format == null) {
@ -280,9 +280,9 @@ public class SchematicCommands extends MethodCommands {
format.hold(player, uri, in);
BBC.SCHEMATIC_LOADED.send(player, filename);
} catch (IllegalArgumentException e) {
player.printError("Unknown filename: " + filename);
player.printError(BBC.getPrefix() + "Unknown filename: " + filename);
} 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);
} finally {
if (in != null) {
@ -301,7 +301,7 @@ public class SchematicCommands extends MethodCommands {
final LocalConfiguration config = this.worldEdit.getConfiguration();
final ClipboardFormat format = ClipboardFormats.findByAlias(formatName);
if (format == null) {
player.printError("Unknown schematic format: " + formatName);
player.printError(BBC.getPrefix() + "Unknown schematic format: " + formatName);
return;
}
File working = this.worldEdit.getWorkingDirectoryFile(config.saveDir);
@ -333,7 +333,7 @@ public class SchematicCommands extends MethodCommands {
Files.createDirectories(parent.toPath());
} catch (IOException e) {
e.printStackTrace();
log.info("Could not create folder for schematics!");
log.info(BBC.getPrefix() + "Could not create folder for schematics!");
return;
}
}
@ -378,11 +378,11 @@ public class SchematicCommands extends MethodCommands {
}
} catch (IllegalArgumentException e) {
e.printStackTrace();
player.printError("Unknown filename: " + filename);
player.printError(BBC.getPrefix() + "Unknown filename: " + filename);
} catch (IOException e) {
e.printStackTrace();
player.printError("Schematic could not written: " + e.getMessage());
log.warn("Failed to write a saved clipboard", e);
player.printError(BBC.getPrefix() + "Schematic could not written: " + e.getMessage());
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;
File destDir = new File(dir, directory);
if (!MainUtil.isInSubDirectory(working, destDir)) {
player.printError("Directory " + destDir + " does not exist!");
player.printError(BBC.getPrefix() + "Directory " + destDir + " does not exist!");
return;
}
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;
}
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;
}
for (File source : sources) {
@ -454,7 +454,7 @@ public class SchematicCommands extends MethodCommands {
}
for (File f : files) {
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;
}
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;
}
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;
}
BBC.FILE_DELETED.send(player, filename);

View File

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

View File

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

View File

@ -68,7 +68,7 @@ public class SnapshotCommands {
LocalConfiguration config = we.getConfiguration();
if (config.snapshotRepo == null) {
player.printError("Snapshot/backup restore is not configured.");
BBC.SNAPSHOT_NOT_CONFIGURED.send(player);
return;
}
@ -86,22 +86,22 @@ public class SnapshotCommands {
BBC.SNAPSHOT_LIST_FOOTER.send(player);
} else {
player.printError("No snapshots are available. See console for details.");
BBC.SNAPSHOT_NOT_AVAILABLE.send(player);
// Okay, let's toss some debugging information!
File dir = config.snapshotRepo.getDirectory();
try {
WorldEdit.logger.info("WorldEdit found no snapshots: looked in: "
WorldEdit.logger.info(BBC.getPrefix() + "WorldEdit found no snapshots: looked in: "
+ dir.getCanonicalPath());
} 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?): "
+ dir.getPath());
}
}
} 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();
if (config.snapshotRepo == null) {
player.printError("Snapshot/backup restore is not configured.");
BBC.SNAPSHOT_NOT_CONFIGURED.send(player);
return;
}
@ -133,17 +133,17 @@ public class SnapshotCommands {
session.setSnapshot(null);
BBC.SNAPSHOT_NEWEST.send(player);
} else {
player.printError("No snapshots were found.");
BBC.SNAPSHOT_NOT_FOUND.send(player);
}
} catch (MissingWorldException ex) {
player.printError("No snapshots were found for this world.");
BBC.SNAPSHOT_NOT_FOUND_WORLD.send(player);
}
} else {
try {
session.setSnapshot(config.snapshotRepo.getSnapshot(name));
BBC.SNAPSHOT_SET.send(player, name);
} 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();
if (config.snapshotRepo == null) {
player.printError("Snapshot/backup restore is not configured.");
BBC.SNAPSHOT_NOT_CONFIGURED.send(player);
return;
}
@ -168,30 +168,30 @@ public class SnapshotCommands {
try {
index = Integer.parseInt(args.getString(0));
} 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;
}
if (index < 1) {
player.printError("Invalid index, must be equal or higher then 1.");
BBC.SNAPSHOT_INVALID_INDEX.send(player);
return;
}
try {
List<Snapshot> snapshots = config.snapshotRepo.getSnapshots(true, player.getWorld().getName());
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;
}
Snapshot snapshot = snapshots.get(index - 1);
if (snapshot == null) {
player.printError("That snapshot does not exist or is not available.");
BBC.SNAPSHOT_NOT_AVAILABLE.send(player);
return;
}
session.setSnapshot(snapshot);
BBC.SNAPSHOT_SET.send(player, snapshot.getName());
} 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();
if (config.snapshotRepo == null) {
player.printError("Snapshot/backup restore is not configured.");
BBC.SNAPSHOT_NOT_CONFIGURED.send(player);
return;
}
Calendar date = session.detectDate(args.getJoinedStrings(0));
if (date == null) {
player.printError("Could not detect the date inputted.");
BBC.SNAPSHOT_ERROR_DATE.send(player);
} else {
try {
Snapshot snapshot = config.snapshotRepo.getSnapshotBefore(date, player.getWorld().getName());
if (snapshot == null) {
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()) + ".");
} else {
session.setSnapshot(snapshot);
BBC.SNAPSHOT_SET.send(player, snapshot.getName());
}
} 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();
if (config.snapshotRepo == null) {
player.printError("Snapshot/backup restore is not configured.");
BBC.SNAPSHOT_NOT_CONFIGURED.send(player);
return;
}
Calendar date = session.detectDate(args.getJoinedStrings(0));
if (date == null) {
player.printError("Could not detect the date inputted.");
BBC.SNAPSHOT_ERROR_DATE.send(player);
} else {
try {
Snapshot snapshot = config.snapshotRepo.getSnapshotAfter(date, player.getWorld().getName());
if (snapshot == null) {
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()) + ".");
} else {
session.setSnapshot(snapshot);
BBC.SNAPSHOT_SET.send(player, snapshot.getName());
}
} catch (MissingWorldException ex) {
player.printError("No snapshots were found for this world.");
BBC.SNAPSHOT_NOT_FOUND_WORLD.send(player);
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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