Updated to v2 (includes afk/vanished info)
This commit is contained in:
@@ -17,9 +17,10 @@ import com.redstoner.annotations.Version;
|
||||
import com.redstoner.misc.JsonManager;
|
||||
import com.redstoner.misc.Main;
|
||||
import com.redstoner.modules.Module;
|
||||
import com.redstoner.modules.datamanager.DataManager;
|
||||
|
||||
@AutoRegisterListener
|
||||
@Version(major = 4, minor = 0, revision = 2, compatible = 4)
|
||||
@Version(major = 4, minor = 0, revision = 3, compatible = 4)
|
||||
@SuppressWarnings("unchecked")
|
||||
public class OnlinePlayers implements Module, Listener
|
||||
{
|
||||
@@ -33,7 +34,7 @@ public class OnlinePlayers implements Module, Listener
|
||||
saveFile = new File(Main.plugin.getDataFolder(), "players.json");
|
||||
output = new JSONObject();
|
||||
players = new JSONArray();
|
||||
output.put("dataFormat", "v1");
|
||||
output.put("dataFormat", "v2");
|
||||
rescan();
|
||||
}
|
||||
|
||||
@@ -63,6 +64,8 @@ public class OnlinePlayers implements Module, Listener
|
||||
jsonPlayer.put("name", player.getName());
|
||||
jsonPlayer.put("UUID", player.getUniqueId().toString());
|
||||
jsonPlayer.put("joined", System.currentTimeMillis());
|
||||
jsonPlayer.put("vanished", DataManager.getState(player, "vanished"));
|
||||
jsonPlayer.put("afk", DataManager.getState(player, "afk"));
|
||||
players.add(jsonPlayer);
|
||||
save();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user