added playerCanIgnoreGameModeRestriction() to be checked before changing game modes.

This commit is contained in:
dumptruckman 2011-12-19 19:20:10 -05:00 committed by Tim Ekl
parent fc24062f66
commit c2ad331ca5

View File

@ -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;
}
}