This repository has been archived on 2020-06-16. You can view files and clone it, but cannot push or open issues or pull requests.
2019-05-27 06:14:20 +00:00
|
|
|
package party._2a03.server;
|
|
|
|
|
2019-06-02 02:53:35 +00:00
|
|
|
import org.json.JSONArray;
|
|
|
|
import net.minecraft.world.ServerWorld;
|
|
|
|
|
2019-05-27 06:14:20 +00:00
|
|
|
public class PlayerPosition {
|
|
|
|
public double x;
|
|
|
|
public double y;
|
|
|
|
public double z;
|
|
|
|
public float yaw;
|
|
|
|
public float pitch;
|
2019-06-02 02:53:35 +00:00
|
|
|
public ServerWorld world;
|
|
|
|
|
|
|
|
public PlayerPosition() {
|
|
|
|
}
|
2019-06-01 03:39:51 +00:00
|
|
|
|
2019-06-02 02:53:35 +00:00
|
|
|
public PlayerPosition(double p_x, double p_y, double p_z, float p_yaw, float p_pitch, ServerWorld p_world) {
|
2019-05-27 06:14:20 +00:00
|
|
|
this.x = p_x;
|
|
|
|
this.y = p_y;
|
|
|
|
this.z = p_z;
|
|
|
|
this.yaw = p_yaw;
|
|
|
|
this.pitch = p_pitch;
|
2019-06-02 02:53:35 +00:00
|
|
|
this.world = p_world;
|
|
|
|
}
|
|
|
|
|
|
|
|
public JSONArray getJSON() {
|
|
|
|
JSONArray json = new JSONArray();
|
|
|
|
if (this.world != null) {
|
|
|
|
json.put(this.x);
|
|
|
|
json.put(this.y);
|
|
|
|
json.put(this.z);
|
|
|
|
json.put(this.yaw);
|
|
|
|
json.put(this.pitch);
|
|
|
|
json.put(this.world.field_73011_w.func_186058_p().func_186068_a());
|
|
|
|
} else {
|
|
|
|
json.put(-2);
|
|
|
|
json.put(-2);
|
|
|
|
json.put(-2);
|
|
|
|
json.put(-2);
|
|
|
|
json.put(-2);
|
|
|
|
json.put(-2);
|
|
|
|
}
|
|
|
|
return json;
|
2019-05-27 06:14:20 +00:00
|
|
|
}
|
|
|
|
}
|