fix: use own methods in JSON constructor and add javadoc

This commit is contained in:
punchready 2021-07-01 11:28:01 +02:00
parent 07ade1696d
commit a289fee059
1 changed files with 4 additions and 4 deletions

View File

@ -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()