|
@@ -21,12 +21,16 @@ package de.butzlabben.missilewars.configuration.arena;
|
|
|
import com.google.gson.annotations.SerializedName;
|
|
|
import de.butzlabben.missilewars.util.geometry.FlatArea;
|
|
|
import de.butzlabben.missilewars.util.geometry.Plane;
|
|
|
+import de.butzlabben.missilewars.util.serialization.Serializer;
|
|
|
import lombok.Getter;
|
|
|
import lombok.Setter;
|
|
|
import lombok.ToString;
|
|
|
import org.bukkit.Location;
|
|
|
import org.bukkit.util.Vector;
|
|
|
|
|
|
+import java.io.File;
|
|
|
+import java.io.IOException;
|
|
|
+
|
|
|
@Getter
|
|
|
@ToString
|
|
|
public class Arena implements Cloneable {
|
|
@@ -65,6 +69,8 @@ public class Arena implements Cloneable {
|
|
|
@SerializedName("team2_spawn")
|
|
|
@Setter
|
|
|
private Location team2Spawn = new Location(null, 0.5, 100, -45.5, 0, 0);
|
|
|
+
|
|
|
+ @Setter private transient File file;
|
|
|
|
|
|
public Arena() {
|
|
|
|
|
@@ -102,4 +108,12 @@ public class Arena implements Cloneable {
|
|
|
throw new AssertionError();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void updateConfig() {
|
|
|
+ try {
|
|
|
+ Serializer.serialize(file, this);
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|