Class PlayerCache
java.lang.Object
com.palmergames.bukkit.towny.object.PlayerCache
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getBuildPermission
(org.bukkit.Material material) boolean
getCachePermission
(org.bukkit.Material material, TownyPermission.ActionType action) Checks from cache if a certain ActionType can be performed on a given Materialboolean
getDestroyPermission
(org.bukkit.Material material) boolean
getItemUsePermission
(org.bukkit.Material material) @NotNull WorldCoord
Retrieve the last cached WorldCoordboolean
getSwitchPermission
(org.bukkit.Material material) boolean
void
resetAndUpdate
(@NotNull WorldCoord worldCoord) Reset the cache permissions and update the cache with new coordinates.void
setBlockErrMsg
(String blockErrMsg) void
setBuildPermission
(org.bukkit.Material material, Boolean value) void
setDestroyPermission
(org.bukkit.Material material, Boolean value) void
setItemUsePermission
(org.bukkit.Material material, Boolean value) void
setLastTownBlock
(@NotNull WorldCoord worldCoord) Update the cache with new coordinates.void
setStatus
(PlayerCache.TownBlockStatus townBlockStatus) void
setSwitchPermission
(org.bukkit.Material material, Boolean value) boolean
updateCoord
(@NotNull WorldCoord pos) Update the players WorldCoord, resetting all permissions if it has changed.
-
Constructor Details
-
PlayerCache
public PlayerCache(org.bukkit.entity.Player player)
-
-
Method Details
-
setLastTownBlock
Update the cache with new coordinates.- Parameters:
worldCoord
- - World Coordinate to set as the lastWorldCoord
-
resetAndUpdate
Reset the cache permissions and update the cache with new coordinates.- Parameters:
worldCoord
- - World Coordinate to setLastTownBlock
-
getLastTownBlock
Retrieve the last cached WorldCoord- Returns:
- WorldCoord of the last acted upon TownBlock
-
updateCoord
Update the players WorldCoord, resetting all permissions if it has changed.- Parameters:
pos
- - WorldCoord to setLastTownBlock- Returns:
- true if changed.
-
getCachePermission
public boolean getCachePermission(org.bukkit.Material material, TownyPermission.ActionType action) throws NullPointerException Checks from cache if a certain ActionType can be performed on a given Material- Parameters:
material
- - Material to checkaction
- - ActionType to check- Returns:
- true if permission to perform an ActionType based on the material is granted
- Throws:
NullPointerException
- if passed an invalid or NULL ActionType
-
setBuildPermission
-
setDestroyPermission
-
setSwitchPermission
-
setItemUsePermission
-
getBuildPermission
- Throws:
NullPointerException
-
getDestroyPermission
- Throws:
NullPointerException
-
getSwitchPermission
- Throws:
NullPointerException
-
getItemUsePermission
- Throws:
NullPointerException
-
setStatus
-
getStatus
- Throws:
NullPointerException
-
setBlockErrMsg
-
getBlockErrMsg
-
hasBlockErrMsg
public boolean hasBlockErrMsg()
-