mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-20 15:39:37 +00:00
Remove stream in matchingSlot
This commit is contained in:
27
patches/server/0104-Remove-stream-in-matchingSlot.patch
Normal file
27
patches/server/0104-Remove-stream-in-matchingSlot.patch
Normal 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) {
|
||||||
Reference in New Issue
Block a user