Craftscript installation instructions
This commit is contained in:
parent
b9d267a908
commit
dcf46bbd3a
@ -28,6 +28,7 @@ import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.scripting.RhinoCraftScriptEngine;
|
||||
import java.io.File;
|
||||
|
||||
|
||||
@ -69,10 +70,13 @@ public class ScriptingCommands {
|
||||
final File dir = this.worldEdit.getWorkingDirectoryFile(this.worldEdit.getConfiguration().scriptsDir);
|
||||
final File f = this.worldEdit.getSafeOpenFile(player, dir, name, "js", "js");
|
||||
try {
|
||||
this.worldEdit.runScript(LocationMaskedPlayerWrapper.unwrap(player), f, scriptArgs);
|
||||
} catch (final WorldEditException ex) {
|
||||
player.printError("Error while executing CraftScript.");
|
||||
new RhinoCraftScriptEngine();
|
||||
} catch (NoClassDefFoundError e) {
|
||||
player.printError("Failed to find an installed script engine.");
|
||||
player.printError("Please ");
|
||||
return;
|
||||
}
|
||||
this.worldEdit.runScript(LocationMaskedPlayerWrapper.unwrap(player), f, scriptArgs);
|
||||
}
|
||||
|
||||
@Command(aliases = {".s"}, usage = "[args...]", desc = "Execute last CraftScript", min = 0, max = -1)
|
||||
|
Loading…
Reference in New Issue
Block a user