9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-25 18:09:27 +00:00

fix(item): 修复 Java组件设置中的潜在类型转换问题

This commit is contained in:
jhqwqmc
2025-06-24 00:09:38 +08:00
parent 2c06bbeb82
commit b38aa4b573

View File

@@ -92,7 +92,8 @@ public class ComponentItemWrapper implements ItemWrapper<ItemStack> {
}
public void setJavaComponent(Object type, Object value) {
setComponentInternal(type, MRegistryOps.JAVA, value);
setSparrowNBTComponent(type, MRegistryOps.JAVA.convertTo(MRegistryOps.SPARROW_NBT, value));
// setComponentInternal(type, MRegistryOps.JAVA, value); // 这里可能出现潜在的Integer和Boolean不区分问题
}
public void setJsonComponent(Object type, JsonElement value) {