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

纠正创建原版物品itemstack

This commit is contained in:
XiaoMoMi
2025-08-13 21:42:32 +08:00
parent 8ae2ad83e8
commit fee3d2f1ac
2 changed files with 2 additions and 11 deletions

View File

@@ -365,9 +365,10 @@ public class BukkitItemManager extends AbstractItemManager<ItemStack> {
return null;
}
@Nullable
private ItemStack createVanillaItemStack(Key id) {
Object item = FastNMS.INSTANCE.method$Registry$getValue(MBuiltInRegistries.ITEM, KeyUtils.toResourceLocation(id));
if (item == null) {
if (item == null || item == MItems.AIR) {
return null;
}
return FastNMS.INSTANCE.method$CraftItemStack$asCraftMirror(FastNMS.INSTANCE.constructor$ItemStack(item, 1));

View File

@@ -1,10 +0,0 @@
package net.momirealms.craftengine.bukkit.item.recipe;
import net.momirealms.craftengine.core.item.recipe.Recipe;
import net.momirealms.craftengine.core.util.Key;
import org.bukkit.inventory.ItemStack;
public interface BukkitRecipeConvertor<T extends Recipe<ItemStack>> {
Runnable convert(Key id, T recipe);
}