Class Land

All Implemented Interfaces:
Keyed<SimpleChunkLocation>, SmartObject, org.kingdoms.constants.group.model.logs.Loggable, org.kingdoms.locale.provider.CascadingMessageContextProvider, org.kingdoms.locale.provider.MessageContextProvider

public class Land extends KeyedKingdomsObject<SimpleChunkLocation>
You can find a variety of different methods in ChunkConnections as well.
  • Constructor Details

  • Method Details

    • getLand

      public static @Nullable Land getLand(@NonNull org.bukkit.Location location)
    • getLand

      public static @Nullable Land getLand(@NonNull org.bukkit.Chunk chunk)
    • getLand

      public static @Nullable Land getLand(@NonNull org.bukkit.block.Block block)
    • isClaimed

      @Pure public static boolean isClaimed(@Nullable Land land)
      isClaimed() shorthand method for null checking.
    • getLand

      public static @Nullable Land getLand(@NonNull SimpleChunkLocation loc)
    • getLand

      public static @Nullable Land getLand(@NonNull SimpleLocation loc)
    • getNationZone

      public static @Nullable NationZone getNationZone(SimpleChunkLocation chunk)
      See Also:
    • isHomeLand

      public boolean isHomeLand()
    • isClaimed

      public boolean isClaimed()
    • isNexusLand

      public boolean isNexusLand()
    • getStructure

      public Structure getStructure(@NonNull Predicate<Structure> predicate)
    • getKingdomBlock

      public <T extends KeyedKingdomsObject<?>> @Nullable T getKingdomBlock(@NonNull org.kingdoms.server.location.BlockVector3 location, Class<T> type)
      Gets the desired kingdom block at the specified location.
      Returns:
      null if there's no kingdom block at that location or if there is, it's not the same type as the specified one.
      See Also:
    • isKingdomBlock

      public boolean isKingdomBlock(@NonNull org.kingdoms.server.location.BlockVector3 location)
      See Also:
    • getStructure

      public <T extends Structure> T getStructure(@NonNull Class<T> type)
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • simpleEquals

      public boolean simpleEquals(@Nullable Land land)
    • unclaim

      public UnclaimLandEvent unclaim(@Nullable KingdomPlayer by, UnclaimLandEvent.Reason reason)
    • unclaim

      public UnclaimLandEvent unclaim(@Nullable KingdomPlayer by, UnclaimLandEvent.Reason reason, boolean history)
    • silentUnclaim

      @Internal public void silentUnclaim()
    • silentUnclaim

      @Internal public void silentUnclaim(boolean removeExtras)
    • isDataEmpty

      @Internal public boolean isDataEmpty()
      Description copied from interface: SmartObject
      Checks whether this data is absolutely empty and can be deleted from the database. The definition of "empty" depends on the implementation.
      Returns:
      true if the data is empty and should be deleted, otherwise false
    • getLocation

      public @NonNull SimpleChunkLocation getLocation()
    • getKey

      public @NonNull SimpleChunkLocation getKey()
    • toString

      public String toString()
      Overrides:
      toString in class CompressedSmartObject
    • getDataHandler

      protected org.kingdoms.data.handlers.abstraction.DataHandler<Land> getDataHandler()
      Description copied from class: CompressedSmartObject
      Used for serialization of the smart object into a compressed state to determine CompressedSmartObject.shouldSave()
      Overrides:
      getDataHandler in class CompressedSmartObject
    • getKingdom

      public @Nullable Kingdom getKingdom()
    • setKingdom

      public void setKingdom(@Nullable UUID kingdom)
    • isBeingInvaded

      public boolean isBeingInvaded()
    • getKingdomId

      public @Nullable UUID getKingdomId()
    • getStructures

      public @NonNull @Unmodifiable Map<org.kingdoms.server.location.BlockVector3,Structure> getStructures()
    • unsafeGetStructures

      @Internal @Bookmark(UNSAFE) public @NonNull @Bookmark(UNSAFE) Map<org.kingdoms.server.location.BlockVector3,Structure> unsafeGetStructures()
    • unsafeGetTurrets

      @Internal @Bookmark(UNSAFE) public @NonNull @Bookmark(UNSAFE) Map<org.kingdoms.server.location.BlockVector3,Turret> unsafeGetTurrets()
    • unsafeGetProtectedBlocks

      @Internal @Bookmark(UNSAFE) public @NonNull @Bookmark(UNSAFE) Map<org.kingdoms.server.location.BlockVector3,ProtectionSign> unsafeGetProtectedBlocks()
    • getKingdomBlocks

      public @NonNull @Unmodifiable Map<org.kingdoms.server.location.BlockVector3,KingdomBlock> getKingdomBlocks()
      Gets a list of all blocks that is considered to belong to kingdoms plugin. The value can be one of the following:

      Note that multiple blocks can belong to the same object, so this is not a viable/efficient way to iterate through blocks. This map is unmodifiable and should only be used to check block locations.

    • unsafeGetKingdomBlocks

      @Internal @Bookmark(UNSAFE) public @NonNull @Bookmark(UNSAFE) Map<org.kingdoms.server.location.BlockVector3,KingdomBlock> unsafeGetKingdomBlocks()
    • getClaimedBy

      public @Nullable UUID getClaimedBy()
    • setClaimedBy

      public void setClaimedBy(@Nullable UUID claimedBy)
    • getClaimer

      public @Nullable KingdomPlayer getClaimer()
    • getInvasions

      public @Nullable Map<UUID,Invasion> getInvasions()
      A list of all ongoing invasions that are affecting this land with the keys as the invader's kingdom ID.
      Returns:
      an unmodifiable map.
    • isUnderAttack

      public boolean isUnderAttack()
    • addInvasion

      public void addInvasion(@NonNull Invasion invasion)
      Adds an invasion that affects this land.
      Parameters:
      invasion - the invasion that's affecting this land.
      Throws:
      IllegalArgumentException - if the invasion is already added or the invasion doesn't affect this land.
    • endInvasions

      public void endInvasions(Invasion.Result result)
    • removeInvasion

      public Invasion removeInvasion(@NonNull Kingdom kingdom)
    • removeInvasion

      public Invasion removeInvasion(@NonNull UUID kingdom)
    • getProtectedBlocks

      public @NonNull @Unmodifiable Map<org.kingdoms.server.location.BlockVector3,ProtectionSign> getProtectedBlocks()
    • getTurrets

      public @NonNull @Unmodifiable Map<org.kingdoms.server.location.BlockVector3,Turret> getTurrets()
    • getSince

      public long getSince()
    • setSince

      public void setSince(long since)
    • addMessageContextEdits

      public void addMessageContextEdits(@NotNull @NotNull MessagePlaceholderProvider context)
      Specified by:
      addMessageContextEdits in interface org.kingdoms.locale.provider.CascadingMessageContextProvider
      Overrides:
      addMessageContextEdits in class KingdomsObject