Class PermissionTools


  • public class PermissionTools
    extends java.lang.Object
    Utility-class for permissions.
    • Constructor Detail

    • Method Detail

      • addToParentPerms

        public void addToParentPerms​(java.lang.String permString)
        Adds a permission to the parent-permissions.
        Parameters:
        permString - The new permission as String.
      • playerHasMoneyToEnter

        public boolean playerHasMoneyToEnter​(MultiverseWorld fromWorld,
                                             MultiverseWorld toWorld,
                                             org.bukkit.command.CommandSender teleporter,
                                             org.bukkit.entity.Player teleportee,
                                             boolean pay)
        Checks if the given Player has enough money to enter the specified MultiverseWorld.
        Parameters:
        fromWorld - The MultiverseWorld the player is coming from.
        toWorld - The MultiverseWorld the player is going to.
        teleporter - The teleporter.
        teleportee - The teleportee.
        pay - If the player has to pay the money.
        Returns:
        True if the player can enter the world.
      • playerCanGoFromTo

        public boolean playerCanGoFromTo​(MultiverseWorld fromWorld,
                                         MultiverseWorld toWorld,
                                         org.bukkit.command.CommandSender teleporter,
                                         org.bukkit.entity.Player teleportee)
        Checks to see if player can go to a world given their current status.

        The return is a little backwards, and will return a value safe for event.setCancelled.

        Parameters:
        fromWorld - The MultiverseWorld they are in.
        toWorld - The MultiverseWorld they want to go to.
        teleporter - The CommandSender that wants to send someone somewhere. If null, will be given the same value as teleportee.
        teleportee - The player going somewhere.
        Returns:
        True if they can't go to the world, False if they can.
      • playerCanBypassPlayerLimit

        public boolean playerCanBypassPlayerLimit​(MultiverseWorld toWorld,
                                                  org.bukkit.command.CommandSender teleporter,
                                                  org.bukkit.entity.Player teleportee)
        Checks to see if a player can bypass the player limit.
        Parameters:
        toWorld - The world travelling to.
        teleporter - The player that initiated the teleport.
        teleportee - The player travelling.
        Returns:
        True if they can bypass the player limit.
      • playerCanIgnoreGameModeRestriction

        public boolean playerCanIgnoreGameModeRestriction​(MultiverseWorld toWorld,
                                                          org.bukkit.entity.Player teleportee)
        Checks to see if a player should bypass game mode restrictions.
        Parameters:
        toWorld - world travelling to.
        teleportee - player travelling.
        Returns:
        True if they should bypass restrictions