mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-23 08:49:25 +00:00
Drop useless reduce movement allocations patch
This commit is contained in:
24
patches/server/0026-Optimise-LivingEntity-pushEntities.patch
Normal file
24
patches/server/0026-Optimise-LivingEntity-pushEntities.patch
Normal file
@@ -0,0 +1,24 @@
|
||||
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 fe435d4a387bb28be6831cec0c8bb0a7c8b603a4..e39732b16d0b8d47759b8fc282e4a9a158991104 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3629,7 +3629,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<Entity> 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
|
||||
Reference in New Issue
Block a user