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 Classes
    Modifier and Type
    Class
    Description
    static enum 
    The type of respawn location.
  • Field Summary

    Fields inherited from interface io.papermc.paper.math.Position

    BLOCK_ZERO, FINE_ZERO
  • Constructor Summary

    Constructors
    Constructor
    Description
    RespawnLocation(@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 Type
    Method
    Description
    static @NotNull org.bukkit.Location
    deserialize(@NotNull Map<String,Object> args)
    Required method for deserialization
    boolean
     
    Gets the respawn location type.
    int
     
    boolean
    Checks if the respawn location is valid based on the respawn type.
    @NotNull Map<String,Object>
     
    void
    Sets the respawn location type.
     

    Methods inherited from class org.mvplugins.multiverse.core.world.location.UnloadedWorldLocation

    fromLocation, getWorld, getWorldName, setWorld, setWorldName, toBukkitLocation

    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 @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

      @NotNull public @NotNull Map<String,Object> serialize()
      Specified by:
      serialize in interface org.bukkit.configuration.serialization.ConfigurationSerializable
      Overrides:
      serialize in class org.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:
      • ConfigurationSerializable
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class org.mvplugins.multiverse.core.world.location.UnloadedWorldLocation
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class org.mvplugins.multiverse.core.world.location.UnloadedWorldLocation
    • toString

      public String toString()
      Overrides:
      toString in class org.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.
      For RespawnLocation.RespawnLocationType.BED, checks if the block at the location is a bed block.
      For RespawnLocation.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