Class PlayerCache

java.lang.Object
com.palmergames.bukkit.towny.object.PlayerCache

public class PlayerCache extends Object
  • Constructor Details

    • PlayerCache

      public PlayerCache(org.bukkit.entity.Player player)
  • Method Details

    • setLastTownBlock

      public void setLastTownBlock(@NotNull @NotNull WorldCoord worldCoord)
      Update the cache with new coordinates.
      Parameters:
      worldCoord - - World Coordinate to set as the lastWorldCoord
    • resetAndUpdate

      public void resetAndUpdate(@NotNull @NotNull WorldCoord worldCoord)
      Reset the cache permissions and update the cache with new coordinates.
      Parameters:
      worldCoord - - World Coordinate to setLastTownBlock
    • getLastTownBlock

      @NotNull public @NotNull WorldCoord getLastTownBlock()
      Retrieve the last cached WorldCoord
      Returns:
      WorldCoord of the last acted upon TownBlock
    • updateCoord

      public boolean updateCoord(@NotNull @NotNull WorldCoord pos)
      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 check
      action - - 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

      public void setBuildPermission(org.bukkit.Material material, Boolean value)
    • setDestroyPermission

      public void setDestroyPermission(org.bukkit.Material material, Boolean value)
    • setSwitchPermission

      public void setSwitchPermission(org.bukkit.Material material, Boolean value)
    • setItemUsePermission

      public void setItemUsePermission(org.bukkit.Material material, Boolean value)
    • getBuildPermission

      public boolean getBuildPermission(org.bukkit.Material material) throws NullPointerException
      Throws:
      NullPointerException
    • getDestroyPermission

      public boolean getDestroyPermission(org.bukkit.Material material) throws NullPointerException
      Throws:
      NullPointerException
    • getSwitchPermission

      public boolean getSwitchPermission(org.bukkit.Material material) throws NullPointerException
      Throws:
      NullPointerException
    • getItemUsePermission

      public boolean getItemUsePermission(org.bukkit.Material material) throws NullPointerException
      Throws:
      NullPointerException
    • setStatus

      public void setStatus(PlayerCache.TownBlockStatus townBlockStatus)
    • getStatus

      Throws:
      NullPointerException
    • setBlockErrMsg

      public void setBlockErrMsg(String blockErrMsg)
    • getBlockErrMsg

      public String getBlockErrMsg()
    • hasBlockErrMsg

      public boolean hasBlockErrMsg()
    • setLastLocation

      @Deprecated public void setLastLocation(org.bukkit.Location lastLocation)
      Deprecated.
      Deprecated as of 0.99.5.9, location caching is no longer used.
    • getLastLocation

      @Deprecated public org.bukkit.Location getLastLocation() throws NullPointerException
      Deprecated.
      Deprecated as of 0.99.5.9, location caching is no longer used.
      Throws:
      NullPointerException