mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +01:00
MVWorld.toString() now outputs JSON data.
This commit is contained in:
parent
271e5f339e
commit
6a4921d7d1
@ -39,6 +39,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.permissions.Permission;
|
import org.bukkit.permissions.Permission;
|
||||||
import org.bukkit.permissions.PermissionDefault;
|
import org.bukkit.permissions.PermissionDefault;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
import org.json.simple.JSONObject;
|
||||||
|
|
||||||
import java.lang.ref.Reference;
|
import java.lang.ref.Reference;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
@ -1397,11 +1398,13 @@ public class MVWorld extends SerializationConfig implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder toStringBuilder = new StringBuilder();
|
final JSONObject jsonData = new JSONObject();
|
||||||
toStringBuilder.append(this.getClass().getSimpleName());
|
jsonData.put("Name", getName());
|
||||||
toStringBuilder.append('@');
|
jsonData.put("Env", getEnvironment().toString());
|
||||||
toStringBuilder.append(this.hashCode());
|
jsonData.put("Type", getWorldType().toString());
|
||||||
toStringBuilder.append(" (Name: '").append(this.getName()).append("')");
|
jsonData.put("Gen", getGenerator());
|
||||||
return toStringBuilder.toString();
|
final JSONObject topLevel = new JSONObject();
|
||||||
|
topLevel.put(getClass().getSimpleName() + "@" + hashCode(), jsonData);
|
||||||
|
return topLevel.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user