Class RespawnLocation
java.lang.Object
org.bukkit.Location
org.mvplugins.multiverse.inventories.util.RespawnLocation
- All Implemented Interfaces:
io.papermc.paper.math.FinePosition
,io.papermc.paper.math.Position
,Cloneable
,org.bukkit.configuration.serialization.ConfigurationSerializable
@AvailableSince("5.2")
public class RespawnLocation
extends org.bukkit.Location
Location information with respawn type. See also
TODO: This should extend UnloadedWorldLocation, but that class is currently a final class!!!
RespawnLocation.RespawnLocationType
.
TODO: This should extend UnloadedWorldLocation, but that class is currently a final class!!!
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The type of respawn location. -
Field Summary
Fields inherited from interface io.papermc.paper.math.Position
BLOCK_ZERO, FINE_ZERO
-
Constructor Summary
ConstructorsConstructorDescriptionRespawnLocation
(String worldName, double x, double y, double z, float yaw, float pitch, RespawnLocation.RespawnLocationType respawnType) RespawnLocation
(String worldName, double x, double y, double z, RespawnLocation.RespawnLocationType respawnType) RespawnLocation
(org.bukkit.Location location, RespawnLocation.RespawnLocationType respawnType) RespawnLocation
(org.bukkit.World world, double x, double y, double z, float yaw, float pitch, RespawnLocation.RespawnLocationType respawnType) RespawnLocation
(org.bukkit.World world, double x, double y, double z, RespawnLocation.RespawnLocationType respawnType) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.Location
deserialize
(Map<String, Object> args) Required method for deserializationboolean
Gets the respawn location type.org.bukkit.World
getWorld()
int
hashCode()
boolean
Checks if the respawn location is valid based on the respawn type.void
setRespawnType
(RespawnLocation.RespawnLocationType respawnType) Sets the respawn location type.void
setWorld
(org.bukkit.World world) void
setWorldName
(String worldName) org.bukkit.Location
Makes a bukkitLocation
copy from this SpawnLocation.toString()
Methods inherited from class org.bukkit.Location
add, add, add, add, addRotation, addRotation, checkFinite, clone, createExplosion, createExplosion, createExplosion, createExplosion, createExplosion, createExplosion, distance, distanceSquared, getBlock, getBlockX, getBlockY, getBlockZ, getChunk, getDirection, getNearbyEntities, getNearbyEntitiesByType, getNearbyEntitiesByType, getNearbyEntitiesByType, getNearbyEntitiesByType, getNearbyEntitiesByType, getNearbyEntitiesByType, getNearbyLivingEntities, getNearbyLivingEntities, getNearbyLivingEntities, getNearbyLivingEntities, getNearbyLivingEntities, getNearbyLivingEntities, getNearbyPlayers, getNearbyPlayers, getNearbyPlayers, getNearbyPlayers, getNearbyPlayers, getNearbyPlayers, getPitch, getRotation, getX, getY, getYaw, getZ, isChunkLoaded, isFinite, isGenerated, isWorldLoaded, length, lengthSquared, locToBlock, multiply, normalizePitch, normalizeYaw, set, setDirection, setPitch, setRotation, setRotation, setX, setY, setYaw, setZ, subtract, subtract, subtract, subtract, subtractRotation, subtractRotation, toBlockKey, toBlockLocation, toCenterLocation, toHighestLocation, toHighestLocation, toLocation, toVector, x, y, z, zero
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.papermc.paper.math.FinePosition
blockX, blockY, blockZ, isBlock, isFine, offset, offset, toBlock
Methods inherited from interface io.papermc.paper.math.Position
toCenter
-
Constructor Details
-
RespawnLocation
public RespawnLocation(@Nullable String worldName, double x, double y, double z, @NotNull RespawnLocation.RespawnLocationType respawnType) -
RespawnLocation
public RespawnLocation(@Nullable String worldName, double x, double y, double z, float yaw, float pitch, @NotNull RespawnLocation.RespawnLocationType respawnType) -
RespawnLocation
public RespawnLocation(@Nullable org.bukkit.World world, double x, double y, double z, @NotNull RespawnLocation.RespawnLocationType respawnType) -
RespawnLocation
public RespawnLocation(@Nullable org.bukkit.World world, double x, double y, double z, float yaw, float pitch, @NotNull RespawnLocation.RespawnLocationType respawnType) -
RespawnLocation
public RespawnLocation(@NotNull org.bukkit.Location location, @NotNull RespawnLocation.RespawnLocationType respawnType)
-
-
Method Details
-
toBukkitLocation
public org.bukkit.Location toBukkitLocation()Makes a bukkitLocation
copy from this SpawnLocation.- Returns:
- The bukkit location
-
setWorldName
-
getWorldName
-
setWorld
public void setWorld(@Nullable org.bukkit.World world) - Overrides:
setWorld
in classorg.bukkit.Location
-
getWorld
@Nullable public org.bukkit.World getWorld()- Overrides:
getWorld
in classorg.bukkit.Location
-
serialize
- Specified by:
serialize
in interfaceorg.bukkit.configuration.serialization.ConfigurationSerializable
- Overrides:
serialize
in classorg.bukkit.Location
-
deserialize
Required method for deserialization- Parameters:
args
- map to deserialize- Returns:
- deserialized location
- Throws:
IllegalArgumentException
- if the world don't exists- See Also:
-
equals
- Overrides:
equals
in classorg.bukkit.Location
-
hashCode
public int hashCode()- Overrides:
hashCode
in classorg.bukkit.Location
-
toString
- Overrides:
toString
in classorg.bukkit.Location
-
isValidRespawnLocation
@AvailableSince("5.2") public boolean isValidRespawnLocation()Checks if the respawn location is valid based on the respawn type.
ForRespawnLocation.RespawnLocationType.BED
, checks if the block at the location is a bed block.
ForRespawnLocation.RespawnLocationType.ANCHOR
, checks if the block at the location is a respawn anchor block.- Returns:
- true if the respawn location is valid, false otherwise.
-
getRespawnType
Gets the respawn location type.- Returns:
- the respawn location type
-
setRespawnType
@AvailableSince("5.2") public void setRespawnType(@NotNull RespawnLocation.RespawnLocationType respawnType) Sets the respawn location type.- Parameters:
respawnType
- the respawn location type
-