Class Position

java.lang.Object
me.hsgamer.hscore.bukkit.config.object.Position

public final class Position extends Object
a wrapper class for Location.
  • Constructor Details

    • Position

      public Position(@NotNull @NotNull String world, double x, double y, double z, float yaw, float pitch)
      ctor.
      Parameters:
      world - the world.
      x - the x.
      y - the y.
      z - the z.
      yaw - the yaw.
      pitch - the pitch.
  • Method Details

    • deserialize

      @NotNull public static @NotNull Position deserialize(@NotNull @NotNull Map<String,Object> map)
      converts the given map into a new instance of this.
      Parameters:
      map - map to deserialize.
      Returns:
      deserialized this instance.
      Throws:
      NullPointerException - if the given map has not world, x, y, z, yaw, pitch keys.
      ClassCastException - if the given map values contain wrong type of value for Position(String, double, double, double, float, float)
    • get

      @NotNull public @NotNull org.bukkit.Location get()
      converts this class's values into a Location.
      Returns:
      a new Location instance.
      Throws:
      NullPointerException - if the world world is not found in the server.
    • serialize

      @NotNull public @NotNull Map<String,Object> serialize()
      converts this class's values into a map.
      Returns:
      a serialized map.