9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-21 07:49:29 +00:00
Files
SakuraMC/patches/server/0026-Optimise-LivingEntity-pushEntities.patch
Samsuik 9a7b139975 Updated Upstream (1.21.4 Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@c0a3d51 Start update, apply API patches
PaperMC/Paper@172c7dc Work
PaperMC/Paper@ab9a3db More work
PaperMC/Paper@c60e47f More more work
PaperMC/Paper@bd55e32 More more more work
PaperMC/Paper@5265287 More more more more work
PaperMC/Paper@4601dc9 Some fixes, start updating CustomModelData API
PaperMC/Paper@2331dad Even more work
PaperMC/Paper@dc74c6f moonrise
PaperMC/Paper@d7d2f88 Apply remaining patches, fix API
PaperMC/Paper@f863bb7 Update generated classes
PaperMC/Paper@71a4ef8 Set java launcher for api generate task
PaperMC/Paper@b8aeecb Compilation fixes
PaperMC/Paper@6c35392 Tests succeed (by removing one)
PaperMC/Paper@b0603da Fix jd gson version, move back mc util diff
PaperMC/Paper@e2dd1d5 Add back post_teleport chunk ticket
PaperMC/Paper@7045b2a Update DataConverter
PaperMC/Paper@65633e3 Update Moonrise
2024-12-04 00:31:13 +00:00

25 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] Optimise LivingEntity#pushEntities
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 96b4fbe4a4655777ff10b32e3257e2fac2aba12a..01179c4b01aa4898d08b392bd682587e3858b822 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3800,7 +3800,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
return;
}
// Paper end - don't run getEntities if we're not going to use its result
- List list = this.level().getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushable(this, this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule)); // Paper - Climbing should not bypass cramming gamerule
+ // Sakura start - use maxEntityCollision limit for entity retrieval
+ int limit = Math.max(i, this.level().paperConfig().collisions.maxEntityCollisions);
+ int search = limit * limit;
+ List<Entity> list = new ArrayList<>();
+ this.level().getEntities(null, this.getBoundingBox(), EntitySelector.pushable(this, this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule), list, limit, search); // Paper - Climbing should not bypass cramming gamerule
+ // Sakura end - use maxEntityCollision limit for entity retrieval
if (!list.isEmpty()) {
// Paper - don't run getEntities if we're not going to use its result; moved up