9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-31 12:56:28 +00:00

增强generation的功能

This commit is contained in:
XiaoMoMi
2025-05-09 22:39:40 +08:00
parent d6a0817069
commit a705a8e8de
16 changed files with 295 additions and 44 deletions

View File

@@ -537,7 +537,7 @@ public class BukkitBlockManager extends AbstractBlockManager {
if (singleModelMap.containsKey("weight")) json.addProperty("weight", ResourceConfigUtils.getAsInt(singleModelMap.get("weight"), "weight"));
Map<String, Object> generationMap = MiscUtils.castToMap(singleModelMap.get("generation"), true);
if (generationMap != null) {
prepareModelGeneration(new ModelGeneration(Key.of(modelPath), generationMap));
prepareModelGeneration(ModelGeneration.of(Key.of(modelPath), generationMap));
}
variants.add(json);
}

View File

@@ -463,6 +463,12 @@ public class BukkitItemManager extends AbstractItemManager<ItemStack> {
baseModel.path(),
customModelData
));
} else if (currentModel instanceof SpecialItemModel specialModel) {
resultList.add(new LegacyOverridesModel(
new LinkedHashMap<>(accumulatedPredicates),
specialModel.base(),
customModelData
));
}
}