Class Position

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

public class Position extends Object implements YamlSerializable
An immutable and serializable Location object without the yaw or pitch.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull Position
    deserialize(@NotNull org.bukkit.configuration.ConfigurationSection section)
     
    static @NotNull Position
    of(@NotNull org.bukkit.Location loc)
     
    void
    serialize(@NotNull org.bukkit.configuration.ConfigurationSection section)
    Serializes the object into the configuration section.
    @NotNull org.bukkit.Location
    Converts the position to a Bukkit Location.

    Methods inherited from class java.lang.Object

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

    • Position

      public Position()
  • Method Details

    • of

      @NotNull public static @NotNull Position of(@NotNull @NotNull org.bukkit.Location loc)
    • 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 Position deserialize(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section)
    • toLocation

      @NotNull public @NotNull org.bukkit.Location toLocation()
      Converts the position to a Bukkit Location.
      Returns:
      The Bukkit Location