Class MVPermissions

  • All Implemented Interfaces:
    com.pneumaticraft.commandhandler.PermissionsInterface

    public class MVPermissions
    extends java.lang.Object
    implements com.pneumaticraft.commandhandler.PermissionsInterface
    Multiverse's PermissionsInterface.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.bukkit.permissions.Permission addPermission​(java.lang.String string, org.bukkit.permissions.PermissionDefault defaultValue)
      Adds a permission.
      boolean canEnterDestination​(org.bukkit.command.CommandSender sender, MVDestination d)
      Check to see if a sender can enter a destination.
      boolean canEnterWorld​(org.bukkit.entity.Player p, MultiverseWorld w)
      Check if the Player has the permissions to enter this world.
      boolean canIgnoreGameModeRestriction​(org.bukkit.entity.Player p, MultiverseWorld w)
      Check if a Player can ignore GameMode restrictions for world they travel to.
      boolean canTravelFromLocation​(org.bukkit.command.CommandSender sender, org.bukkit.Location location)
      Checks if the specified CommandSender can travel to the specified Location.
      boolean canTravelFromWorld​(org.bukkit.entity.Player p, MultiverseWorld w)
      Check if a Player can teleport to the Destination world from there current world.
      java.lang.String getType()
      Gets the type of this PermissionsInterface.
      boolean hasAllPermission​(org.bukkit.command.CommandSender sender, java.util.List<java.lang.String> nodes, boolean isOpRequired)
      boolean hasAnyPermission​(org.bukkit.command.CommandSender sender, java.util.List<java.lang.String> nodes, boolean isOpRequired)
      boolean hasPermission​(org.bukkit.command.CommandSender sender, java.lang.String node, boolean isOpRequired)
      Check to see if a player has a permission.
      void tellMeWhyICantDoThis​(org.bukkit.command.CommandSender asker, org.bukkit.command.CommandSender playerInQuestion, MVDestination d)
      Tells a CommandSender why another CommandSender can or can not access a certain MVDestination.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • canIgnoreGameModeRestriction

        public boolean canIgnoreGameModeRestriction​(org.bukkit.entity.Player p,
                                                    MultiverseWorld w)
        Check if a Player can ignore GameMode restrictions for world they travel to.
        Parameters:
        p - The Player to check.
        w - The MultiverseWorld the player wants to teleport to.
        Returns:
        True if they should bypass restrictions.
      • canTravelFromWorld

        public boolean canTravelFromWorld​(org.bukkit.entity.Player p,
                                          MultiverseWorld w)
        Check if a Player can teleport to the Destination world from there current world.
        Parameters:
        p - The Player to check.
        w - The MultiverseWorld the player wants to teleport to.
        Returns:
        Whether the player can teleport to the given MultiverseWorld.
      • canTravelFromLocation

        public boolean canTravelFromLocation​(org.bukkit.command.CommandSender sender,
                                             org.bukkit.Location location)
        Checks if the specified CommandSender can travel to the specified Location.
        Parameters:
        sender - The CommandSender.
        location - The Location.
        Returns:
        Whether the CommandSender can travel to the specified Location.
      • canEnterWorld

        public boolean canEnterWorld​(org.bukkit.entity.Player p,
                                     MultiverseWorld w)
        Check if the Player has the permissions to enter this world.
        Parameters:
        p - The Player player that wants to enter
        w - The MultiverseWorld he wants to enter
        Returns:
        Whether he has the permission to enter the world
      • canEnterDestination

        public boolean canEnterDestination​(org.bukkit.command.CommandSender sender,
                                           MVDestination d)
        Check to see if a sender can enter a destination. The reason this is not a player, is it can be used to simply check permissions The console should, for exmaple, always see all worlds
        Parameters:
        sender - The CommandSender to check.
        d - The destination they are requesting.
        Returns:
        True if that sender can go to that destination
      • tellMeWhyICantDoThis

        public void tellMeWhyICantDoThis​(org.bukkit.command.CommandSender asker,
                                         org.bukkit.command.CommandSender playerInQuestion,
                                         MVDestination d)
        Tells a CommandSender why another CommandSender can or can not access a certain MVDestination.
        Parameters:
        asker - The CommandSender that's asking.
        playerInQuestion - The CommandSender whose permissions we want to know.
        d - The MVDestination.
      • hasPermission

        public boolean hasPermission​(org.bukkit.command.CommandSender sender,
                                     java.lang.String node,
                                     boolean isOpRequired)
        Check to see if a player has a permission.
        Specified by:
        hasPermission in interface com.pneumaticraft.commandhandler.PermissionsInterface
        Parameters:
        sender - Who is requesting the permission.
        node - The permission node in string format; multiverse.core.list.worlds for example.
        isOpRequired - deprecated This is not used for anything anymore.
        Returns:
        True if they have that permission or any parent.
      • getType

        public java.lang.String getType()
        Gets the type of this PermissionsInterface.
        Returns:
        The type of this PermissionsInterface.
      • hasAnyPermission

        public boolean hasAnyPermission​(org.bukkit.command.CommandSender sender,
                                        java.util.List<java.lang.String> nodes,
                                        boolean isOpRequired)
        Specified by:
        hasAnyPermission in interface com.pneumaticraft.commandhandler.PermissionsInterface
      • hasAllPermission

        public boolean hasAllPermission​(org.bukkit.command.CommandSender sender,
                                        java.util.List<java.lang.String> nodes,
                                        boolean isOpRequired)
        Specified by:
        hasAllPermission in interface com.pneumaticraft.commandhandler.PermissionsInterface
      • addPermission

        public org.bukkit.permissions.Permission addPermission​(java.lang.String string,
                                                               org.bukkit.permissions.PermissionDefault defaultValue)
        Adds a permission.
        Parameters:
        string - The permission as String.
        defaultValue - The default-value.
        Returns:
        The permission as Permission.