More more compile fixes

This commit is contained in:
Nassim Jahnke
2024-04-25 22:34:46 +02:00
parent b432863793
commit ca25aa1859
12 changed files with 47 additions and 27 deletions

View File

@ -15,12 +15,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - with type
+ @Override
+ public ItemStack withType(final Material type) {
+ if (type == Material.AIR) return CraftItemStack.asCraftMirror(null);
+ if (type == Material.AIR) {
+ return CraftItemStack.asCraftMirror(null);
+ }
+
+ final net.minecraft.world.item.ItemStack copy = new net.minecraft.world.item.ItemStack(
+ CraftItemType.bukkitToMinecraft(type), this.getAmount()
+ );
+ if (this.handle != null && this.handle.getTag() != null) copy.setTag(this.handle.getTag().copy());
+
+ if (this.handle != null) {
+ copy.applyComponents(this.handle.getComponents());
+ }
+
+ final CraftItemStack mirrored = CraftItemStack.asCraftMirror(copy);
+ mirrored.setItemMeta(mirrored.getItemMeta());