9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-03 14:22:26 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0123-Reduce-active-items-finding-hopper-nearby-check.patch
2025-06-16 05:21:05 +08:00

28 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Mon, 15 Jan 2024 10:53:10 -0500
Subject: [PATCH] Reduce active items finding hopper nearby check
This patch add a toggle for active items checking MinecraftHopper nearby,
But still recommend to turn-off `checkForMinecartNearItemWhileActive`
Since `Reduce-hopper-item-checks.patch` will cause lag under massive dropped items
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
index 93303c5499e621c8dd2152e4faccf08c4ba119f3..8939803cd30a8453457f832d6a9a8c1128dafe0e 100644
--- a/net/minecraft/world/entity/item/ItemEntity.java
+++ b/net/minecraft/world/entity/item/ItemEntity.java
@@ -238,7 +238,11 @@ public class ItemEntity extends Entity implements TraceableEntity {
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
return; // Gale - EMC - reduce hopper item checks
}
- this.markNearbyHopperCartsAsImmune(); // Gale - EMC - reduce hopper item checks
+ // Leaf start - Reduce active items finding hopper nearby check
+ if (level().galeConfig().smallOptimizations.reducedIntervals.checkNearbyItem.hopper.minecart.temporaryImmunity.checkForMinecartNearItemWhileActive) {
+ this.markNearbyHopperCartsAsImmune(); // Gale - EMC - reduce hopper item checks
+ }
+ // Leaf end - Reduce active items finding hopper nearby check
}
}