mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-02-09 09:01:31 +01:00
Added permission check with permissions "multiverse.gamemode.ignore.NAME" and of course "multiverse.gamemode.ignore.*"
This commit is contained in:
parent
4246149bf2
commit
a092dd8760
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user