diff --git a/patches/server/0092-Hide-specified-item-components-to-clients.patch b/patches/server/0093-Hide-specified-item-components-to-clients.patch similarity index 96% rename from patches/server/0092-Hide-specified-item-components-to-clients.patch rename to patches/server/0093-Hide-specified-item-components-to-clients.patch index d2d211563..477b26c2d 100644 --- a/patches/server/0092-Hide-specified-item-components-to-clients.patch +++ b/patches/server/0093-Hide-specified-item-components-to-clients.patch @@ -78,10 +78,10 @@ index 855fa46cbaaa22003f46e0e63292ad0824d23c86..60ef9bf2425a8d6d54cd59ae15f3f378 } } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 7c75298c8ea7a828c2d9cd4e7ffd4d09a0113aed..6036c1a6f61d6c8a220ed97166c8741ea1922ab4 100644 +index 8b0cd878d8bf633283b645dc06dfbb98c06e269f..bddfa152954b8ecdf5da233939f286f32e0b30e4 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3388,7 +3388,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3404,7 +3404,7 @@ public abstract class LivingEntity extends Entity implements Attackable { ItemStack itemstack1 = itemstack; ItemStack itemstack2 = this.getItemBySlot(enumitemslot); @@ -90,7 +90,7 @@ index 7c75298c8ea7a828c2d9cd4e7ffd4d09a0113aed..6036c1a6f61d6c8a220ed97166c8741e // Paper start - PlayerArmorChangeEvent if (this instanceof ServerPlayer && enumitemslot.getType() == EquipmentSlot.Type.HUMANOID_ARMOR) { final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack1); -@@ -3472,7 +3472,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3488,7 +3488,7 @@ public abstract class LivingEntity extends Entity implements Attackable { equipmentChanges.forEach((enumitemslot, itemstack) -> { ItemStack itemstack1 = itemstack.copy(); @@ -132,10 +132,10 @@ index c491291b522aebf34c7d990d2b485d1a0d19cdcd..267f638bb704002a30b1f5cb4e33b6a8 this.synchronizer.sendCarriedChange(this, this.remoteCarried); diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/HiddenItemComponents.java b/src/main/java/org/dreeam/leaf/config/modules/misc/HiddenItemComponents.java new file mode 100644 -index 0000000000000000000000000000000000000000..d1c1bbd246ff2ec4e78ef3230762f2747a5e315e +index 0000000000000000000000000000000000000000..5847c24e127cd71aa026610c15f416aeff06feef --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/misc/HiddenItemComponents.java -@@ -0,0 +1,43 @@ +@@ -0,0 +1,46 @@ +package org.dreeam.leaf.config.modules.misc; + +import net.minecraft.core.component.DataComponentType; @@ -167,7 +167,9 @@ index 0000000000000000000000000000000000000000..d1c1bbd246ff2ec4e78ef3230762f274 + Also, it can avoid some frequent client animations. + NOTICE: You must know what you're filling in and how it works! It will handle all itemStacks! + """); ++ + List> types = new ArrayList<>(list.size()); ++ + for (String id : list) { + // Find and check + DataComponentType type = BuiltInRegistries.DATA_COMPONENT_TYPE.get(ResourceLocation.parse(id)); @@ -175,16 +177,17 @@ index 0000000000000000000000000000000000000000..d1c1bbd246ff2ec4e78ef3230762f274 + types.add(type); + } else LeafConfig.LOGGER.warn("Unknown component type: {}", id); + } ++ + hiddenItemComponentTypes = types; + } + +} diff --git a/src/main/java/org/dreeam/leaf/util/item/ItemStackObfuscator.java b/src/main/java/org/dreeam/leaf/util/item/ItemStackObfuscator.java new file mode 100644 -index 0000000000000000000000000000000000000000..4130aaf0df48b6f17206059a3343419f6bfbc0fe +index 0000000000000000000000000000000000000000..55cc252829bff893e6b0f564f3399f06267f7b8e --- /dev/null +++ b/src/main/java/org/dreeam/leaf/util/item/ItemStackObfuscator.java -@@ -0,0 +1,31 @@ +@@ -0,0 +1,29 @@ +package org.dreeam.leaf.util.item; + +import net.minecraft.core.component.DataComponentType; @@ -195,7 +198,6 @@ index 0000000000000000000000000000000000000000..4130aaf0df48b6f17206059a3343419f + +public class ItemStackObfuscator { + -+ // Leaf start - Hide specified item components + public static ItemStack stripMeta(final ItemStack itemStack, final boolean copyItemStack) { + if (itemStack.isEmpty() || itemStack.getComponentsPatch().isEmpty()) return itemStack; + @@ -203,6 +205,7 @@ index 0000000000000000000000000000000000000000..4130aaf0df48b6f17206059a3343419f + + // Get the types which need to hide + List> hiddenTypes = HiddenItemComponents.hiddenItemComponentTypes; ++ + if (hiddenTypes.isEmpty()) return copy; + + // Remove specified types @@ -213,6 +216,4 @@ index 0000000000000000000000000000000000000000..4130aaf0df48b6f17206059a3343419f + + return copy; + } -+ // Leaf end - Hide specified item components -+ +}