Class PlotGroup

All Implemented Interfaces:
Identifiable, Nameable, Permissible, Savable, TownBlockOwner

public class PlotGroup extends ObjectGroup implements TownBlockOwner, Savable
Author:
Suneet Tipirneni (Siris) A simple class which encapsulates the grouping of townblocks.
  • Constructor Details

    • PlotGroup

      public PlotGroup(UUID id, String name, Town town)
      Parameters:
      id - A unique identifier for the group id.
      name - An alias for the id used for player in-game interaction via commands.
      town - The town that this group is owned by.
  • Method Details

    • toString

      public String toString()
      Store plot group in format "name,id,town,price"
      Overrides:
      toString in class ObjectGroup
      Returns:
      The string in the format described.
    • exists

      public boolean exists()
      Description copied from class: TownyObject
      An internal method used to determine if an object exists in the TownyUniverse's maps.
      Specified by:
      exists in class TownyObject
      Returns:
      true if this TownyObject exists.
    • setName

      public void setName(String name)
      Override the name change method to internally rehash the plot group map.
      Overrides:
      setName in class TownyObject
      Parameters:
      name - The name of the group.
    • setTown

      public void setTown(Town town)
    • getTown

      public Town getTown()
    • toModeString

      public String toModeString()
      Returns:
      The qualified resident mode string.
    • getPrice

      public double getPrice()
    • setResident

      public void setResident(Resident resident)
    • getResident

      @Nullable public @Nullable Resident getResident()
    • hasResident

      public boolean hasResident()
    • addTownBlock

      public void addTownBlock(TownBlock townBlock)
      Description copied from interface: TownBlockOwner
      Adds a townblock to the list of existing townblocks.
      Specified by:
      addTownBlock in interface TownBlockOwner
      Parameters:
      townBlock - The townblock to add.
    • removeTownBlock

      public void removeTownBlock(TownBlock townBlock)
      Description copied from interface: TownBlockOwner
      Removes townblock from the list of existing townblocks.
      Specified by:
      removeTownBlock in interface TownBlockOwner
      Parameters:
      townBlock - The townblock to remove.
    • setTownblocks

      public void setTownblocks(List<TownBlock> townBlocks)
    • getTownBlocks

      public Collection<TownBlock> getTownBlocks()
      Description copied from interface: TownBlockOwner
      Gets the unmodifiable collection of townblocks.
      Specified by:
      getTownBlocks in interface TownBlockOwner
      Returns:
      The townblocks this object contains.
    • hasTownBlocks

      public boolean hasTownBlocks()
    • hasTownBlock

      public boolean hasTownBlock(TownBlock townBlock)
      Description copied from interface: TownBlockOwner
      Checks whether object has townblock or not.
      Specified by:
      hasTownBlock in interface TownBlockOwner
      Parameters:
      townBlock - The townblock to check for.
      Returns:
      A boolean indicating if it was found or not.
    • setPrice

      public void setPrice(double price)
    • addPlotPrice

      public void addPlotPrice(double pPrice)
    • setPermissions

      public void setPermissions(String line)
      Description copied from interface: Permissible
      The the permissions of this object.
      Specified by:
      setPermissions in interface Permissible
      Parameters:
      line - The String line representation of the permissions.
    • getPermissions

      public TownyPermission getPermissions()
      Description copied from interface: Permissible
      Gets the permissions of the object.
      Specified by:
      getPermissions in interface Permissible
      Returns:
      TownyPermission the permissions of the object.
    • setPermissions

      public void setPermissions(TownyPermission permissions)
    • getTownBlockType

      public TownBlockType getTownBlockType()
    • save

      public void save()
      Description copied from interface: Savable
      Schedules the object to be saved to the database.
      Specified by:
      save in interface Savable
    • setTrustedResidents

      public void setTrustedResidents(Set<Resident> trustedResidents)
    • getTrustedResidents

      public Set<Resident> getTrustedResidents()
    • setPermissionOverrides

      public void setPermissionOverrides(Map<Resident,PermissionData> permissionOverrides)
    • getPermissionOverrides

      public Map<Resident,PermissionData> getPermissionOverrides()
    • hasTrustedResident

      public boolean hasTrustedResident(Resident resident)
    • addTrustedResident

      public void addTrustedResident(Resident resident)
    • removeTrustedResident

      public void removeTrustedResident(Resident resident)
    • putPermissionOverride

      public void putPermissionOverride(Resident resident, PermissionData permissionData)
    • removePermissionOverride

      public void removePermissionOverride(Resident resident)