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.PermissionsInterfaceMultiverse'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.PermissionaddPermission(java.lang.String string, org.bukkit.permissions.PermissionDefault defaultValue)Adds a permission.booleancanEnterDestination(org.bukkit.command.CommandSender sender, MVDestination d)Check to see if a sender can enter a destination.booleancanEnterWorld(org.bukkit.entity.Player p, MultiverseWorld w)Check if the Player has the permissions to enter this world.booleancanIgnoreGameModeRestriction(org.bukkit.entity.Player p, MultiverseWorld w)Check if a Player can ignore GameMode restrictions for world they travel to.booleancanTravelFromLocation(org.bukkit.command.CommandSender sender, org.bukkit.Location location)Checks if the specifiedCommandSendercan travel to the specifiedLocation.booleancanTravelFromWorld(org.bukkit.entity.Player p, MultiverseWorld w)Check if a Player can teleport to the Destination world from there current world.java.lang.StringgetType()Gets the type of thisPermissionsInterface.booleanhasAllPermission(org.bukkit.command.CommandSender sender, java.util.List<java.lang.String> nodes, boolean isOpRequired)booleanhasAnyPermission(org.bukkit.command.CommandSender sender, java.util.List<java.lang.String> nodes, boolean isOpRequired)booleanhasPermission(org.bukkit.command.CommandSender sender, java.lang.String node, boolean isOpRequired)Check to see if a player has a permission.voidtellMeWhyICantDoThis(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- ThePlayerto check.w- TheMultiverseWorldthe 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- ThePlayerto check.w- TheMultiverseWorldthe 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 specifiedCommandSendercan travel to the specifiedLocation.- Parameters:
sender- TheCommandSender.location- TheLocation.- Returns:
- Whether the
CommandSendercan 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- ThePlayerplayer that wants to enterw- TheMultiverseWorldhe 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- TheCommandSenderthat's asking.playerInQuestion- TheCommandSenderwhose 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:
hasPermissionin 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:
hasAnyPermissionin interfacecom.pneumaticraft.commandhandler.PermissionsInterface
-
hasAllPermission
public boolean hasAllPermission(org.bukkit.command.CommandSender sender, java.util.List<java.lang.String> nodes, boolean isOpRequired)- Specified by:
hasAllPermissionin 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.
-
-