From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Taiyou06 Date: Tue, 26 Nov 2024 19:58:29 -0500 Subject: [PATCH] Remove stream in matchingSlot diff --git a/src/main/java/net/minecraft/world/item/enchantment/Enchantment.java b/src/main/java/net/minecraft/world/item/enchantment/Enchantment.java index 161990842f19fc123fd9feca7231afec83802f47..31e8be9a5f7bb94841c609341e4daf81449acc3c 100644 --- a/src/main/java/net/minecraft/world/item/enchantment/Enchantment.java +++ b/src/main/java/net/minecraft/world/item/enchantment/Enchantment.java @@ -126,7 +126,15 @@ public record Enchantment(Component description, Enchantment.EnchantmentDefiniti } public boolean matchingSlot(EquipmentSlot slot) { - return this.definition.slots().stream().anyMatch(slotx -> slotx.test(slot)); + // Leaf start - Remove stream in matchingSlot + for (EquipmentSlotGroup slotx : this.definition.slots()) { + if (slotx.test(slot)) { + return true; + } + } + + return false; + // Leaf end - Remove stream in matchingSlot } public boolean isPrimaryItem(ItemStack stack) {