Class MVPermissions
- java.lang.Object
-
- com.onarandombox.MultiverseCore.utils.MVPermissions
-
- All Implemented Interfaces:
com.pneumaticraft.commandhandler.PermissionsInterface
public class MVPermissions extends java.lang.Object implements com.pneumaticraft.commandhandler.PermissionsInterface
Multiverse'sPermissionsInterface
.
-
-
Constructor Summary
Constructors Constructor Description MVPermissions(MultiverseCore plugin)
-
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 specifiedCommandSender
can travel to the specifiedLocation
.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 thisPermissionsInterface
.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)
-
-
-
Constructor Detail
-
MVPermissions
public MVPermissions(MultiverseCore plugin)
-
-
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
- ThePlayer
to check.w
- TheMultiverseWorld
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
- ThePlayer
to check.w
- TheMultiverseWorld
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 specifiedCommandSender
can travel to the specifiedLocation
.- Parameters:
sender
- TheCommandSender
.location
- TheLocation
.- Returns:
- Whether the
CommandSender
can travel to the specifiedLocation
.
-
canEnterWorld
public boolean canEnterWorld(org.bukkit.entity.Player p, MultiverseWorld w)
Check if the Player has the permissions to enter this world.- Parameters:
p
- ThePlayer
player that wants to enterw
- TheMultiverseWorld
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)
- Parameters:
asker
- TheCommandSender
that's asking.playerInQuestion
- TheCommandSender
whose permissions we want to know.d
- TheMVDestination
.
-
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 interfacecom.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 thisPermissionsInterface
.- 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 interfacecom.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 interfacecom.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 asString
.defaultValue
- The default-value.- Returns:
- The permission as
Permission
.
-
-