Patcher fixes
This commit is contained in:
@@ -97,6 +97,7 @@ public class ContentParser{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
put(TextureRegion.class, (type, data) -> Core.atlas.find(data.asString()));
|
||||||
put(Color.class, (type, data) -> Color.valueOf(data.asString()));
|
put(Color.class, (type, data) -> Color.valueOf(data.asString()));
|
||||||
put(StatusEffect.class, (type, data) -> {
|
put(StatusEffect.class, (type, data) -> {
|
||||||
if(data.isString()){
|
if(data.isString()){
|
||||||
|
|||||||
@@ -242,6 +242,11 @@ public class ContentPatcher{
|
|||||||
|
|
||||||
if(value instanceof JsonValue jsv){ //setting values from object
|
if(value instanceof JsonValue jsv){ //setting values from object
|
||||||
if(prevValue == null || !jsv.isObject() || jsv.has("type")){
|
if(prevValue == null || !jsv.isObject() || jsv.has("type")){
|
||||||
|
if(UnlockableContent.class.isAssignableFrom(metadata.type) && (jsv.isObject())){
|
||||||
|
warn("New content must not be instantiated: @", jsv);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(modify) modifiedField(object, field, getter.get());
|
if(modify) modifiedField(object, field, getter.get());
|
||||||
try{
|
try{
|
||||||
setter.get(json.readValue(metadata.type, metadata.elementType, jsv));
|
setter.get(json.readValue(metadata.type, metadata.elementType, jsv));
|
||||||
|
|||||||
Reference in New Issue
Block a user