Class Vector3d

java.lang.Object
dev.demeng.pluginbase.model.Vector3d
All Implemented Interfaces:
YamlSerializable

public class Vector3d extends Object implements YamlSerializable
An immutable and serializable 3D vector.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull Vector3d
    deserialize(@NotNull org.bukkit.configuration.ConfigurationSection section)
     
    static @NotNull Vector3d
    of(@NotNull org.bukkit.Location loc)
     
    static @NotNull Vector3d
    of(@NotNull org.bukkit.util.Vector vector)
     
    void
    serialize(@NotNull org.bukkit.configuration.ConfigurationSection section)
    Serializes the object into the configuration section.
    @NotNull org.bukkit.util.Vector
    Converts the 3D vector to a Bukkit Vector.
    @NotNull org.bukkit.Location
    toLocation(@Nullable org.bukkit.World world)
    Converts the 3D vector to a Bukkit Location.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Vector3d

      public Vector3d()
  • Method Details

    • of

      @NotNull public static @NotNull Vector3d of(@NotNull @NotNull org.bukkit.Location loc)
    • of

      @NotNull public static @NotNull Vector3d of(@NotNull @NotNull org.bukkit.util.Vector vector)
    • serialize

      public void serialize(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section)
      Description copied from interface: YamlSerializable
      Serializes the object into the configuration section. The configuration file is not saved after serialization.
      Specified by:
      serialize in interface YamlSerializable
      Parameters:
      section - The section the object will be serialized into
    • deserialize

      @NotNull public static @NotNull Vector3d deserialize(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section)
    • toLocation

      @NotNull public @NotNull org.bukkit.Location toLocation(@Nullable @Nullable org.bukkit.World world)
      Converts the 3D vector to a Bukkit Location.
      Parameters:
      world - The world
      Returns:
      The Bukkit Location
    • toBukkitVector

      @NotNull public @NotNull org.bukkit.util.Vector toBukkitVector()
      Converts the 3D vector to a Bukkit Vector.
      Returns:
      The Bukkit Vector