diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/JSON.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/JSON.java index 1cc8fff..34ad890 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/JSON.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/JSON.java @@ -94,10 +94,7 @@ public class JSON { private final ObjectMapper mapper = new ObjectMapper(); public JSON (CharacterConfig config) { - // add the config to the mappers InjectableValues, where it is later accessed by the EntityDeserializer - this.mapper.setInjectableValues(new InjectableValues - .Std() - .addValue("CharacterConfig", config)); + setCharacterConfig(config); } /** Deserializes an incoming network message into a {@link EventMessage}. @@ -132,6 +129,9 @@ public class JSON { } } + /** + * Sets the {@link CharacterConfig} to be used during deserialization of Entities. + */ public void setCharacterConfig(CharacterConfig config) { this.mapper.setInjectableValues(new InjectableValues .Std()