Package org.kingdoms.constants.land
Class Land
java.lang.Object
org.kingdoms.constants.metadata.KingdomsObject<SimpleChunkLocation>
org.kingdoms.constants.land.Land
-
Field Summary
Fields inherited from class org.kingdoms.constants.metadata.KingdomsObject
metadata -
Constructor Summary
ConstructorsConstructorDescriptionLand(@NonNull Kingdom kingdom, @NonNull SimpleChunkLocation chunk) Land(@NonNull SimpleChunkLocation chunk) Land(@NonNull SimpleChunkLocation location, @Nullable UUID kingdom, @Nullable UUID claimedBy, @NonNull Map<SimpleLocation, Structure> structures, @NonNull Map<SimpleLocation, Turret> turrets, @NonNull Map<SimpleLocation, ProtectionSign> protectedBlocks, long since) Land(@Nullable UUID kingdom, @NonNull SimpleChunkLocation chunk) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInvasion(@NonNull Invasion invasion) Adds an invasion that affects this land.static booleandisconnectsLandsAfterUnclaim(SimpleChunkLocation unclaimed, Kingdom kingdom) voidendInvasions(Invasion.Result result) boolean@Nullable UUID@Nullable KingdomPlayer@NonNull String@NonNull SimpleChunkLocationA list of all ongoing invasions that are affecting this land with the keys as the invader's kingdom ID.@Nullable Kingdom@Nullable UUIDstatic @Nullable LandgetLand(@NonNull org.bukkit.block.Block block) static @Nullable LandgetLand(@NonNull org.bukkit.Chunk chunk) static @Nullable LandgetLand(@NonNull org.bukkit.Location location) static @Nullable LandgetLand(@NonNull SimpleChunkLocation loc) static @Nullable LandgetLand(@NonNull SimpleLocation loc) @NonNull SimpleChunkLocationstatic @Nullable NationZonegetNationZone(SimpleChunkLocation chunk) @NonNull Map<SimpleLocation,ProtectionSign> longgetSince()<T extends Structure>
TgetStructure(@NonNull Class<T> type) getStructure(@NonNull Predicate<Structure> predicate) @NonNull Map<SimpleLocation,Structure> @NonNull Map<SimpleLocation,Turret> inthashCode()booleanbooleanstatic booleanisConnected(SimpleChunkLocation chunk, Kingdom kingdom) static booleanisConnected(SimpleChunkLocation chunk, Kingdom kingdom, int radius) Gets the chunk in the given radius that is not the unclaiming land and itself is claimed by the given kingdom.booleanbooleanremoveInvasion(@NonNull UUID kingdom) removeInvasion(@NonNull Kingdom kingdom) voidsetClaimedBy(@Nullable UUID claimedBy) voidsetKingdom(@Nullable UUID kingdom) voidsetProtectedBlocks(@NonNull Map<SimpleLocation, ProtectionSign> protectedBlocks) voidsetSince(long since) voidsetTurrets(@NonNull Map<SimpleLocation, Turret> turrets) voidbooleansimpleEquals(@Nullable Land land) toString()unclaim(@Nullable KingdomPlayer by, UnclaimLandEvent.Reason reason) unclaim(@Nullable KingdomPlayer by, UnclaimLandEvent.Reason reason, boolean history) static LandvalidateDistance(SimpleChunkLocation chunk, UUID kingdom) Methods inherited from class org.kingdoms.constants.metadata.KingdomsObject
compressBoolean, compressCollecton, compressCollecton, compressColor, compressInventory, compressLocation, compressMap, compressMetadata, compressString, compressUUID, getMetadata, getSaveMeta, setMetadata, setSaveMeta, shouldSave
-
Constructor Details
-
Land
public Land(@NonNull SimpleChunkLocation location, @Nullable UUID kingdom, @Nullable UUID claimedBy, @NonNull Map<SimpleLocation, Structure> structures, @NonNull Map<SimpleLocation, Turret> turrets, @NonNull Map<SimpleLocation, ProtectionSign> protectedBlocks, long since) -
Land
-
Land
-
Land
-
-
Method Details
-
getLand
-
getLand
-
getLand
-
getLand
-
getLand
-
getNationZone
-
validateDistance
-
isConnected
-
disconnectsLandsAfterUnclaim
-
isConnected
Gets the chunk in the given radius that is not the unclaiming land and itself is claimed by the given kingdom. So if it returns null it means the land is disconnected since there are no lands connecting this land to another. -
isHomeLand
public boolean isHomeLand() -
isClaimed
public boolean isClaimed() -
isNexusLand
public boolean isNexusLand() -
getStructure
-
getStructure
-
hashCode
public int hashCode() -
equals
-
simpleEquals
-
unclaim
-
unclaim
public UnclaimLandEvent unclaim(@Nullable KingdomPlayer by, UnclaimLandEvent.Reason reason, boolean history) -
silentUnclaim
public void silentUnclaim() -
getLocation
-
getDataKey
- Specified by:
getDataKeyin classKingdomsObject<SimpleChunkLocation>
-
toString
-
getCompressedData
- Specified by:
getCompressedDatain classKingdomsObject<SimpleChunkLocation>
-
getKingdom
-
setKingdom
-
isBeingInvaded
public boolean isBeingInvaded() -
getKingdomId
-
getStructures
-
getClaimedBy
-
setClaimedBy
-
getClaimer
-
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.
-
addInvasion
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
-
removeInvasion
-
removeInvasion
-
getProtectedBlocks
-
setProtectedBlocks
-
getTurrets
-
setTurrets
-
getSince
public long getSince() -
setSince
public void setSince(long since)
-