Fixed #11471
This commit is contained in:
@@ -399,7 +399,9 @@ public class ContentParser{
|
|||||||
T t = internalRead(type, elementType, jsonData, keyType);
|
T t = internalRead(type, elementType, jsonData, keyType);
|
||||||
if(t != null && !Reflect.isWrapper(t.getClass()) && (type == null || !type.isPrimitive())){
|
if(t != null && !Reflect.isWrapper(t.getClass()) && (type == null || !type.isPrimitive())){
|
||||||
checkNullFields(t);
|
checkNullFields(t);
|
||||||
listeners.each(hook -> hook.parsed(type, jsonData, t));
|
if(jsonData.isObject()){
|
||||||
|
listeners.each(hook -> hook.parsed(type, jsonData, t));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,6 +129,13 @@ public class DataPatcher{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void created(Object object, Object parent){
|
void created(Object object, Object parent){
|
||||||
|
if(object instanceof Weapon weapon){
|
||||||
|
weapon.init();
|
||||||
|
}else if(object instanceof Content cont){
|
||||||
|
cont.init();
|
||||||
|
cont.postInit();
|
||||||
|
}
|
||||||
|
|
||||||
if(!Vars.headless){
|
if(!Vars.headless){
|
||||||
if(object instanceof DrawPart part && parent instanceof MappableContent cont){
|
if(object instanceof DrawPart part && parent instanceof MappableContent cont){
|
||||||
part.load(cont.name);
|
part.load(cont.name);
|
||||||
@@ -138,16 +145,9 @@ public class DataPatcher{
|
|||||||
draw.load(block);
|
draw.load(block);
|
||||||
}else if(object instanceof Weapon weapon){
|
}else if(object instanceof Weapon weapon){
|
||||||
weapon.load();
|
weapon.load();
|
||||||
weapon.init();
|
|
||||||
}else if(object instanceof Content cont){
|
}else if(object instanceof Content cont){
|
||||||
cont.init();
|
|
||||||
cont.postInit();
|
|
||||||
cont.load();
|
cont.load();
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
if(object instanceof Weapon weapon){
|
|
||||||
weapon.init();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user