Included document id in player status config

This commit is contained in:
kuroppoi 2021-04-19 14:51:37 +02:00
parent 0c2de4136d
commit 8249fe69cd
2 changed files with 12 additions and 1 deletions

View file

@ -128,7 +128,6 @@ public abstract class Entity {
*/
public Map<String, Object> getStatusConfig() {
Map<String, Object> config = new HashMap<>();
//config.put("id", documentId); TODO figure out if this is actually necessary for non-player entities
config.put("name", name);
config.put("h", health);
return config;

View file

@ -127,6 +127,18 @@ public class Player extends Entity implements CommandExecutor {
sendMessage(new HealthMessage(health));
}
/**
* @return A {@link Map} containing all the data necessary for use in {@link EntityStatusMessage}.
*/
@Override
public Map<String, Object> getStatusConfig() {
Map<String, Object> config = new HashMap<>();
config.put("id", documentId);
config.put("name", name);
config.put("h", health);
return config;
}
/**
* Called by {@link Zone#addEntity(Entity)} when the player is added to it.
*/