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 enumThe 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.Locationdeserialize(Map<String, Object> args) Required method for deserializationbooleanGets the respawn location type.org.bukkit.WorldgetWorld()inthashCode()booleanChecks if the respawn location is valid based on the respawn type.voidsetRespawnType(RespawnLocation.RespawnLocationType respawnType) Sets the respawn location type.voidsetWorld(org.bukkit.World world) voidsetWorldName(String worldName) org.bukkit.LocationMakes a bukkitLocationcopy 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, zeroMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.papermc.paper.math.FinePosition
blockX, blockY, blockZ, isBlock, isFine, offset, offset, toBlockMethods 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 bukkitLocationcopy from this SpawnLocation.- Returns:
- The bukkit location
-
setWorldName
-
getWorldName
-
setWorld
public void setWorld(@Nullable org.bukkit.World world) - Overrides:
setWorldin classorg.bukkit.Location
-
getWorld
@Nullable public org.bukkit.World getWorld()- Overrides:
getWorldin classorg.bukkit.Location
-
serialize
- Specified by:
serializein interfaceorg.bukkit.configuration.serialization.ConfigurationSerializable- Overrides:
serializein 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:
equalsin classorg.bukkit.Location
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.bukkit.Location
-
toString
- Overrides:
toStringin 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
-