Added permission check with permissions "multiverse.gamemode.ignore.NAME" and of course "multiverse.gamemode.ignore.*"

This commit is contained in:
dumptruckman 2011-12-19 19:29:33 -05:00 committed by Tim Ekl
parent 4246149bf2
commit a092dd8760
1 changed files with 15 additions and 0 deletions

View File

@ -30,6 +30,21 @@ public class MVPermissions implements PermissionsInterface {
this.plugin = plugin;
this.worldMgr = plugin.getMVWorldManager();
}
/**
* Check if a Player can ignore GameMode restrictions for world they travel to.
*
* @param p The {@link Player} to check.
* @param w The {@link MultiverseWorld} the player wants to teleport to.
* @return True if they should bypass restrictions.
*/
public boolean canIgnoreGameModeRestriction(Player p, MultiverseWorld w) {
// If we're not enforcing gamemodes, won't change for anyone.
if (!MultiverseCore.EnforceGameModes) {
return true;
}
return this.hasPermission(p, "multiverse.gamemode.ignore." + w.getName(), false);
}
/**
* Check if a Player can teleport to the Destination world from there current world.