From d9f905d957756aecbc4446bed7e12f84492f4976 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 2 Jan 2026 14:24:49 +0100 Subject: [PATCH] Fix Kits Signed-off-by: Chaoscaot --- .../utils/ReflectionWrapper21.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java index 3b9f901d..ae461357 100644 --- a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java +++ b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java @@ -19,11 +19,27 @@ package de.steamwar.fightsystem.utils; +import io.papermc.paper.datacomponent.DataComponentType; import io.papermc.paper.datacomponent.DataComponentTypes; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import java.util.HashSet; +import java.util.Set; + public class ReflectionWrapper21 implements ReflectionWrapper { + private static final Set FORBIDDEN_TYPES = new HashSet<>(); + + static { + FORBIDDEN_TYPES.add(DataComponentTypes.CUSTOM_NAME); + FORBIDDEN_TYPES.add(DataComponentTypes.PROFILE); + FORBIDDEN_TYPES.add(DataComponentTypes.UNBREAKABLE); + FORBIDDEN_TYPES.add(DataComponentTypes.BLOCK_DATA); + FORBIDDEN_TYPES.add(DataComponentTypes.BLOCKS_ATTACKS); + FORBIDDEN_TYPES.add(DataComponentTypes.BUNDLE_CONTENTS); + FORBIDDEN_TYPES.add(DataComponentTypes.CUSTOM_MODEL_DATA); + } + @Override public Object explosionHider(Player player, Object packet, PacketHiderFunction packetHiderFunction) { return packet; @@ -31,6 +47,9 @@ public class ReflectionWrapper21 implements ReflectionWrapper { @Override public boolean hasItems(ItemStack stack) { - return stack.getDataTypes().stream().anyMatch(dataComponentType -> dataComponentType != DataComponentTypes.ENCHANTMENTS); + return stack.getDataTypes().stream().filter(FORBIDDEN_TYPES::contains).allMatch(dataComponentType -> { + System.out.println(dataComponentType); + return true; + }); } }