Class RegionChunk
java.lang.Object
tfagaming.projects.minecraft.homestead.models.RegionChunk
-
Constructor Summary
ConstructorsConstructorDescriptionRegionChunk(long id, long regionId, UUID worldId, int x, int z, long claimedAt, boolean forceLoaded) RegionChunk(long regionId, UUID worldId, int x, int z, long claimedAt, boolean forceLoaded) RegionChunk(long regionId, org.bukkit.Chunk chunk) RegionChunk(long regionId, org.bukkit.World world, int x, int z) -
Method Summary
Modifier and TypeMethodDescriptionbooleanlong@Nullable RegionReturns the region by directly fetching with region ID from cache.long@NotNull StringReturns the region name safely by directly fetching with region ID from cache.long@Nullable org.bukkit.WorldgetWorld()@NotNull UUIDintgetX()intgetZ()inthashCode()booleanvoidsetAutoUpdate(boolean autoUpdate) Toggle Auto-Update for caching.voidsetClaimedAt(long claimedAt) voidsetForceLoaded(boolean forceLoaded) voidsetRegionId(long regionId) voidsetWorldId(@NotNull UUID worldId) voidsetX(int x) voidsetZ(int z) @Nullable org.bukkit.ChunktoBukkit()@Nullable org.bukkit.LocationExactly the same astoBukkitLocation(), without the highest block Y check.@Nullable org.bukkit.Location
-
Constructor Details
-
RegionChunk
public RegionChunk(long regionId, org.bukkit.Chunk chunk) -
RegionChunk
public RegionChunk(long regionId, org.bukkit.World world, int x, int z) -
RegionChunk
-
RegionChunk
public RegionChunk(long id, long regionId, UUID worldId, int x, int z, long claimedAt, boolean forceLoaded)
-
-
Method Details
-
setAutoUpdate
public void setAutoUpdate(boolean autoUpdate) Toggle Auto-Update for caching. Iftrue, any call for setters will automatically update the cache. Otherwise, only the instance of the class will be updated.- Parameters:
autoUpdate- Auto-Update toggle
-
getUniqueId
public long getUniqueId() -
getRegionId
public long getRegionId() -
setRegionId
public void setRegionId(long regionId) -
getRegion
Returns the region by directly fetching with region ID from cache.- Returns:
- The region if found,
nullotherwise.
-
getRegionName
Returns the region name safely by directly fetching with region ID from cache.- Returns:
- The region name if found,
"?"otherwise.
-
getWorldId
-
setWorldId
-
getWorld
@Nullable public @Nullable org.bukkit.World getWorld() -
getX
public int getX() -
setX
public void setX(int x) -
getZ
public int getZ() -
setZ
public void setZ(int z) -
getClaimedAt
public long getClaimedAt() -
setClaimedAt
public void setClaimedAt(long claimedAt) -
isForceLoaded
public boolean isForceLoaded() -
setForceLoaded
public void setForceLoaded(boolean forceLoaded) -
toBukkit
@Nullable public @Nullable org.bukkit.Chunk toBukkit() -
toBukkitLocation
@Nullable public @Nullable org.bukkit.Location toBukkitLocation() -
toBukkitDisplayLocation
@Nullable public @Nullable org.bukkit.Location toBukkitDisplayLocation()Exactly the same astoBukkitLocation(), without the highest block Y check. -
equals
-
hashCode
public int hashCode()
-