fix: use own methods in JSON constructor and add javadoc
This commit is contained in:
parent
07ade1696d
commit
a289fee059
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user