Class RespawnLocation
java.lang.Object
org.bukkit.Location
org.mvplugins.multiverse.core.world.location.UnloadedWorldLocation
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.mvplugins.multiverse.core.world.location.UnloadedWorldLocation
Location information with respawn type. See also
RespawnLocation.RespawnLocationType.-
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(@Nullable String worldName, double x, double y, double z, float yaw, float pitch, @NotNull RespawnLocation.RespawnLocationType respawnType) RespawnLocation(@Nullable String worldName, double x, double y, double z, @NotNull RespawnLocation.RespawnLocationType respawnType) RespawnLocation(@NotNull org.bukkit.Location location, @NotNull RespawnLocation.RespawnLocationType respawnType) RespawnLocation(@Nullable org.bukkit.World world, double x, double y, double z, float yaw, float pitch, @NotNull RespawnLocation.RespawnLocationType respawnType) RespawnLocation(@Nullable org.bukkit.World world, double x, double y, double z, @NotNull RespawnLocation.RespawnLocationType respawnType) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull org.bukkit.Locationdeserialize(@NotNull Map<String, Object> args) Required method for deserializationboolean@NotNull RespawnLocation.RespawnLocationTypeGets the respawn location type.inthashCode()booleanChecks if the respawn location is valid based on the respawn type.voidsetRespawnType(@NotNull RespawnLocation.RespawnLocationType respawnType) Sets the respawn location type.toString()Methods inherited from class org.mvplugins.multiverse.core.world.location.UnloadedWorldLocation
fromLocation, getWorld, getWorldName, setWorld, setWorldName, toBukkitLocationMethods 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 @Nullable String worldName, double x, double y, double z, @NotNull @NotNull RespawnLocation.RespawnLocationType respawnType) -
RespawnLocation
public RespawnLocation(@Nullable @Nullable String worldName, double x, double y, double z, float yaw, float pitch, @NotNull @NotNull RespawnLocation.RespawnLocationType respawnType) -
RespawnLocation
public RespawnLocation(@Nullable @Nullable org.bukkit.World world, double x, double y, double z, @NotNull @NotNull RespawnLocation.RespawnLocationType respawnType) -
RespawnLocation
public RespawnLocation(@Nullable @Nullable org.bukkit.World world, double x, double y, double z, float yaw, float pitch, @NotNull @NotNull RespawnLocation.RespawnLocationType respawnType) -
RespawnLocation
public RespawnLocation(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull RespawnLocation.RespawnLocationType respawnType)
-
-
Method Details
-
serialize
- Specified by:
serializein interfaceorg.bukkit.configuration.serialization.ConfigurationSerializable- Overrides:
serializein classorg.mvplugins.multiverse.core.world.location.UnloadedWorldLocation
-
deserialize
@NotNull public static @NotNull org.bukkit.Location deserialize(@NotNull @NotNull Map<String, Object> args) 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.mvplugins.multiverse.core.world.location.UnloadedWorldLocation
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.mvplugins.multiverse.core.world.location.UnloadedWorldLocation
-
toString
- Overrides:
toStringin classorg.mvplugins.multiverse.core.world.location.UnloadedWorldLocation
-
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
@AvailableSince("5.2") @NotNull public @NotNull RespawnLocation.RespawnLocationType getRespawnType()Gets the respawn location type.- Returns:
- the respawn location type
-
setRespawnType
@AvailableSince("5.2") public void setRespawnType(@NotNull @NotNull RespawnLocation.RespawnLocationType respawnType) Sets the respawn location type.- Parameters:
respawnType- the respawn location type
-