Package io.github.emcw.map.entities
Class Location
java.lang.Object
io.github.emcw.map.entities.Location
- All Implemented Interfaces:
ISerializable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static @NotNull Location
fromObj
(com.google.gson.JsonObject obj) boolean
Whether this location points to the map center.protected static @NotNull Location
of
(com.google.gson.JsonObject obj) boolean
valid()
Check if this location is properly initialized.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.emcw.interfaces.ISerializable
asString
-
Constructor Details
-
Location
A location in 3D space.
- Parameters:
x
- The coordinate on the x-axis (left/right)z
- The coordinate on the z-axis (forward/backward)yaw
- I have no fucking clue
-
Location
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 forx != null && z != null;
-
isDefault
public boolean isDefault()Whether this location points to the map center. Shorthand forx == 0 && z == 0;
-
fromObj
@Contract("_ -> new") @NotNull protected static @NotNull Location fromObj(com.google.gson.JsonObject obj) -
of
-