diff options
author | Nassim Jahnke <[email protected]> | 2024-06-15 18:28:18 +0200 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2024-06-15 18:31:58 +0200 |
commit | 4bc15f13aa210a361e2b163dd9e901b9129f3b17 (patch) | |
tree | 61d444ff67cb31b359b1a1c15d5f10bc6db36b96 /patches/server/0170-Add-ArmorStand-Item-Meta.patch | |
parent | 5d834b1b7136de9525dfa405cf6c466c62c3abc1 (diff) | |
download | Paper-4bc15f13aa210a361e2b163dd9e901b9129f3b17.tar.gz Paper-4bc15f13aa210a361e2b163dd9e901b9129f3b17.zip |
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
e2160a18 Make MapCursor#type not depends on deprecated values
CraftBukkit Changes:
6ce172642 SPIGOT-7761: Ender pearl does not damage or spawn endermites
f5a63f734 SPIGOT-7759: Chunk not there when requested in ChunkUnloadEvent
28287259c Remove unused import
eb9a7dde0 SPIGOT-7757: Cannot set item in Stonecutter Inventory
f8be9d752 Move deserialized removed unhandled tags to dedicated removedTags
a7e576186 Fix potential mutability issue with CraftMetaItem copy constructor
995885452 SPIGOT-7741: Vanilla ItemComponent in commands can't remove components
9ef69aa0b PR-1284: Move ItemType <-> ItemMeta linking to a centralized place
3e82eafbe PR-1420: Fix DirectEntity and CausingEntity Damager for Creepers ignited by Player
c23daa71f SPIGOT-7751: Fix crash caused by arrows from trial spawners
Make MapCursor#type not depends on deprecated values
SPIGOT-7761: Ender pearl does not damage or spawn endermites
Diffstat (limited to 'patches/server/0170-Add-ArmorStand-Item-Meta.patch')
-rw-r--r-- | patches/server/0170-Add-ArmorStand-Item-Meta.patch | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/patches/server/0170-Add-ArmorStand-Item-Meta.patch b/patches/server/0170-Add-ArmorStand-Item-Meta.patch index 345e7b4ffd..b6aa22ecaf 100644 --- a/patches/server/0170-Add-ArmorStand-Item-Meta.patch +++ b/patches/server/0170-Add-ArmorStand-Item-Meta.patch @@ -12,19 +12,26 @@ starting point for future additions in this area. Fixes GH-559 -diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java -index 3006a6d19de35e7e0d6e542e80eb0406c5422c3e..fc522ae106d1172172c496da543b8ca403e73456 100644 ---- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java -+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java -@@ -66,7 +66,7 @@ public class CraftItemType<M extends ItemMeta> implements ItemType.Typed<M>, Han - private Class<M> getItemMetaClass(Item item) { - ItemMeta meta = new ItemStack(this.asMaterial()).getItemMeta(); - if (meta != null) { -- if (CraftMetaEntityTag.class != meta.getClass() && CraftMetaArmorStand.class != meta.getClass()) { -+ if (CraftMetaEntityTag.class != meta.getClass()/* && CraftMetaArmorStand.class != meta.getClass()*/) { // Paper - CraftMetaArmorStand is implemented in the API via ArmorStandMeta. - return (Class<M>) meta.getClass().getInterfaces()[0]; - } - } +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemMetas.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemMetas.java +index 85aab880fdb2f23d09096f8f2b1ede4f068fa023..4ae9930c2d74e5b1e3ad0c2ecf6556dc59cbf23c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemMetas.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemMetas.java +@@ -1,5 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + ++import com.destroystokyo.paper.inventory.meta.ArmorStandMeta; + import java.util.function.BiFunction; + import java.util.function.Function; + import net.minecraft.world.item.ItemStack; +@@ -95,7 +96,7 @@ public final class CraftItemMetas { + item -> new CraftMetaSpawnEgg(item.getComponentsPatch()), + (type, meta) -> meta instanceof CraftMetaSpawnEgg spawnEgg ? spawnEgg : new CraftMetaSpawnEgg(meta)); + +- private static final ItemMetaData<ItemMeta> ARMOR_STAND_META_DATA = new ItemMetaData<>(ItemMeta.class, ++ private static final ItemMetaData<ArmorStandMeta> ARMOR_STAND_META_DATA = new ItemMetaData<>(ArmorStandMeta.class, // paper + item -> new CraftMetaArmorStand(item.getComponentsPatch()), + (type, meta) -> meta instanceof CraftMetaArmorStand armorStand ? armorStand : new CraftMetaArmorStand(meta)); + diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java index c4f12f96e39cb6189799a796b4cb2cb4f0b92392..59bdac414e8205ed608f79ef0d1502acd826d216 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java |