mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Minors
- Make disallowed-blocks translatable - Add more trnslatable messages - Update WorldEdit messages missing a prefix
This commit is contained in:
parent
7a88039711
commit
dcfa436c64
@ -236,6 +236,10 @@ public enum BBC {
|
|||||||
TIMEZONE_SET("Timezone set for this session to: %s0", "WorldEdit.Timezone"),
|
TIMEZONE_SET("Timezone set for this session to: %s0", "WorldEdit.Timezone"),
|
||||||
TIMEZONE_DISPLAY("The current time in that timezone is: %s0", "WorldEdit.Timezone"),
|
TIMEZONE_DISPLAY("The current time in that timezone is: %s0", "WorldEdit.Timezone"),
|
||||||
|
|
||||||
|
BLOCK_CYCLER_CANNOT_CYCLE("That block's data cannot be cycled!", "WorldEdit.Cycler"),
|
||||||
|
BLOCK_CYCLER_LIMIT("Max blocks change limit reached.", "WorldEdit.Cycler"),
|
||||||
|
BLOCK_CYCLER_NO_PERM("&cYou are not permitted to cycle the data value of that block.", "WorldEdit.Cycler"),
|
||||||
|
|
||||||
COMMAND_INVALID_SYNTAX("The command was not used properly (no more help available).", "WorldEdit.Command"),
|
COMMAND_INVALID_SYNTAX("The command was not used properly (no more help available).", "WorldEdit.Command"),
|
||||||
|
|
||||||
COMMAND_CLARIFYING_BRACKET("&7Added clarifying bracket for &c%s0", "WorldEdit.Help"),
|
COMMAND_CLARIFYING_BRACKET("&7Added clarifying bracket for &c%s0", "WorldEdit.Help"),
|
||||||
@ -254,6 +258,7 @@ public enum BBC {
|
|||||||
|
|
||||||
COMMAND_SYNTAX("&cUsage: &7%s0", "Error"),
|
COMMAND_SYNTAX("&cUsage: &7%s0", "Error"),
|
||||||
NO_PERM("&cYou are lacking the permission node: %s0", "Error"),
|
NO_PERM("&cYou are lacking the permission node: %s0", "Error"),
|
||||||
|
BLOCK_NOT_ALLOWED("You are not allowed to use", "Error"),
|
||||||
SETTING_DISABLE("&cLacking setting: %s0", "Error"),
|
SETTING_DISABLE("&cLacking setting: %s0", "Error"),
|
||||||
BRUSH_NOT_FOUND("&cAvailable brushes: %s0", "Error"),
|
BRUSH_NOT_FOUND("&cAvailable brushes: %s0", "Error"),
|
||||||
BRUSH_INCOMPATIBLE("&cBrush not compatible with this version", "Error"),
|
BRUSH_INCOMPATIBLE("&cBrush not compatible with this version", "Error"),
|
||||||
|
@ -152,7 +152,7 @@ public abstract class HelpBuilder implements Runnable {
|
|||||||
displayFailure(BBC.HELP_SUGGEST.f(arg, StringMan.join(found, ", ")));
|
displayFailure(BBC.HELP_SUGGEST.f(arg, StringMan.join(found, ", ")));
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
String msg = String.format("The sub-command '%s' under '%s' could not be found.",
|
String msg = String.format(BBC.getPrefix() + "The sub-command '%s' under '%s' could not be found.",
|
||||||
command, Joiner.on(" ").join(visited));
|
command, Joiner.on(" ").join(visited));
|
||||||
displayFailure(msg);
|
displayFailure(msg);
|
||||||
return;
|
return;
|
||||||
|
@ -165,8 +165,8 @@ public class NavigationCommands {
|
|||||||
@Command(
|
@Command(
|
||||||
aliases = {"jumpto", "j"},
|
aliases = {"jumpto", "j"},
|
||||||
usage = "[world,x,y,z]",
|
usage = "[world,x,y,z]",
|
||||||
desc = "Teleport to a location" +
|
desc = "Teleport to a location\n" +
|
||||||
"Flags:\n" +
|
"Flags:" +
|
||||||
" -f forces the specified position to be used",
|
" -f forces the specified position to be used",
|
||||||
flags = "f",
|
flags = "f",
|
||||||
min = 0,
|
min = 0,
|
||||||
|
@ -267,14 +267,14 @@ public class OptionsCommands {
|
|||||||
actor.print(BBC.getPrefix() + type.getId() + " (" + type.getName() + ")");
|
actor.print(BBC.getPrefix() + type.getId() + " (" + type.getName() + ")");
|
||||||
} else {
|
} else {
|
||||||
if (query.length() <= 2) {
|
if (query.length() <= 2) {
|
||||||
actor.printError("Enter a longer search string (len > 2).");
|
actor.printError(BBC.getPrefix() + "Enter a longer search string (len > 2).");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!blocksOnly && !itemsOnly) {
|
if (!blocksOnly && !itemsOnly) {
|
||||||
actor.print(BBC.getPrefix() + "Searching for: " + query);
|
actor.print(BBC.getPrefix() + "Searching for: " + query);
|
||||||
} else if (blocksOnly && itemsOnly) {
|
} else if (blocksOnly && itemsOnly) {
|
||||||
actor.printError("You cannot use both the 'b' and 'i' flags simultaneously.");
|
actor.printError(BBC.getPrefix() + "You cannot use both the 'b' and 'i' flags simultaneously.");
|
||||||
return;
|
return;
|
||||||
} else if (blocksOnly) {
|
} else if (blocksOnly) {
|
||||||
actor.print(BBC.getPrefix() + "Searching for blocks: " + query);
|
actor.print(BBC.getPrefix() + "Searching for blocks: " + query);
|
||||||
@ -308,7 +308,7 @@ public class OptionsCommands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (found == 0) {
|
if (found == 0) {
|
||||||
actor.printError("No items found.");
|
actor.printError(BBC.getPrefix() + "No items found.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.command.tool;
|
package com.sk89q.worldedit.command.tool;
|
||||||
|
|
||||||
|
import com.boydti.fawe.config.BBC;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.sk89q.worldedit.EditSession;
|
import com.sk89q.worldedit.EditSession;
|
||||||
import com.sk89q.worldedit.LocalConfiguration;
|
import com.sk89q.worldedit.LocalConfiguration;
|
||||||
@ -62,12 +63,12 @@ public class BlockDataCyler implements DoubleActionBlockTool {
|
|||||||
if (!config.allowedDataCycleBlocks.isEmpty()
|
if (!config.allowedDataCycleBlocks.isEmpty()
|
||||||
&& !player.hasPermission("worldedit.override.data-cycler")
|
&& !player.hasPermission("worldedit.override.data-cycler")
|
||||||
&& !config.allowedDataCycleBlocks.contains(block.getBlockType().getId())) {
|
&& !config.allowedDataCycleBlocks.contains(block.getBlockType().getId())) {
|
||||||
player.printError("You are not permitted to cycle the data value of that block.");
|
BBC.BLOCK_CYCLER_NO_PERM.send(player);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block.getStates().keySet().isEmpty()) {
|
if (block.getStates().keySet().isEmpty()) {
|
||||||
player.printError("That block's data cannot be cycled!");
|
BBC.BLOCK_CYCLER_CANNOT_CYCLE.send(player);
|
||||||
} else {
|
} else {
|
||||||
Property<?> currentProperty = selectedProperties.get(player.getUniqueId());
|
Property<?> currentProperty = selectedProperties.get(player.getUniqueId());
|
||||||
|
|
||||||
@ -88,9 +89,9 @@ public class BlockDataCyler implements DoubleActionBlockTool {
|
|||||||
EditSession editSession = session.createEditSession(player);
|
EditSession editSession = session.createEditSession(player);
|
||||||
try {
|
try {
|
||||||
editSession.setBlock(blockPoint, newBlock);
|
editSession.setBlock(blockPoint, newBlock);
|
||||||
player.print("Value of " + currentProperty.getName() + " is now " + currentProperty.getValues().get(index).toString());
|
player.print(BBC.getPrefix() + "Value of " + currentProperty.getName() + " is now " + currentProperty.getValues().get(index).toString());
|
||||||
} catch (MaxChangedBlocksException e) {
|
} catch (MaxChangedBlocksException e) {
|
||||||
player.printError("Max blocks change limit reached.");
|
BBC.BLOCK_CYCLER_LIMIT.send(player);
|
||||||
} finally {
|
} finally {
|
||||||
session.remember(editSession);
|
session.remember(editSession);
|
||||||
}
|
}
|
||||||
@ -101,7 +102,7 @@ public class BlockDataCyler implements DoubleActionBlockTool {
|
|||||||
index = (index + 1) % properties.size();
|
index = (index + 1) % properties.size();
|
||||||
currentProperty = properties.get(index);
|
currentProperty = properties.get(index);
|
||||||
selectedProperties.put(player.getUniqueId(), currentProperty);
|
selectedProperties.put(player.getUniqueId(), currentProperty);
|
||||||
player.print("Now cycling " + currentProperty.getName());
|
player.print(BBC.getPrefix() + "Now cycling " + currentProperty.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
@ -75,7 +76,7 @@ public class BlockReplacer implements DoubleActionBlockTool {
|
|||||||
|
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
this.pattern = targetBlock;
|
this.pattern = targetBlock;
|
||||||
player.print("Replacer tool switched to: " + type.getName());
|
player.print(BBC.getPrefix() + "Replacer tool switched to: " + type.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -309,12 +309,12 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
|||||||
if (context.isRestricted()) {
|
if (context.isRestricted()) {
|
||||||
Actor actor = context.requireActor();
|
Actor actor = context.requireActor();
|
||||||
if (!actor.hasPermission("worldedit.anyblock") && worldEdit.getConfiguration().checkDisallowedBlocks(holder)) {
|
if (!actor.hasPermission("worldedit.anyblock") && worldEdit.getConfiguration().checkDisallowedBlocks(holder)) {
|
||||||
throw new DisallowedUsageException(BBC.getPrefix() + "You are not allowed to use '" + holder + "'");
|
throw new DisallowedUsageException(BBC.BLOCK_NOT_ALLOWED + " '" + holder + "'");
|
||||||
}
|
}
|
||||||
CompoundTag nbt = holder.getNbtData();
|
CompoundTag nbt = holder.getNbtData();
|
||||||
if (nbt != null) {
|
if (nbt != null) {
|
||||||
if (!actor.hasPermission("worldedit.anyblock")) {
|
if (!actor.hasPermission("worldedit.anyblock")) {
|
||||||
throw new DisallowedUsageException(BBC.getPrefix() + "You are not allowed to nbt'");
|
throw new DisallowedUsageException("You are not allowed to nbt'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
package com.sk89q.worldedit.util.command;
|
package com.sk89q.worldedit.util.command;
|
||||||
|
|
||||||
import com.boydti.fawe.Fawe;
|
import com.boydti.fawe.Fawe;
|
||||||
|
import com.boydti.fawe.config.BBC;
|
||||||
import com.boydti.fawe.util.StringMan;
|
import com.boydti.fawe.util.StringMan;
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.sk89q.minecraft.util.commands.CommandException;
|
import com.sk89q.minecraft.util.commands.CommandException;
|
||||||
@ -141,7 +142,7 @@ public class SimpleDispatcher implements Dispatcher {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new InvalidUsageException("Please choose a sub-command.", this, true);
|
throw new InvalidUsageException(BBC.getPrefix() + "Please choose a sub-command.", this, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.sk89q.worldedit.util.command.parametric;
|
package com.sk89q.worldedit.util.command.parametric;
|
||||||
|
|
||||||
|
import com.boydti.fawe.config.BBC;
|
||||||
import com.boydti.fawe.util.StringMan;
|
import com.boydti.fawe.util.StringMan;
|
||||||
import com.google.common.primitives.Chars;
|
import com.google.common.primitives.Chars;
|
||||||
import com.sk89q.minecraft.util.commands.*;
|
import com.sk89q.minecraft.util.commands.*;
|
||||||
@ -276,14 +277,14 @@ public class FunctionParametricCallable extends AParametricCallable {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
} catch (MissingParameterException e) {
|
} catch (MissingParameterException e) {
|
||||||
throw new InvalidUsageException("Too few parameters!", this, true);
|
throw new InvalidUsageException(BBC.getPrefix() + "Too few parameters!", this, true);
|
||||||
} catch (UnconsumedParameterException e) {
|
} catch (UnconsumedParameterException e) {
|
||||||
throw new InvalidUsageException("Too many parameters! Unused parameters: " + e.getUnconsumed(), this, true);
|
throw new InvalidUsageException(BBC.getPrefix() + "Too many parameters! Unused parameters: " + e.getUnconsumed(), this, true);
|
||||||
} catch (ParameterException e) {
|
} catch (ParameterException e) {
|
||||||
assert parameter != null;
|
assert parameter != null;
|
||||||
String name = parameter.getName();
|
String name = parameter.getName();
|
||||||
|
|
||||||
throw new InvalidUsageException("For parameter '" + name + "': " + e.getMessage(), this, true);
|
throw new InvalidUsageException(BBC.getPrefix() + "For parameter '" + name + "': " + e.getMessage(), this, true);
|
||||||
} catch (InvocationTargetException e) {
|
} catch (InvocationTargetException e) {
|
||||||
if (e.getCause() instanceof CommandException) {
|
if (e.getCause() instanceof CommandException) {
|
||||||
throw (CommandException) e.getCause();
|
throw (CommandException) e.getCause();
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
package com.sk89q.worldedit.util.command.parametric;
|
package com.sk89q.worldedit.util.command.parametric;
|
||||||
|
|
||||||
import com.boydti.fawe.command.SuggestInputParseException;
|
import com.boydti.fawe.command.SuggestInputParseException;
|
||||||
|
import com.boydti.fawe.config.BBC;
|
||||||
import com.google.common.primitives.Chars;
|
import com.google.common.primitives.Chars;
|
||||||
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;
|
||||||
@ -270,9 +271,9 @@ public class ParametricCallable extends AParametricCallable {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
} catch (MissingParameterException e) {
|
} catch (MissingParameterException e) {
|
||||||
throw new InvalidUsageException("Too few parameters!", this, true);
|
throw new InvalidUsageException(BBC.getPrefix() + "Too few parameters!", this, true);
|
||||||
} catch (UnconsumedParameterException e) {
|
} catch (UnconsumedParameterException e) {
|
||||||
throw new InvalidUsageException("Too many parameters! Unused parameters: " + e.getUnconsumed(), this, true);
|
throw new InvalidUsageException(BBC.getPrefix() + "Too many parameters! Unused parameters: " + e.getUnconsumed(), this, true);
|
||||||
} catch (ParameterException e) {
|
} catch (ParameterException e) {
|
||||||
assert parameter != null;
|
assert parameter != null;
|
||||||
String name = parameter.getName();
|
String name = parameter.getName();
|
||||||
|
Loading…
Reference in New Issue
Block a user