9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00

Remove stream in matchingSlot

This commit is contained in:
Dreeam
2024-11-29 17:57:26 -05:00
parent 11cb8d32ba
commit 0cf7aa045c

View File

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Taiyou06 <kaandindar21@gmail.com>
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) {