mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
28 lines
1.2 KiB
Diff
28 lines
1.2 KiB
Diff
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/net/minecraft/world/item/enchantment/Enchantment.java b/net/minecraft/world/item/enchantment/Enchantment.java
|
|
index 7a620eb92b1e672cedd72ec4d986c01eba337686..183874d90d576d740c5d924accc5c0d7fdb8450c 100644
|
|
--- a/net/minecraft/world/item/enchantment/Enchantment.java
|
|
+++ b/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(equipmentSlotGroup -> equipmentSlotGroup.test(slot));
|
|
+ // Leaf start - Remove stream in matchingSlot
|
|
+ for (EquipmentSlotGroup equipmentSlotGroup : this.definition.slots()) {
|
|
+ if (equipmentSlotGroup.test(slot)) {
|
|
+ return true;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ return false;
|
|
+ // Leaf end - Remove stream in matchingSlot
|
|
}
|
|
|
|
public boolean isPrimaryItem(ItemStack stack) {
|