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

改进模型读取

This commit is contained in:
XiaoMoMi
2025-05-18 18:00:15 +08:00
parent eba3188c82
commit 11ab46bc8e
5 changed files with 114 additions and 25 deletions

View File

@@ -56,7 +56,6 @@ public class BukkitItemManager extends AbstractItemManager<ItemStack> {
private final DebugStickListener debugStickListener;
private final ArmorEventListener armorEventListener;
public BukkitItemManager(BukkitCraftEngine plugin) {
super(plugin);
instance = this;
@@ -131,7 +130,7 @@ public class BukkitItemManager extends AbstractItemManager<ItemStack> {
@Override
public Optional<BuildableItem<ItemStack>> getVanillaItem(Key key) {
Material material = Registry.MATERIAL.get(Objects.requireNonNull(NamespacedKey.fromString(key.toString())));
Material material = Registry.MATERIAL.get(KeyUtils.toNamespacedKey(key));
if (material == null) {
return Optional.empty();
}