mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-28 20:17:50 +01:00
Hook into new event ContextProvider
This commit is contained in:
parent
0c5a0462b3
commit
9ab17fdf13
@ -11,6 +11,8 @@ import net.citizensnpcs.api.event.CitizensReloadEvent;
|
||||
import net.citizensnpcs.api.exception.NPCException;
|
||||
import net.citizensnpcs.api.exception.NPCLoadException;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.scripting.ScriptCompiler;
|
||||
import net.citizensnpcs.api.trait.EventRegistrar;
|
||||
import net.citizensnpcs.api.util.DataKey;
|
||||
import net.citizensnpcs.api.util.DatabaseStorage;
|
||||
import net.citizensnpcs.api.util.NBTStorage;
|
||||
@ -177,6 +179,8 @@ public class Citizens extends JavaPlugin {
|
||||
// Register commands
|
||||
registerCommands();
|
||||
|
||||
registerScriptHelpers();
|
||||
|
||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, new NPCUpdater(npcManager), 0, 1);
|
||||
|
||||
Messaging.log("v" + getDescription().getVersion() + " enabled.");
|
||||
@ -222,6 +226,12 @@ public class Citizens extends JavaPlugin {
|
||||
}.start();
|
||||
}
|
||||
|
||||
private void registerScriptHelpers() {
|
||||
ScriptCompiler compiler = CitizensAPI.getScriptCompiler();
|
||||
compiler.registerGlobalContextProvider(new EventRegistrar(this));
|
||||
|
||||
}
|
||||
|
||||
private void registerCommands() {
|
||||
commands.setInjector(new Injector(this));
|
||||
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.conversations.StringPrompt;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class StartPrompt extends StringPrompt {
|
||||
private Text text;
|
||||
private final Text text;
|
||||
|
||||
public StartPrompt(Text text) {
|
||||
this.text = text;
|
||||
|
Loading…
Reference in New Issue
Block a user