Class PermissionTools
- java.lang.Object
-
- com.onarandombox.MultiverseCore.utils.PermissionTools
-
public class PermissionTools extends java.lang.Object
Utility-class for permissions.
-
-
Constructor Summary
Constructors Constructor Description PermissionTools(MultiverseCore plugin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToParentPerms(java.lang.String permString)
Adds a permission to the parent-permissions.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.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.boolean
playerCanIgnoreGameModeRestriction(MultiverseWorld toWorld, org.bukkit.entity.Player teleportee)
Checks to see if a player should bypass game mode restrictions.boolean
playerHasMoneyToEnter(MultiverseWorld fromWorld, MultiverseWorld toWorld, org.bukkit.command.CommandSender teleporter, org.bukkit.entity.Player teleportee, boolean pay)
Checks if the givenPlayer
has enough money to enter the specifiedMultiverseWorld
.
-
-
-
Constructor Detail
-
PermissionTools
public PermissionTools(MultiverseCore plugin)
-
-
Method Detail
-
addToParentPerms
public void addToParentPerms(java.lang.String permString)
Adds a permission to the parent-permissions.- Parameters:
permString
- The new permission asString
.
-
playerHasMoneyToEnter
public boolean playerHasMoneyToEnter(MultiverseWorld fromWorld, MultiverseWorld toWorld, org.bukkit.command.CommandSender teleporter, org.bukkit.entity.Player teleportee, boolean pay)
Checks if the givenPlayer
has enough money to enter the specifiedMultiverseWorld
.- Parameters:
fromWorld
- TheMultiverseWorld
the player is coming from.toWorld
- TheMultiverseWorld
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
-
-