9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-22 00:09:20 +00:00
Files
SakuraMC/patches/server/0028-Optimise-LivingEntity-pushEntities.patch
Samsuik 13f012eb71 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@84f6e6e Fix max temper API for llama (#10823)
PaperMC/Paper@672c077 handle BODY slot for non-mobs (#10822)
PaperMC/Paper@716b868 Use RegistryOps for loadAdvancement (#10799)
PaperMC/Paper@d9e659a Allow firework effects with no colors (#10814)
PaperMC/Paper@7e2b682 Fix skipping custom block entity tag (#10812)
PaperMC/Paper@ed85aac Flatten namespaced vanilla command alias redirects (#10821)
PaperMC/Paper@a31dc90 Several fixes and new api for experience merging/stacking (#9242)
PaperMC/Paper@efd91e5 Add registry-related argument types (#10770)
PaperMC/Paper@27d2ed8 Extend fishing API (#10634)
PaperMC/Paper@0fcf3e3 Deprecate InvAction#HOTBAR_MOVE_AND_READD (#10784)
PaperMC/Paper@8e6554a Fix sending disconnect packet in phases where it doesn't exist
PaperMC/Paper@06e69c8 Use CommandSourceStack in AsyncPlayerSendCommandsEvent (#10826)
PaperMC/Paper@a47e11d fix knockback events (#10831)
PaperMC/Paper@3181470 Add entity heal API (#10267)
PaperMC/Paper@0513374 Fire TabCompleteEvent for legacy commands (#10834)
PaperMC/Paper@5d8e53d Fix CommandSourceStack#bypassSelectorPermissions (#10837)
PaperMC/Paper@ac64751 Use RegistryOps in the correct places (#10843)
PaperMC/Paper@54fbd0c clarify what getEntityId actually returns (#10839)
PaperMC/Paper@b8f2101 Only assign blockstate data if super ctor did not (#10841)
PaperMC/Paper@4f13be9 Do not perform chunk existance check for I/O scheduling
PaperMC/Paper@79c1ce1 Add since to deprecated for removals (#10848)
PaperMC/Paper@88d76d9 Make Bogged implement Shearable (#10844)
PaperMC/Paper@bd5867a Handle alpha channel from potion_contents component (#10808)
2024-06-08 20:58:06 +01:00

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 ce01fe82dc1eaaf06ca317ddbc62b7d1b87a48b2..ba612c35d74be6b31495c17dbb8cf13ef28b526b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3560,7 +3560,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