mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-06 00:08:04 +01:00
added playerCanIgnoreGameModeRestriction() to be checked before changing game modes.
This commit is contained in:
parent
fc24062f66
commit
c2ad331ca5
@ -146,4 +146,22 @@ public class PermissionTools {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if a player should bypass game mode restrictions.
|
||||
*
|
||||
* @param toWorld world travelling to.
|
||||
* @param teleportee player travelling.
|
||||
* @return True if they should bypass restrictions
|
||||
*/
|
||||
public boolean playerCanIgnoreGameModeRestriction(MultiverseWorld toWorld, Player teleportee) {
|
||||
if (toWorld != null) {
|
||||
return this.plugin.getMVPerms().canIgnoreGameModeRestriction(teleportee, toWorld);
|
||||
} else {
|
||||
//TODO: Determine if this value is false because a world didn't exist
|
||||
// or if it was because a world wasn't imported.
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user