use of org.bukkit.plugin.PluginManager in project BetterRTP by SuperRonanCraft.
the class Listener method registerEvents.
// private final PluginEnable pEnable = new PluginEnable();
public void registerEvents(BetterRTP pl) {
PluginManager pm = pl.getServer().getPluginManager();
pm.registerEvents(this, pl);
}
use of org.bukkit.plugin.PluginManager in project Skywars by TheBrunoRM.
the class Skywars method loadEvents.
public void loadEvents() {
// sendMessage("Loading events...");
final FileConfiguration config = this.getConfig();
final PluginManager pluginManager = this.getServer().getPluginManager();
if (config.getBoolean("signsEnabled")) {
pluginManager.registerEvents(new SignEvents(), this);
}
if (config.getBoolean("messageSounds.enabled")) {
pluginManager.registerEvents(new MessageSound(), this);
}
if (config.getBoolean("disableWeather")) {
pluginManager.registerEvents(new DisableWeather(), this);
}
if (config.getBoolean("debug.projectileTests")) {
pluginManager.registerEvents(new ProjectileTrails(), this);
}
final Listener[] listeners = { new InteractEvent(), new Events(), new GamesMenu(), new MapMenu(), new KitsMenu(), new SetupEvents(), new ChestManager(), new SetupMenu(), new PlayerInventoryManager() };
for (final Listener listener : listeners) {
pluginManager.registerEvents(listener, this);
}
}
use of org.bukkit.plugin.PluginManager in project Jobs by Zrips.
the class JobsListener method onWorldLoad.
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onWorldLoad(WorldLoadEvent event) {
PluginManager pm = plugin.getServer().getPluginManager();
String name = event.getWorld().getName().toLowerCase();
if (pm.getPermission("jobs.world." + name) == null && !PermissionHandler.worldsRegistered.contains(name)) {
pm.addPermission(new Permission("jobs.world." + name, PermissionDefault.TRUE));
PermissionHandler.worldsRegistered.add(name);
}
}
use of org.bukkit.plugin.PluginManager in project Jobs by Zrips.
the class PermissionHandler method registerPermissions.
public void registerPermissions() {
PluginManager pm = plugin.getServer().getPluginManager();
for (World world : plugin.getServer().getWorlds()) {
String worldName = world.getName().toLowerCase();
if (pm.getPermission("jobs.world." + worldName) == null) {
pm.addPermission(new Permission("jobs.world." + worldName, PermissionDefault.TRUE));
worldsRegistered.add(worldName);
}
}
for (Job job : Jobs.getJobs()) {
String jobName = job.getName().toLowerCase();
if (pm.getPermission("jobs.join." + jobName) == null)
pm.addPermission(new Permission("jobs.join." + jobName, PermissionDefault.TRUE));
}
}
use of org.bukkit.plugin.PluginManager in project DragonsOnline by UniverseCraft.
the class DragonsAntiCheat method onEnable.
@Override
public void onEnable() {
enableDebugLogging();
combatRewinder = new CombatRewinder(this);
CommandExecutor ac = new AntiCheatCommand(this);
getCommand("ac").setExecutor(ac);
getCommand("acdebug").setExecutor(ac);
getCommand("acflushlog").setExecutor(ac);
getCommand("acstartlog").setExecutor(ac);
getCommand("acblockdata").setExecutor(ac);
getCommand("acban").setExecutor(ac);
getCommand("ackick").setExecutor(ac);
getCommand("acdump").setExecutor(ac);
getCommand("acresetplayer").setExecutor(ac);
getCommand("acstatus").setExecutor(ac);
getCommand("actoggle").setExecutor(ac);
getCommand("acping").setExecutor(ac);
getCommand("acspoofping").setExecutor(ac);
getCommand("acraytol").setExecutor(ac);
getCommand("acpps").setExecutor(ac);
getCommand("achitstats").setExecutor(ac);
getCommand("acresethitstats").setExecutor(ac);
checkRegistry = new CheckRegistry();
checkRegistry.registerCheck(new PacketSpoof(this));
checkRegistry.registerCheck(new NoClip(this));
checkRegistry.registerCheck(new WrongMove(this));
checkRegistry.registerCheck(new FastPackets(this));
PluginManager pluginManager = getServer().getPluginManager();
// Uncomment if you want spam
// pluginManager.registerEvents(testingMoveListener = new TestingMoveListener(this), this);
pluginManager.registerEvents(new CheckListeners(this), this);
}
Aggregations