mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-20 23:39:32 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@906df69 Prevent internal NPE on ItemStack#damage (#10836) PaperMC/Paper@79e2cb6 Update upstream (Bukkit/CraftBukkit/Spigot) (#10875)
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 21e61bb75ac7ce468bc757633ce678b21bcb9deb..a7bbd4d1ddb7e80724cdd05a6d6b37161e711264 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -3554,7 +3554,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
|