mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-16 03:14:04 +00:00
Added a tonne more translations
This commit is contained in:
@@ -49,6 +49,8 @@ import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.util.concurrency.EvenMoreExecutors;
|
||||
import com.sk89q.worldedit.util.eventbus.EventBus;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
import com.sk89q.worldedit.util.io.file.FileSelectionAbortedException;
|
||||
import com.sk89q.worldedit.util.io.file.FilenameException;
|
||||
import com.sk89q.worldedit.util.io.file.FilenameResolutionException;
|
||||
@@ -634,7 +636,7 @@ public final class WorldEdit {
|
||||
* @param player the player
|
||||
* @param f the script file to execute
|
||||
* @param args arguments for the script
|
||||
* @throws WorldEditException
|
||||
* @throws WorldEditException if something goes wrong
|
||||
*/
|
||||
public void runScript(Player player, File f, String[] args) throws WorldEditException {
|
||||
String filename = f.getPath();
|
||||
@@ -642,7 +644,7 @@ public final class WorldEdit {
|
||||
String ext = filename.substring(index + 1);
|
||||
|
||||
if (!ext.equalsIgnoreCase("js")) {
|
||||
player.printError("Only .js scripts are currently supported");
|
||||
player.printError(TranslatableComponent.of("worldedit.script.unsupported"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -655,7 +657,7 @@ public final class WorldEdit {
|
||||
file = WorldEdit.class.getResourceAsStream("craftscripts/" + filename);
|
||||
|
||||
if (file == null) {
|
||||
player.printError("Script does not exist: " + filename);
|
||||
player.printError(TranslatableComponent.of("worldedit.script.file-not-found", TextComponent.of(filename)));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@@ -668,7 +670,7 @@ public final class WorldEdit {
|
||||
in.close();
|
||||
script = new String(data, 0, data.length, StandardCharsets.UTF_8);
|
||||
} catch (IOException e) {
|
||||
player.printError("Script read error: " + e.getMessage());
|
||||
player.printError(TranslatableComponent.of("worldedit.script.read-error", TextComponent.of(e.getMessage())));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -681,8 +683,7 @@ public final class WorldEdit {
|
||||
try {
|
||||
engine = new RhinoCraftScriptEngine();
|
||||
} catch (NoClassDefFoundError ignored) {
|
||||
player.printError("Failed to find an installed script engine.");
|
||||
player.printError("Please see https://worldedit.enginehub.org/en/latest/usage/other/craftscripts/");
|
||||
player.printError(TranslatableComponent.of("worldedit.script.no-script-engine"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -696,14 +697,13 @@ public final class WorldEdit {
|
||||
try {
|
||||
engine.evaluate(script, filename, vars);
|
||||
} catch (ScriptException e) {
|
||||
player.printError("Failed to execute:");
|
||||
player.print(TextComponent.of(e.getMessage()));
|
||||
player.printError(TranslatableComponent.of("worldedit.script.failed", TextComponent.of(e.getMessage(), TextColor.WHITE)));
|
||||
logger.warn("Failed to execute script", e);
|
||||
} catch (NumberFormatException | WorldEditException e) {
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
player.printError("Failed to execute (see console):");
|
||||
player.print(TextComponent.of(e.getClass().getCanonicalName()));
|
||||
player.printError(TranslatableComponent.of("worldedit.script.failed-console", TextComponent.of(e.getClass().getCanonicalName(),
|
||||
TextColor.WHITE)));
|
||||
logger.warn("Failed to execute script", e);
|
||||
} finally {
|
||||
for (EditSession editSession : scriptContext.getEditSessions()) {
|
||||
|
Reference in New Issue
Block a user