9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-20 15:29:33 +00:00
Files
SakuraMC/sakura-server/minecraft-patches/features/0014-Use-maxEntityCollision-limit-for-entity-retrieval.patch
Samsuik 7abe0b920b Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@056268e [ci skip] Correct javadoc for Weapon Component (#13096)
PaperMC/Paper@a0ea729 Fix minimum tick time reporting and off thread reading
PaperMC/Paper@ba2fb8c Update spark-paper dependency version (#13171)
PaperMC/Paper@ce983d7 Misc fixes to tick reporting (#13174)
PaperMC/Paper@9d95cd5 Use BUILD_STARTED_AT instead of Instant.now() for build timestamp (#13175)
PaperMC/Paper@610f1d2 Update fill-gradle to v1.0.9
PaperMC/Paper@ffcb7b2 Update Parchment (#13177)
PaperMC/Paper@c33a9ce Fix incorrect variable use in Entity#startRiding
PaperMC/Paper@c710b66 Add MapPalette.getNearestColor (#13104)
PaperMC/Paper@b57d641 Expose isReplaceable on BlockData (#13180)
PaperMC/Paper@af1823d Reduce impact of tick time calculations (#13188)
PaperMC/Paper@89ca94a [ci skip] Rebuild patches
PaperMC/Paper@e5cc256 [ci skip] Update CONTRIBUTING.md for Gradle and Windows Docs (#13190)
PaperMC/Paper@ab99393 Fix charged creeper explosions not dropping mob skulls (#13167)
2025-10-16 13:58:47 +01:00

30 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samsuik <kfian294ma4@gmail.com>
Date: Thu, 23 Sep 2021 18:50:13 +0100
Subject: [PATCH] Use maxEntityCollision limit for entity retrieval
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index 70b0604a279b66dc3e1087a03e9e0a1123fb63ee..d238e26628e790b46a36ebcae56e4d900e97b595 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -3788,7 +3788,17 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
return;
}
// Paper end - don't run getEntities if we're not going to use its result
- List<Entity> pushableEntities = this.level().getPushableEntities(this, this.getBoundingBox());
+ // Sakura start - use maxEntityCollision limit for entity retrieval
+ //List<Entity> pushableEntities = this.level().getPushableEntities(this, this.getBoundingBox());
+ final int limit = Math.max(_int, this.level().paperConfig().collisions.maxEntityCollisions);
+ final int search = limit * limit;
+ final List<Entity> pushableEntities = new java.util.ArrayList<>(4);
+ this.level().getEntities(
+ net.minecraft.world.level.entity.EntityTypeTest.forClass(Entity.class),
+ this.getBoundingBox(), EntitySelector.pushableBy(this),
+ pushableEntities, limit, search
+ );
+ // Sakura end - use maxEntityCollision limit for entity retrieval
if (!pushableEntities.isEmpty()) {
if (this.level() instanceof ServerLevel serverLevel) {
// Paper - don't run getEntities if we're not going to use its result; moved up