mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-03-10 08:50:52 -07:00
Patcher fixes
This commit is contained in:
parent
49bbd0b593
commit
45db096f0f
2 changed files with 6 additions and 0 deletions
|
|
@ -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(StatusEffect.class, (type, data) -> {
|
||||
if(data.isString()){
|
||||
|
|
|
|||
|
|
@ -242,6 +242,11 @@ public class ContentPatcher{
|
|||
|
||||
if(value instanceof JsonValue jsv){ //setting values from object
|
||||
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());
|
||||
try{
|
||||
setter.get(json.readValue(metadata.type, metadata.elementType, jsv));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue