Class PlayerCache
java.lang.Object
com.palmergames.bukkit.towny.object.PlayerCache
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBuildPermission(org.bukkit.Material material) booleangetCachePermission(org.bukkit.Material material, TownyPermission.ActionType action) Checks from cache if a certain ActionType can be performed on a given MaterialbooleangetDestroyPermission(org.bukkit.Material material) booleangetItemUsePermission(org.bukkit.Material material) @NotNull WorldCoordRetrieve the last cached WorldCoordbooleangetSwitchPermission(org.bukkit.Material material) booleanvoidresetAndUpdate(@NotNull WorldCoord worldCoord) Reset the cache permissions and update the cache with new coordinates.voidsetBlockErrMsg(String blockErrMsg) voidsetBuildPermission(org.bukkit.Material material, Boolean value) voidsetDestroyPermission(org.bukkit.Material material, Boolean value) voidsetItemUsePermission(org.bukkit.Material material, Boolean value) voidsetLastTownBlock(@NotNull WorldCoord worldCoord) Update the cache with new coordinates.voidsetStatus(PlayerCache.TownBlockStatus townBlockStatus) voidsetSwitchPermission(org.bukkit.Material material, Boolean value) booleanupdateCoord(@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()
-