Class IslandInfo

java.lang.Object
us.talabrek.ultimateskyblock.island.IslandInfo
All Implemented Interfaces:
us.talabrek.ultimateskyblock.api.IslandInfo

public class IslandInfo extends Object implements us.talabrek.ultimateskyblock.api.IslandInfo
Data object for an island
  • Constructor Details

    • IslandInfo

      public IslandInfo(@NotNull @NotNull String islandName, @NotNull @NotNull uSkyBlock plugin)
  • Method Details

    • exists

      public boolean exists()
    • setDirectory

      public static void setDirectory(@NotNull @NotNull File dir)
    • resetIslandConfig

      public void resetIslandConfig(@NotNull @NotNull String leader)
    • setupPartyLeader

      public void setupPartyLeader(@NotNull @NotNull String leader)
    • addMember

      public void addMember(@NotNull @NotNull PlayerInfo playerInfo)
    • setupPartyMember

      public void setupPartyMember(@NotNull @NotNull PlayerInfo member)
    • updatePermissionPerks

      public void updatePermissionPerks(@NotNull @NotNull org.bukkit.entity.Player member, @NotNull @NotNull Perk perk)
    • save

      public void save()
    • isDirty

      public boolean isDirty()
    • saveToFile

      public void saveToFile()
    • getMaxPartySize

      public int getMaxPartySize()
      Specified by:
      getMaxPartySize in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • getMaxAnimals

      public int getMaxAnimals()
      Specified by:
      getMaxAnimals in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • getMaxMonsters

      public int getMaxMonsters()
      Specified by:
      getMaxMonsters in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • getMaxVillagers

      public int getMaxVillagers()
      Specified by:
      getMaxVillagers in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • getMaxGolems

      public int getMaxGolems()
      Specified by:
      getMaxGolems in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • getBlockLimits

      @NotNull public @NotNull Map<org.bukkit.Material,Integer> getBlockLimits()
      Specified by:
      getBlockLimits in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • getLeader

      public String getLeader()
      Specified by:
      getLeader in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • getLeaderUniqueId

      public UUID getLeaderUniqueId()
    • hasPerm

      public boolean hasPerm(org.bukkit.entity.Player player, String perm)
    • hasPerm

      public boolean hasPerm(String playerName, String perm)
    • getBiome

      public String getBiome()
      Specified by:
      getBiome in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • setBiome

      public void setBiome(@NotNull @NotNull String biome)
    • setWarpLocation

      public void setWarpLocation(@Nullable @Nullable org.bukkit.Location loc)
    • togglePerm

      public boolean togglePerm(@NotNull @NotNull String playername, @NotNull @NotNull String perm)
    • getMembers

      @NotNull public @NotNull Set<String> getMembers()
      Specified by:
      getMembers in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • getMemberUUIDs

      @NotNull public @NotNull Set<UUID> getMemberUUIDs()
    • isMember

      public boolean isMember(@NotNull @NotNull org.bukkit.OfflinePlayer target)
    • log

      public void log(@NotNull @NotNull String message, @Nullable @Nullable Object[] args)
    • getPartySize

      public int getPartySize()
      Specified by:
      getPartySize in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • isLeader

      public boolean isLeader(@NotNull @NotNull org.bukkit.OfflinePlayer target)
    • isLeader

      public boolean isLeader(org.bukkit.entity.Player player)
      Specified by:
      isLeader in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • isLeader

      public boolean isLeader(String playerName)
    • hasWarp

      public boolean hasWarp()
    • isLocked

      public boolean isLocked()
    • getName

      public String getName()
      Specified by:
      getName in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • setWarp

      public void setWarp(boolean active)
    • lock

      public boolean lock(@NotNull @NotNull org.bukkit.entity.Player player)
      Locks the island. Might get cancelled via the fired IslandLockEvent.
      Parameters:
      player - Player initializing the lock.
      Returns:
      True if the island was locked, false otherwise, e.g. when the event is cancelled.
    • unlock

      public boolean unlock(@NotNull @NotNull org.bukkit.entity.Player player)
      Unlocks the island. Might get cancelled via the fired IslandUnlockEvent.
      Parameters:
      player - Player initializing the unlock.
      Returns:
      True if the island was unlocked, false otherwise, e.g. when the event is cancelled.
    • sendMessageToIslandGroup

      public void sendMessageToIslandGroup(boolean broadcast, @NotNull @NotNull String message, @Nullable @Nullable Object... args)
    • isBanned

      public boolean isBanned(@NotNull @NotNull org.bukkit.OfflinePlayer target)
      Specified by:
      isBanned in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • isBanned

      public boolean isBanned(org.bukkit.entity.Player player)
      Specified by:
      isBanned in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • isBanned

      public boolean isBanned(String name)
    • isBanned

      public boolean isBanned(UUID uuid)
    • banPlayer

      public boolean banPlayer(@NotNull @NotNull org.bukkit.OfflinePlayer target)
      Specified by:
      banPlayer in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • banPlayer

      public boolean banPlayer(@NotNull @NotNull org.bukkit.OfflinePlayer target, @Nullable @Nullable org.bukkit.OfflinePlayer initializer)
      Specified by:
      banPlayer in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • unbanPlayer

      public boolean unbanPlayer(@NotNull @NotNull org.bukkit.OfflinePlayer target)
      Specified by:
      unbanPlayer in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • unbanPlayer

      public boolean unbanPlayer(@NotNull @NotNull org.bukkit.OfflinePlayer target, @Nullable @Nullable org.bukkit.OfflinePlayer initializer)
      Specified by:
      unbanPlayer in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • banPlayer

      @Deprecated public void banPlayer(@NotNull @NotNull UUID uuid)
      Deprecated.
    • getBans

      @NotNull public @NotNull List<String> getBans()
      Specified by:
      getBans in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • getTrustees

      @Deprecated @NotNull public @NotNull List<String> getTrustees()
      Deprecated.
      Specified by:
      getTrustees in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • getTrusteeUUIDs

      @NotNull public @NotNull List<UUID> getTrusteeUUIDs()
    • trustPlayer

      public boolean trustPlayer(@NotNull @NotNull org.bukkit.OfflinePlayer target)
      Specified by:
      trustPlayer in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • trustPlayer

      public boolean trustPlayer(@NotNull @NotNull org.bukkit.OfflinePlayer target, @Nullable @Nullable org.bukkit.OfflinePlayer initializer)
      Specified by:
      trustPlayer in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • untrustPlayer

      public boolean untrustPlayer(@NotNull @NotNull org.bukkit.OfflinePlayer target)
      Specified by:
      untrustPlayer in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • untrustPlayer

      public boolean untrustPlayer(@NotNull @NotNull org.bukkit.OfflinePlayer target, @Nullable @Nullable org.bukkit.OfflinePlayer initializer)
      Specified by:
      untrustPlayer in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • isTrusted

      public boolean isTrusted(@NotNull @NotNull org.bukkit.OfflinePlayer target)
      Specified by:
      isTrusted in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • removeMember

      public void removeMember(@NotNull @NotNull PlayerInfo member)
    • setLevel

      public void setLevel(double score)
    • getLevel

      public double getLevel()
      Specified by:
      getLevel in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • setRegionVersion

      public void setRegionVersion(String version)
    • getRegionVersion

      public String getRegionVersion()
    • getLog

      @NotNull public @NotNull List<String> getLog()
      Specified by:
      getLog in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • isParty

      public boolean isParty()
      Specified by:
      isParty in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • getWarpLocation

      @Nullable public @Nullable org.bukkit.Location getWarpLocation()
      Specified by:
      getWarpLocation in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • getIslandLocation

      public org.bukkit.Location getIslandLocation()
      Specified by:
      getIslandLocation in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hasOnlineMembers

      public boolean hasOnlineMembers()
      Specified by:
      hasOnlineMembers in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • getOnlineMembers

      public List<org.bukkit.entity.Player> getOnlineMembers()
      Specified by:
      getOnlineMembers in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • contains

      public boolean contains(org.bukkit.Location loc)
      Specified by:
      contains in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • sendMessageToOnlineMembers

      public void sendMessageToOnlineMembers(String msg)
    • delete

      public void delete()
    • ignore

      public boolean ignore()
    • setIgnore

      public void setIgnore(boolean b)
    • getLeafBreaks

      public int getLeafBreaks()
    • setLeafBreaks

      public void setLeafBreaks(int breaks)
    • getSchematicName

      public String getSchematicName()
      Specified by:
      getSchematicName in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • setSchematicName

      public void setSchematicName(String schematicName)
    • getScoreMultiplier

      public double getScoreMultiplier()
      Specified by:
      getScoreMultiplier in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • setScoreMultiplier

      public void setScoreMultiplier(Double d)
    • getScoreOffset

      public double getScoreOffset()
      Specified by:
      getScoreOffset in interface us.talabrek.ultimateskyblock.api.IslandInfo
    • setScoreOffset

      public void setScoreOffset(Double d)
    • getHopperCount

      public int getHopperCount()
    • setHopperCount

      public void setHopperCount(int i)
    • setFile

      public void setFile(File file)
      If you need to inject a custom File for e.g. unit tests, do it here.
      Parameters:
      file - Custom File
    • setConfig

      public void setConfig(org.bukkit.configuration.file.FileConfiguration config)
      If you need to inject a custom FileConfiguration for e.g. unit tests, do it here.
      Parameters:
      config - Custom FileConfiguration