Fixed CommandPermissions class

This commit is contained in:
Tim Visée 2015-11-01 16:19:56 +01:00
parent c193120958
commit 7962d6b9fe

View File

@ -1,7 +1,8 @@
package fr.xephi.authme.command; package fr.xephi.authme.command;
import com.timvisee.dungeonmaze.Core; //import com.timvisee.dungeonmaze.Core;
import com.timvisee.dungeonmaze.permission.PermissionsManager; //import com.timvisee.dungeonmaze.permission.PermissionsManager;
import fr.xephi.authme.AuthMe;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -123,14 +124,14 @@ public class CommandPermissions {
// Get the player instance // Get the player instance
Player player = (Player) sender; Player player = (Player) sender;
// Get the permissions manager, and make sure it's instance is valid // // Get the permissions manager, and make sure it's instance is valid
PermissionsManager permissionsManager = Core.getPermissionsManager(); // PermissionsManager permissionsManager = Core.getPermissionsManager();
if(permissionsManager == null) // if(permissionsManager == null)
return false; // return false;
// Check whether the player has permission, return the result // Check whether the player has permission, return the result
for(String node : this.permissionNodes) for(String node : this.permissionNodes)
if(!permissionsManager.hasPermission(player, node, defaultPermission)) if(!AuthMe.getInstance().authmePermissible(player, node))
return false; return false;
return true; return true;
} }