Class Location

java.lang.Object
io.github.emcw.map.entities.Location
All Implemented Interfaces:
ISerializable

public class Location extends Object implements ISerializable
  • Constructor Details

    • Location

      public Location(Integer x, Integer y, Integer z)

      A location in 3D space.

      Parameters:
      x - The coordinate on the x-axis (left/right)
      y - The coordinate on the y-axis (up/down)
      z - The coordinate on the z-axis (forward/backward)
    • Location

      public Location(Integer x, Integer z)

      A location in 2D space.

      Parameters:
      x - The coordinate on the x-axis (left/right)
      z - The coordinate on the z-axis (up/down)
    • Location

      public Location()

      Default location representing 0, 64, 0.

  • Method Details

    • valid

      public boolean valid()
      Check if this location is properly initialized.
      Shorthand for x != null && z != null;
    • isDefault

      public boolean isDefault()
      Whether this location points to the map center. Shorthand for x == 0 && z == 0;
    • fromObj

      @Contract("_ -> new") @NotNull protected static @NotNull Location fromObj(com.google.gson.JsonObject obj)
    • of

      @NotNull protected static @NotNull Location of(com.google.gson.JsonObject obj)