From e54ce32626f999ccc922888654f28492c92d8860 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Wed, 2 Jun 2021 16:29:24 +0200 Subject: [PATCH] fix: added missing name field to EntitySerializer --- .../gamelibrary/json/ingame/serialize/EntitySerializer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/serialize/EntitySerializer.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/serialize/EntitySerializer.java index 4576af5..ef70879 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/serialize/EntitySerializer.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/serialize/EntitySerializer.java @@ -25,10 +25,8 @@ public class EntitySerializer extends StdSerializer { gen.writeObjectField("entityType", SerializedEntityType.valueOf(value.id.type)); if (value instanceof NPC) { - System.out.println("instanceof NPC"); serializeNPC((NPC) value, gen, provider); } else if (value instanceof Character) { - System.out.println("instanceof Chara"); serializeCharacter((Character) value, gen, provider); } else if (value instanceof Rock) { serializeRock((Rock) value, gen, provider); @@ -50,6 +48,7 @@ public class EntitySerializer extends StdSerializer { private void serializeCharacter(Character value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeStringField("name", value.name); gen.writeNumberField("PID", value.id.type == EntityType.P1 ? 1 : 2); gen.writeNumberField("ID", value.id.id); gen.writeNumberField("HP", value.hp.getValue());