Class TownyWorld

java.lang.Object
com.palmergames.bukkit.towny.object.TownyObject
com.palmergames.bukkit.towny.object.TownyWorld
All Implemented Interfaces:
Nameable, Savable

public class TownyWorld extends TownyObject
  • Field Details

    • bedMap

      public Map<org.bukkit.Location,org.bukkit.Material> bedMap
    • tridentStrikeList

      public final List<UUID> tridentStrikeList
  • Constructor Details

    • TownyWorld

      public TownyWorld(String name)
    • TownyWorld

      public TownyWorld(String name, UUID uuid)
  • Method Details

    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getUUID

      public UUID getUUID()
    • setUUID

      @Internal public void setUUID(UUID uuid)
    • getBukkitWorld

      @Nullable public @Nullable org.bukkit.World getBukkitWorld()
    • getTowns

      public HashMap<String,Town> getTowns()
    • hasTowns

      public boolean hasTowns()
    • hasTown

      public boolean hasTown(String name)
    • hasTown

      public boolean hasTown(Town town)
    • addTown

      public void addTown(Town town)
    • getTownBlock

      public TownBlock getTownBlock(Coord coord) throws NotRegisteredException
      Throws:
      NotRegisteredException
    • hasTownBlock

      public boolean hasTownBlock(Coord key)
    • getTownBlock

      public TownBlock getTownBlock(int x, int z) throws NotRegisteredException
      Throws:
      NotRegisteredException
    • getTownBlocks

      public List<TownBlock> getTownBlocks(Town town)
    • getTownBlocks

      public Collection<TownBlock> getTownBlocks()
    • removeTown

      public void removeTown(Town town) throws NotRegisteredException
      Throws:
      NotRegisteredException
    • getTreeString

      public List<String> getTreeString(int depth)
      Overrides:
      getTreeString in class TownyObject
    • setWarAllowed

      public void setWarAllowed(boolean isWarAllowed)
    • isWarAllowed

      public boolean isWarAllowed()
    • setPVP

      public void setPVP(boolean isPVP)
    • isPVP

      public boolean isPVP()
    • setForcePVP

      public void setForcePVP(boolean isPVP)
    • isForcePVP

      public boolean isForcePVP()
    • setExpl

      public void setExpl(boolean isExpl)
    • isExpl

      public boolean isExpl()
    • setForceExpl

      public void setForceExpl(boolean isExpl)
    • isForceExpl

      public boolean isForceExpl()
    • setFire

      public void setFire(boolean isFire)
    • isFire

      public boolean isFire()
    • setForceFire

      public void setForceFire(boolean isFire)
    • isForceFire

      public boolean isForceFire()
    • setDisableCreatureTrample

      public void setDisableCreatureTrample(boolean isDisableCreatureTrample)
    • isDisableCreatureTrample

      public boolean isDisableCreatureTrample()
    • setWorldMobs

      public void setWorldMobs(boolean hasMobs)
    • hasWorldMobs

      public boolean hasWorldMobs()
    • setWildernessMobs

      public void setWildernessMobs(boolean hasMonsters)
    • hasWildernessMobs

      public boolean hasWildernessMobs()
    • setForceTownMobs

      public void setForceTownMobs(boolean setMobs)
    • isForceTownMobs

      public boolean isForceTownMobs()
    • setEndermanProtect

      public void setEndermanProtect(boolean setEnder)
    • isEndermanProtect

      public boolean isEndermanProtect()
    • setClaimable

      public void setClaimable(boolean isClaimable)
    • isClaimable

      public boolean isClaimable()
    • setUsingDefault

      public void setUsingDefault()
    • setUsingPlotManagementDelete

      public void setUsingPlotManagementDelete(boolean using)
    • isUsingPlotManagementDelete

      public boolean isUsingPlotManagementDelete()
    • setDeletingEntitiesOnUnclaim

      public void setDeletingEntitiesOnUnclaim(boolean using)
    • isDeletingEntitiesOnUnclaim

      public boolean isDeletingEntitiesOnUnclaim()
    • getUnclaimDeleteEntityTypes

      public Collection<org.bukkit.entity.EntityType> getUnclaimDeleteEntityTypes()
    • setUnclaimDeleteEntityTypes

      public void setUnclaimDeleteEntityTypes(List<String> entityTypes)
    • setUsingPlotManagementMayorDelete

      public void setUsingPlotManagementMayorDelete(boolean using)
    • isUsingPlotManagementMayorDelete

      public boolean isUsingPlotManagementMayorDelete()
    • setUsingPlotManagementRevert

      public void setUsingPlotManagementRevert(boolean using)
    • isUsingPlotManagementRevert

      public boolean isUsingPlotManagementRevert()
    • getPlotManagementDeleteIds

      public Collection<org.bukkit.Material> getPlotManagementDeleteIds()
    • isPlotManagementDeleteIds

      public boolean isPlotManagementDeleteIds(org.bukkit.Material material)
    • setPlotManagementDeleteIds

      public void setPlotManagementDeleteIds(List<String> plotManagementDeleteIds)
    • getPlotManagementMayorDelete

      public Collection<org.bukkit.Material> getPlotManagementMayorDelete()
    • isPlotManagementMayorDelete

      public boolean isPlotManagementMayorDelete(org.bukkit.Material material)
    • setPlotManagementMayorDelete

      public void setPlotManagementMayorDelete(List<String> plotManagementMayorDelete)
    • isUnclaimedBlockAllowedToRevert

      public boolean isUnclaimedBlockAllowedToRevert(org.bukkit.Material mat)
    • getPlotManagementIgnoreIds

      public Collection<org.bukkit.Material> getPlotManagementIgnoreIds()
    • isPlotManagementIgnoreIds

      public boolean isPlotManagementIgnoreIds(org.bukkit.Material mat)
    • setPlotManagementIgnoreIds

      public void setPlotManagementIgnoreIds(List<String> plotManagementIgnoreIds)
    • getRevertOnUnclaimWhitelistMaterials

      public Collection<org.bukkit.Material> getRevertOnUnclaimWhitelistMaterials()
    • setRevertOnUnclaimWhitelistMaterials

      public void setRevertOnUnclaimWhitelistMaterials(List<String> revertOnUnclaimWhitelistMaterials)
    • isRevertOnUnclaimWhitelistMaterial

      public boolean isRevertOnUnclaimWhitelistMaterial(org.bukkit.Material mat)
    • isUsingPlotManagementWildEntityRevert

      public boolean isUsingPlotManagementWildEntityRevert()
      Returns:
      the isUsingPlotManagementWildEntityRevert
    • isUsingPlotManagementWildBlockRevert

      public boolean isUsingPlotManagementWildBlockRevert()
      Returns:
      the isUsingPlotManagementWildBlockRevert
    • setUsingPlotManagementWildEntityRevert

      public void setUsingPlotManagementWildEntityRevert(boolean isUsingPlotManagementWildEntityRevert)
      Parameters:
      isUsingPlotManagementWildEntityRevert - the isUsingPlotManagementWildRevert to set
    • setUsingPlotManagementWildBlockRevert

      public void setUsingPlotManagementWildBlockRevert(boolean isUsingPlotManagementWildBlockRevert)
      Parameters:
      isUsingPlotManagementWildBlockRevert - the isUsingPlotManagementWildBlockRevert to set
    • getPlotManagementWildRevertDelay

      public long getPlotManagementWildRevertDelay()
      Returns:
      the plotManagementWildRevertDelay
    • setPlotManagementWildRevertDelay

      public void setPlotManagementWildRevertDelay(long plotManagementWildRevertDelay)
      Parameters:
      plotManagementWildRevertDelay - the plotManagementWildRevertDelay to set
    • setPlotManagementWildRevertEntities

      public void setPlotManagementWildRevertEntities(List<String> entities)
    • getPlotManagementWildRevertEntities

      public Collection<org.bukkit.entity.EntityType> getPlotManagementWildRevertEntities()
    • isProtectingExplosionEntity

      public boolean isProtectingExplosionEntity(org.bukkit.entity.Entity entity)
    • setPlotManagementWildRevertBlockWhitelist

      public void setPlotManagementWildRevertBlockWhitelist(List<String> mats)
    • getPlotManagementWildRevertBlockWhitelist

      public Collection<org.bukkit.Material> getPlotManagementWildRevertBlockWhitelist()
    • isPlotManagementWildRevertWhitelistedBlock

      public boolean isPlotManagementWildRevertWhitelistedBlock(org.bukkit.Material mat)
    • isExplodedBlockAllowedToRevert

      public boolean isExplodedBlockAllowedToRevert(org.bukkit.Material mat)
    • setWildRevertMaterialsToNotOverwrite

      public void setWildRevertMaterialsToNotOverwrite(List<String> mats)
    • getWildRevertMaterialsToNotOverwrite

      public Collection<org.bukkit.Material> getWildRevertMaterialsToNotOverwrite()
    • isMaterialNotAllowedToBeOverwrittenByWildRevert

      public boolean isMaterialNotAllowedToBeOverwrittenByWildRevert(org.bukkit.Material mat)
    • isBlockAllowedToRevert

      @Deprecated public boolean isBlockAllowedToRevert(org.bukkit.Material mat)
      Deprecated.
      Parameters:
      mat - Material that is being checked
      Returns:
      true if the block should be reverted after blocking up.
    • setPlotManagementWildRevertMaterials

      public void setPlotManagementWildRevertMaterials(List<String> mats)
    • getPlotManagementWildRevertBlocks

      public Collection<org.bukkit.Material> getPlotManagementWildRevertBlocks()
    • isProtectingExplosionBlock

      public boolean isProtectingExplosionBlock(org.bukkit.Material material)
    • setUnclaimedZoneIgnore

      public void setUnclaimedZoneIgnore(List<String> unclaimedZoneIgnoreIds)
    • getUnclaimedZoneIgnoreMaterials

      public Collection<org.bukkit.Material> getUnclaimedZoneIgnoreMaterials()
    • isUnclaimedZoneIgnoreMaterial

      public boolean isUnclaimedZoneIgnoreMaterial(org.bukkit.Material mat)
    • getUnclaimedZonePerm

      public boolean getUnclaimedZonePerm(TownyPermission.ActionType type)
    • getUnclaimedZoneBuild

      public Boolean getUnclaimedZoneBuild()
    • setUnclaimedZoneBuild

      public void setUnclaimedZoneBuild(Boolean unclaimedZoneBuild)
    • getUnclaimedZoneDestroy

      public Boolean getUnclaimedZoneDestroy()
    • setUnclaimedZoneDestroy

      public void setUnclaimedZoneDestroy(Boolean unclaimedZoneDestroy)
    • getUnclaimedZoneSwitch

      public Boolean getUnclaimedZoneSwitch()
    • setUnclaimedZoneSwitch

      public void setUnclaimedZoneSwitch(Boolean unclaimedZoneSwitch)
    • getUnclaimedZoneName

      public String getUnclaimedZoneName()
    • getFormattedUnclaimedZoneName

      public String getFormattedUnclaimedZoneName()
    • setUnclaimedZoneName

      public void setUnclaimedZoneName(String unclaimedZoneName)
    • setUsingTowny

      public void setUsingTowny(boolean isUsingTowny)
    • isUsingTowny

      public boolean isUsingTowny()
    • setUnclaimedZoneItemUse

      public void setUnclaimedZoneItemUse(Boolean unclaimedZoneItemUse)
    • getUnclaimedZoneItemUse

      public Boolean getUnclaimedZoneItemUse()
    • getMinDistanceFromOtherTowns

      @Deprecated public int getMinDistanceFromOtherTowns(Coord key)
      Deprecated.
      Checks the distance from the closest homeblock.
      Parameters:
      key - - Coord to check from.
      Returns:
      the distance to nearest towns homeblock.
    • getMinDistanceFromOtherTownsHomeBlocks

      public int getMinDistanceFromOtherTownsHomeBlocks(Coord key)
      Checks the distance from the closest homeblock.
      Parameters:
      key - - Coord to check from.
      Returns:
      the distance to nearest towns homeblock.
    • getMinDistanceFromOtherTowns

      @Deprecated public int getMinDistanceFromOtherTowns(Coord key, Town homeTown)
      Deprecated.
      Checks the distance from a another town's homeblock.
      Parameters:
      key - - Coord to check from.
      homeTown - Players town
      Returns:
      the closest distance to another towns homeblock.
    • getMinDistanceFromOtherTownsHomeBlocks

      public int getMinDistanceFromOtherTownsHomeBlocks(Coord key, Town homeTown)
      Checks the distance from a another town's homeblock, or the distance to another Town if homeTown is null.
      Parameters:
      key - Coord to check from.
      homeTown - The town belonging to a player, so that the town's own homeblock is not returned, or null if this should apply to any townblock, and not just homeblocks.
      Returns:
      the closest distance to another towns homeblock.
    • getMinDistanceFromOtherTownsPlots

      public int getMinDistanceFromOtherTownsPlots(Coord key)
      Checks the distance from the closest town block.
      Parameters:
      key - - Coord to check from.
      Returns:
      the distance to nearest town's townblock.
    • getMinDistanceFromOtherTownsPlots

      public int getMinDistanceFromOtherTownsPlots(Coord key, Town homeTown)
      Checks the distance from a another town's plots.
      Parameters:
      key - - Coord to check from.
      homeTown - Players town
      Returns:
      the closest distance to another towns nearest plot.
    • getMinDistanceFromOtherPlotsOwnedByTown

      public int getMinDistanceFromOtherPlotsOwnedByTown(Coord key, Town town)
      Returns the distance to the closest townblock from the given coord, for the give town.
      Parameters:
      key - Coord to be tested from.
      town - Town to have their townblocks measured.
      Returns:
      the closest distance to the towns townblock.
    • getClosestTownWithNationFromCoord

      public Town getClosestTownWithNationFromCoord(Coord key, Town nearestTown)
      Returns the closest town with a nation from a given coord (key).
      Parameters:
      key - - Coord.
      nearestTown - - Closest town to given coord.
      Returns:
      the nearest town belonging to a nation.
    • getClosestTownblockWithNationFromCoord

      @Nullable public @Nullable TownBlock getClosestTownblockWithNationFromCoord(Coord key)
      Get the town block that belongs to the closest town with a nation from the specified coord.
      Parameters:
      key - - Coordinate to compare distance to
      Returns:
      The nearest townblock that belongs to a town or null if there are no towns in the world.
    • addMetaData

      public void addMetaData(@NotNull @NotNull CustomDataField<?> md)
      Description copied from class: TownyObject
      Add a specific metadata to this TownyObject. Overrides existing metadata of the same key. Most implementations will save the object after this method is called.
      Overrides:
      addMetaData in class TownyObject
      Parameters:
      md - CustomDataField to add.
    • removeMetaData

      public void removeMetaData(@NotNull @NotNull CustomDataField<?> md)
      Description copied from class: TownyObject
      Remove a specific metadata from the TownyObject. The metadata does not need to be the same instance of the one added, but must have the same key. Most implementations will save the TownyObject after removing the metadata.
      Overrides:
      removeMetaData in class TownyObject
      Parameters:
      md - CustomDataField to remove.
    • hasBedExplosionAtBlock

      @Internal public boolean hasBedExplosionAtBlock(org.bukkit.Location location)
      Does this world have an exploded bet at the location?
      Parameters:
      location - Location to test.
      Returns:
      true when the bed map contains the location.
    • getBedExplosionMaterial

      @Nullable @Internal public @Nullable org.bukkit.Material getBedExplosionMaterial(org.bukkit.Location location)
      Gets the exploded bed material.
      Parameters:
      location - Location to get the material.
      Returns:
      material of the bed or null if the bedMap doesn't contain the location.
    • addBedExplosionAtBlock

      @Internal public void addBedExplosionAtBlock(org.bukkit.Location location, org.bukkit.Material material)
    • removeBedExplosionAtBlock

      @Internal public void removeBedExplosionAtBlock(org.bukkit.Location location)
    • hasTridentStrike

      @Internal public boolean hasTridentStrike(UUID uuid)
    • addTridentStrike

      @Internal public void addTridentStrike(UUID uuid)
    • removeTridentStrike

      @Internal public void removeTridentStrike(UUID uuid)
    • setFriendlyFire

      public void setFriendlyFire(boolean parseBoolean)
    • isFriendlyFireEnabled

      public boolean isFriendlyFireEnabled()
    • save

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

      @Internal 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.