mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-21 15:59:26 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@3ea95ef Do not access world state to see if we can see a Player PaperMC/Paper@71c84c8 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277) PaperMC/Paper@e3bc4c4 Make debug mode print current configuration phase PaperMC/Paper@d0ebfbb Fix corrupted plugin.yml breaking plugin loading (#10279) PaperMC/Paper@681bbff Fix spawnreason saving
24 lines
1.7 KiB
Diff
24 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 23570a0b1227a840b9c1e6ae326827ea655bb5f7..aad41a0026ae3240c9ba97e5b44ccce6d021f8aa 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -3580,7 +3580,11 @@ 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 retrival
|
|
+ int limit = Math.max(i, this.level().paperConfig().collisions.maxEntityCollisions);
|
|
+ int search = limit * limit;
|
|
+ List<Entity> list = this.level().getLimitedEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushable(this, this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule), limit, search); // Paper - Climbing should not bypass cramming gamerule
|
|
+ // Sakura end - use maxEntityCollision limit for entity retrival
|
|
|
|
if (!list.isEmpty()) {
|
|
// Paper - don't run getEntities if we're not going to use its result; moved up
|