mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 18:47:20 +01:00
Ditching GM and weird API... No one has specifically requested GM
support anyways, wonder why...
This commit is contained in:
parent
f73d5dbcf1
commit
b8ee4c7f53
@ -13,7 +13,7 @@ public class MVPermissions {
|
|||||||
* Constructor FTW
|
* Constructor FTW
|
||||||
* @param plugin Pass along the Core Plugin.
|
* @param plugin Pass along the Core Plugin.
|
||||||
*/
|
*/
|
||||||
public MVPermissions(MultiVerseCore plugin){
|
public MVPermissions(MultiVerseCore plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,9 +27,7 @@ public class MVPermissions {
|
|||||||
public boolean has(Player p, String node){
|
public boolean has(Player p, String node){
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
|
||||||
if(MultiVerseCore.GroupManager!=null){
|
if(MultiVerseCore.Permissions!=null){
|
||||||
result = MultiVerseCore.GroupManager.getWorldsHolder().getWorldPermissions(p).has(p, node);
|
|
||||||
} else if(MultiVerseCore.Permissions!=null){
|
|
||||||
result = MultiVerseCore.Permissions.has(p, node);
|
result = MultiVerseCore.Permissions.has(p, node);
|
||||||
} else if(p.isOp()){
|
} else if(p.isOp()){
|
||||||
result = true;
|
result = true;
|
||||||
@ -74,9 +72,7 @@ public class MVPermissions {
|
|||||||
public Boolean canEnterWorld(Player p, World w) {
|
public Boolean canEnterWorld(Player p, World w) {
|
||||||
String group = "";
|
String group = "";
|
||||||
|
|
||||||
if(MultiVerseCore.GroupManager!=null){
|
if (MultiVerseCore.Permissions!=null){
|
||||||
group = MultiVerseCore.GroupManager.getWorldsHolder().getWorldPermissions(p).getGroup(p.getName());
|
|
||||||
} else if (MultiVerseCore.Permissions!=null){
|
|
||||||
group = MultiVerseCore.Permissions.getGroup(p.getName(), p.getWorld().getName());
|
group = MultiVerseCore.Permissions.getGroup(p.getName(), p.getWorld().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,20 +21,10 @@ public class MVPluginListener extends ServerListener {
|
|||||||
*/
|
*/
|
||||||
public void onPluginEnabled(PluginEvent event){
|
public void onPluginEnabled(PluginEvent event){
|
||||||
|
|
||||||
/**
|
|
||||||
* Check to see if GroupManager just enabled.
|
|
||||||
*/
|
|
||||||
if(event.getPlugin().getDescription().getName().equals("GroupManager")){
|
|
||||||
MultiVerseCore.GroupManager = (GroupManager) plugin.getServer().getPluginManager().getPlugin("GroupManager");
|
|
||||||
MultiVerseCore.log.info(MultiVerseCore.logPrefix + " - Found GroupManager");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check to see if Permissions was just enabled, we only wan't to perform the following if GroupManager is not found.
|
* Check to see if Permissions was just enabled, we only wan't to perform the following if GroupManager is not found.
|
||||||
*/
|
*/
|
||||||
if(event.getPlugin().getDescription().getName().equals("Permissions")
|
if(event.getPlugin().getDescription().getName().equals("Permissions")) {
|
||||||
&& MultiVerseCore.GroupManager==null
|
|
||||||
&& plugin.getServer().getPluginManager().getPlugin("GroupManager") == null) {
|
|
||||||
MultiVerseCore.Permissions = (PermissionHandler) plugin.getServer().getPluginManager().getPlugin("Permissions");
|
MultiVerseCore.Permissions = (PermissionHandler) plugin.getServer().getPluginManager().getPlugin("Permissions");
|
||||||
MultiVerseCore.log.info(MultiVerseCore.logPrefix + "- Found Permissions");
|
MultiVerseCore.log.info(MultiVerseCore.logPrefix + "- Found Permissions");
|
||||||
}
|
}
|
||||||
@ -58,14 +48,6 @@ public class MVPluginListener extends ServerListener {
|
|||||||
* We'll check if any of the plugins we rely on decide to Disable themselves.
|
* We'll check if any of the plugins we rely on decide to Disable themselves.
|
||||||
*/
|
*/
|
||||||
public void onPluginDisabled(PluginEvent event){
|
public void onPluginDisabled(PluginEvent event){
|
||||||
/**
|
|
||||||
* Check to see if GroupManager just disabled.
|
|
||||||
*/
|
|
||||||
if(event.getPlugin().getDescription().getName().equals("GroupManager")){
|
|
||||||
MultiVerseCore.GroupManager = null;
|
|
||||||
MultiVerseCore.log.info(MultiVerseCore.logPrefix + " - GroupManager has been Disabled");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check to see if Permissions just disabled.
|
* Check to see if Permissions just disabled.
|
||||||
*/
|
*/
|
||||||
|
@ -21,8 +21,6 @@ import org.bukkit.util.config.Configuration;
|
|||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.Event.Priority;
|
import org.bukkit.event.Event.Priority;
|
||||||
|
|
||||||
import org.anjocaido.groupmanager.GroupManager;
|
|
||||||
|
|
||||||
import com.nijiko.permissions.PermissionHandler;
|
import com.nijiko.permissions.PermissionHandler;
|
||||||
import com.nijikokun.bukkit.Permissions.Permissions;
|
import com.nijikokun.bukkit.Permissions.Permissions;
|
||||||
|
|
||||||
@ -51,14 +49,11 @@ public class MultiVerseCore extends JavaPlugin {
|
|||||||
public static final File dataFolder = new File("plugins" + File.separator + "MultiVerse");
|
public static final File dataFolder = new File("plugins" + File.separator + "MultiVerse");
|
||||||
|
|
||||||
// MultiVerse Permissions Handler
|
// MultiVerse Permissions Handler
|
||||||
public static MVPermissions ph;
|
public MVPermissions ph = new MVPermissions(this);
|
||||||
|
|
||||||
// Permissions Handler
|
// Permissions Handler
|
||||||
public static PermissionHandler Permissions = null;
|
public static PermissionHandler Permissions = null;
|
||||||
|
|
||||||
// GroupManager Permissions Handler
|
|
||||||
public static GroupManager GroupManager = null;
|
|
||||||
|
|
||||||
// iConomy Handler
|
// iConomy Handler
|
||||||
public static iConomy iConomy = null;
|
public static iConomy iConomy = null;
|
||||||
public static boolean useiConomy = false;
|
public static boolean useiConomy = false;
|
||||||
@ -107,8 +102,6 @@ public class MultiVerseCore extends JavaPlugin {
|
|||||||
loadWorlds();
|
loadWorlds();
|
||||||
// Purge Worlds of old Monsters/Animals which don't adhere to the setup.
|
// Purge Worlds of old Monsters/Animals which don't adhere to the setup.
|
||||||
purgeWorlds();
|
purgeWorlds();
|
||||||
// Setup Group Manager.
|
|
||||||
setupGroupManager();
|
|
||||||
// Setup Permissions, we'll do an initial check for the Permissions plugin then fall back on isOP().
|
// Setup Permissions, we'll do an initial check for the Permissions plugin then fall back on isOP().
|
||||||
setupPermissions();
|
setupPermissions();
|
||||||
// Setup iConomy.
|
// Setup iConomy.
|
||||||
@ -142,19 +135,6 @@ public class MultiVerseCore extends JavaPlugin {
|
|||||||
|
|
||||||
pm.registerEvent(Event.Type.PLUGIN_ENABLE, pluginListener, Priority.Monitor, this); // Monitor for Permissions Plugin etc.
|
pm.registerEvent(Event.Type.PLUGIN_ENABLE, pluginListener, Priority.Monitor, this); // Monitor for Permissions Plugin etc.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check to see if GroupManager is enabled and setup accordingly.
|
|
||||||
*/
|
|
||||||
private void setupGroupManager(){
|
|
||||||
Plugin p = this.getServer().getPluginManager().getPlugin("GroupManager");
|
|
||||||
if (p != null) {
|
|
||||||
if (!this.getServer().getPluginManager().isPluginEnabled(p)) {
|
|
||||||
this.getServer().getPluginManager().enablePlugin(p);
|
|
||||||
}
|
|
||||||
MultiVerseCore.GroupManager = (GroupManager) p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check for Permissions plugin and then setup our own Permissions Handler.
|
* Check for Permissions plugin and then setup our own Permissions Handler.
|
||||||
@ -323,8 +303,8 @@ public class MultiVerseCore extends JavaPlugin {
|
|||||||
/**
|
/**
|
||||||
* Grab the Permissions Handler for MultiVerse
|
* Grab the Permissions Handler for MultiVerse
|
||||||
*/
|
*/
|
||||||
public static MVPermissions getPermissions() {
|
public MVPermissions getPermissions() {
|
||||||
return ph;
|
return this.ph;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user