mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-23 08:31:37 +01:00
Changes
This commit is contained in:
parent
9f31132bdf
commit
19aba97351
@ -54,8 +54,7 @@ public class Citizens extends JavaPlugin {
|
||||
private boolean compatible;
|
||||
private Settings config;
|
||||
private CitizensNPCManager npcManager;
|
||||
private Storage saves; // TODO: refactor this into an NPCStore (remove
|
||||
// dependency on Storage).
|
||||
private Storage saves;
|
||||
private CitizensTraitManager traitManager;
|
||||
|
||||
public CommandManager getCommandManager() {
|
||||
@ -229,7 +228,6 @@ public class Citizens extends JavaPlugin {
|
||||
private void registerScriptHelpers() {
|
||||
ScriptCompiler compiler = CitizensAPI.getScriptCompiler();
|
||||
compiler.registerGlobalContextProvider(new EventRegistrar(this));
|
||||
|
||||
}
|
||||
|
||||
private void registerCommands() {
|
||||
|
@ -28,25 +28,27 @@ public class AdminCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = "citizens",
|
||||
modifiers = "script",
|
||||
desc = "compile and run a script",
|
||||
min = 2,
|
||||
max = 2,
|
||||
permission = "scripts.run")
|
||||
aliases = "citizens",
|
||||
modifiers = "script",
|
||||
desc = "compile and run a script",
|
||||
min = 2,
|
||||
max = 2,
|
||||
permission = "script.run")
|
||||
@ServerCommand
|
||||
public void runScript(CommandContext args, final CommandSender sender, NPC npc) throws CommandException {
|
||||
File file = new File(args.getString(1));
|
||||
if (!file.exists())
|
||||
throw new CommandException("file doesn't exist!");
|
||||
sender.sendMessage("Could put into queue? "
|
||||
+ CitizensAPI.getScriptCompiler().compile(file).withCallback(new CompileCallback() {
|
||||
@Override
|
||||
public void onScriptCompiled(ScriptFactory script) {
|
||||
script.newInstance();
|
||||
sender.sendMessage("Script compiled.");
|
||||
}
|
||||
}).begin());
|
||||
throw new CommandException("The file '" + args.getString(1) + "' doesn't exist!");
|
||||
Messaging.send(
|
||||
sender,
|
||||
"Could put into queue? "
|
||||
+ CitizensAPI.getScriptCompiler().compile(file).withCallback(new CompileCallback() {
|
||||
@Override
|
||||
public void onScriptCompiled(ScriptFactory script) {
|
||||
script.newInstance();
|
||||
Messaging.send(sender, "<a>Script compiled!");
|
||||
}
|
||||
}).begin());
|
||||
}
|
||||
|
||||
@Command(aliases = { "citizens" }, desc = "Show basic plugin information", max = 0, permission = "admin")
|
||||
@ -59,13 +61,13 @@ public class AdminCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "citizens" },
|
||||
usage = "reload",
|
||||
desc = "Reload Citizens",
|
||||
modifiers = { "reload" },
|
||||
min = 1,
|
||||
max = 1,
|
||||
permission = "admin")
|
||||
aliases = { "citizens" },
|
||||
usage = "reload",
|
||||
desc = "Reload Citizens",
|
||||
modifiers = { "reload" },
|
||||
min = 1,
|
||||
max = 1,
|
||||
permission = "admin")
|
||||
@ServerCommand
|
||||
public void reload(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||
Messaging.send(sender, "<e>Reloading Citizens...");
|
||||
@ -79,13 +81,13 @@ public class AdminCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "citizens" },
|
||||
usage = "save",
|
||||
desc = "Save NPCs",
|
||||
modifiers = { "save" },
|
||||
min = 1,
|
||||
max = 1,
|
||||
permission = "admin")
|
||||
aliases = { "citizens" },
|
||||
usage = "save",
|
||||
desc = "Save NPCs",
|
||||
modifiers = { "save" },
|
||||
min = 1,
|
||||
max = 1,
|
||||
permission = "admin")
|
||||
@ServerCommand
|
||||
public void save(CommandContext args, CommandSender sender, NPC npc) {
|
||||
Messaging.send(sender, "<e>Saving Citizens...");
|
||||
|
@ -37,4 +37,7 @@ permissions:
|
||||
citizens.npc.talk: true
|
||||
citizens.npc.tp: true
|
||||
citizens.npc.tphere: true
|
||||
citizens.npc.lookclose: true
|
||||
citizens.npc.lookclose: true
|
||||
citizens.script.*:
|
||||
children:
|
||||
citizens.script.run: true
|
Loading…
Reference in New Issue
Block a user