flewkey
/
mc.2a03.party
Archived
1
0
Fork 0

Remove useless whitespace

This commit is contained in:
flewkey 2019-05-31 20:39:51 -07:00
parent fb3d6e9a01
commit 92ad68af24
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E
3 changed files with 10 additions and 10 deletions

View File

@ -15,7 +15,7 @@ import party._2a03.server.PlayerPosition;
public class Config { public class Config {
private static JSONObject json; private static JSONObject json;
private static final Logger logger = LogManager.getLogger(); private static final Logger logger = LogManager.getLogger();
public static void loadConfig() throws Exception { public static void loadConfig() throws Exception {
logger.info("Loading 2a03.party configuration"); logger.info("Loading 2a03.party configuration");
File f = new File("2a03.json"); File f = new File("2a03.json");
@ -28,7 +28,7 @@ public class Config {
} }
logger.info("Configuration loaded"); logger.info("Configuration loaded");
} }
public static PlayerData getPlayer(String uuid) { public static PlayerData getPlayer(String uuid) {
JSONArray members = json.getJSONArray("members"); JSONArray members = json.getJSONArray("members");
JSONObject data = null; JSONObject data = null;
@ -44,7 +44,7 @@ public class Config {
} }
return new PlayerData(data); return new PlayerData(data);
} }
public static void setPlayer(PlayerData player) { public static void setPlayer(PlayerData player) {
JSONArray members = json.getJSONArray("members"); JSONArray members = json.getJSONArray("members");
int playerIndex = -1; int playerIndex = -1;
@ -62,7 +62,7 @@ public class Config {
json.put("members", members); json.put("members", members);
saveConfig(); saveConfig();
} }
public static PlayerPosition getPosition(String key) { public static PlayerPosition getPosition(String key) {
JSONArray data = json.getJSONArray(key); JSONArray data = json.getJSONArray(key);
double x = data.getDouble(0); double x = data.getDouble(0);
@ -72,7 +72,7 @@ public class Config {
float pitch = data.getFloat(4); float pitch = data.getFloat(4);
return new PlayerPosition((double)x, (double)y, (double)z, (float)yaw, (float)pitch); return new PlayerPosition((double)x, (double)y, (double)z, (float)yaw, (float)pitch);
} }
private static void saveConfig() { private static void saveConfig() {
try (FileWriter file = new FileWriter("2a03.json")) { try (FileWriter file = new FileWriter("2a03.json")) {
file.write(JSONObject.valueToString(json)); file.write(JSONObject.valueToString(json));

View File

@ -10,7 +10,7 @@ public class PlayerData {
public PlayerData(JSONObject p_json) { public PlayerData(JSONObject p_json) {
this.json = p_json; this.json = p_json;
} }
public PlayerPosition getHome() { public PlayerPosition getHome() {
JSONArray data = json.getJSONArray("home"); JSONArray data = json.getJSONArray("home");
double x = data.getDouble(0); double x = data.getDouble(0);
@ -20,11 +20,11 @@ public class PlayerData {
float pitch = data.getFloat(4); float pitch = data.getFloat(4);
return new PlayerPosition(x, y, z, yaw, pitch); return new PlayerPosition(x, y, z, yaw, pitch);
} }
public String getUUID() { public String getUUID() {
return json.getString("uuid"); return json.getString("uuid");
} }
public void setHome(PlayerPosition location) { public void setHome(PlayerPosition location) {
JSONArray locationArray = new JSONArray(); JSONArray locationArray = new JSONArray();
locationArray.put(location.x); locationArray.put(location.x);

View File

@ -6,8 +6,8 @@ public class PlayerPosition {
public double z; public double z;
public float yaw; public float yaw;
public float pitch; public float pitch;
public PlayerPosition(double p_x, double p_y, double p_z, float p_yaw, float p_pitch) { public PlayerPosition(double p_x, double p_y, double p_z, float p_yaw, float p_pitch, int world) {
this.x = p_x; this.x = p_x;
this.y = p_y; this.y = p_y;
this.z = p_z; this.z = p_z;