Fix more compile issues

This commit is contained in:
Nassim Jahnke
2024-04-25 21:40:53 +02:00
parent 09a83f66ee
commit b432863793
10 changed files with 31 additions and 25 deletions

View File

@@ -580,8 +580,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return CraftItemStack.getItemMeta(this.handle);
}
+ // Paper start
+ public static void applyMetaToItem(net.minecraft.world.item.ItemStack itemStack, ItemMeta meta) {
+ ((org.bukkit.craftbukkit.inventory.CraftMetaItem) meta).applyToItem(itemStack.getOrCreateTag());
+ public static void applyMetaToItem(net.minecraft.world.item.ItemStack itemStack, ItemMeta itemMeta) {
+ final CraftMetaItem.Applicator tag = new CraftMetaItem.Applicator();
+ ((CraftMetaItem) itemMeta).applyToItem(tag);
+ itemStack.applyComponents(tag.build());
+ }
public static ItemMeta getItemMeta(net.minecraft.world.item.ItemStack item) {