Browse Source

Remove useless whitespace

master
flewkey 3 years ago
parent
commit
92ad68af24
Signed by: flewkey GPG Key ID: 94F56ADFD848851E
  1. 10
      src/party/_2a03/server/Config.java
  2. 6
      src/party/_2a03/server/PlayerData.java
  3. 4
      src/party/_2a03/server/PlayerPosition.java

10
src/party/_2a03/server/Config.java

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

6
src/party/_2a03/server/PlayerData.java

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

4
src/party/_2a03/server/PlayerPosition.java

@ -6,8 +6,8 @@ public class PlayerPosition {
public double z;
public float yaw;
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.y = p_y;
this.z = p_z;