9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-04 15:41:40 +00:00

[ci skip] Drop useless Reduce entity allocations patch

This commit is contained in:
Dreeam
2025-06-11 19:59:26 +08:00
parent bc33d3089a
commit 6b9b96cb23
261 changed files with 160 additions and 57 deletions

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/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) {