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 e2a928b0271a280debe684f09c6ed8c7655aa4a2..bcec7370b875e403ffd4cec179ba07d80b1bc3a0 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) {