use of org.bukkit.plugin.PluginManager in project Magma-1.16.x by magmafoundation.
the class Permission method addParent.
/**
* Adds this permission to the specified parent permission.
* <p>
* If the parent permission does not exist, it will be created and
* registered.
*
* @param name Name of the parent permission
* @param value The value to set this permission to
* @return Parent permission it created or loaded
*/
@NotNull
public Permission addParent(@NotNull String name, boolean value) {
PluginManager pm = Bukkit.getServer().getPluginManager();
String lname = name.toLowerCase(java.util.Locale.ENGLISH);
Permission perm = pm.getPermission(lname);
if (perm == null) {
perm = new Permission(lname);
pm.addPermission(perm);
}
addParent(perm, value);
return perm;
}
use of org.bukkit.plugin.PluginManager in project LoliServer by Loli-Server.
the class Permission method addParent.
/**
* Adds this permission to the specified parent permission.
* <p>
* If the parent permission does not exist, it will be created and
* registered.
*
* @param name Name of the parent permission
* @param value The value to set this permission to
* @return Parent permission it created or loaded
*/
@NotNull
public Permission addParent(@NotNull String name, boolean value) {
PluginManager pm = Bukkit.getServer().getPluginManager();
String lname = name.toLowerCase(java.util.Locale.ENGLISH);
Permission perm = pm.getPermission(lname);
if (perm == null) {
perm = new Permission(lname);
pm.addPermission(perm);
}
addParent(perm, value);
return perm;
}
use of org.bukkit.plugin.PluginManager in project LevelTools by byteful.
the class LevelToolsPlugin method registerListeners.
private void registerListeners() {
final PluginManager pm = Bukkit.getPluginManager();
pm.registerEvents(new BlockEventListener(), this);
pm.registerEvents(new EntityEventListener(), this);
pm.registerEvents(new AnvilListener(), this);
}
use of org.bukkit.plugin.PluginManager in project TARDIS by eccentricdevotion.
the class TARDISBlockLogger method enableLogger.
public void enableLogger() {
PluginManager pm = plugin.getServer().getPluginManager();
if (pm.isPluginEnabled("CoreProtect")) {
CoreProtect cp = (CoreProtect) pm.getPlugin("CoreProtect");
// Check that CoreProtect is loaded
if (cp == null || !(cp instanceof CoreProtect)) {
return;
}
// Check that the API is enabled
CoreProtectAPI CoreProtect = cp.getAPI();
if (!CoreProtect.isEnabled()) {
return;
}
// Check that a compatible version of the API is loaded
if (CoreProtect.APIVersion() < 6) {
return;
}
plugin.getServer().getConsoleSender().sendMessage(plugin.getPluginName() + "Connecting to CoreProtect");
coreProtectAPI = CoreProtect;
logging = true;
}
}
use of org.bukkit.plugin.PluginManager in project EpicVouchers by songoda.
the class EpicVouchers method onPluginEnable.
@Override
public void onPluginEnable() {
// Run Songoda Updater
SongodaCore.registerPlugin(this, 25, CompatibleMaterial.EMERALD);
// Setup Config
Settings.setupConfig();
this.setLocale(Settings.LANGUGE_MODE.getString(), false);
// Register commands
this.commandManager = new CommandManager(this);
this.commandManager.addCommand(new CommandEpicVouchers(this)).addSubCommands(new CommandEditor(this), new CommandForce(this), new CommandForceAll(this), new CommandGive(this), new CommandGiveAll(this), new CommandList(this), new CommandReload(this));
FastInv.init(this);
IconInv.init(this);
this.connections = new Connections(this);
this.coolDowns = new CoolDownManager(this);
this.voucherExecutor = new VoucherExecutor(this);
this.voucherManager = new VoucherManager();
PluginManager manager = Bukkit.getServer().getPluginManager();
// Listeners
guiManager.init();
manager.registerEvents(new PlayerInteractListener(this), this);
manager.registerEvents(new PlayerCommandListener(), this);
}
Aggregations