mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-20 15:29:33 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@6cfa2f7 [ci skip] Add missing nullability annotation to sendEquipmentChange method (#12112) PaperMC/Paper@9b9de82 Update Alternate Current patch to v1.9.1 (#12115) PaperMC/Paper@c62252e Add lore content guard (#12116) PaperMC/Paper@4041678 [ci-skip] Mention missing World#regenerateChunk implementation in jd (#12109) PaperMC/Paper@a6e82d9 [ci skip] Clarify getChunkAtAsyncUrgently javadocs (#12125) PaperMC/Paper@cb25c0c [ci skip] Fix annotation fields used in NMS getBukkitEntity (#12120) PaperMC/Paper@0070126 [ci skip] improvement example in javadoc for DatapackRegistrar (#12122) PaperMC/Paper@608f004 add method on ItemStack to edit pdc (#12022) PaperMC/Paper@7bee997 Cleanup damage source a bit (#12106) PaperMC/Paper@b9023b5 Add EntityAttemptSmashAttackEvent (#12113) PaperMC/Paper@a3781ff Separate tick count to ensure vanilla parity (#12077) PaperMC/Paper@2a4a115 Add EntityEquipmentChangedEvent (#12011) PaperMC/Paper@06f96dd Improvement in /plugins command (#12121) PaperMC/Paper@28d07dc use correct spigot plugin count PaperMC/Paper@60394c5 Fix PlayerReadyArrowEvent cancellation desync (#12111) PaperMC/Paper@b27e11c Fix bad world to chunk coordinate example in javadocs (#12131) PaperMC/Paper@88cdd22 Fixup luck and random implementation in CB loot-tables (#11926) PaperMC/Paper@84609dc Don't auto-create any brig redirects (#11954) PaperMC/Paper@8eb8e44 Allow For Default Titles in InventoryView Builders (#12013)
29 lines
1.9 KiB
Diff
29 lines
1.9 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] Use maxEntityCollision limit for entity retrieval
|
|
|
|
|
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
|
index e8f644873275a9cfa898066da23ab6805a6ac315..a67774ef5fdd619ea085b05113ab790da7c1caed 100644
|
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -3657,7 +3657,16 @@ 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> entities = this.level().getEntities(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(_int, this.level().paperConfig().collisions.maxEntityCollisions);
|
|
+ int search = limit * limit;
|
|
+ List<Entity> entities = new ArrayList<>();
|
|
+ this.level().getEntities(
|
|
+ EntityTypeTest.forClass(Entity.class), this.getBoundingBox(),
|
|
+ EntitySelector.pushable(this, this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule), // Paper - Climbing should not bypass cramming gamerule
|
|
+ entities, limit, search
|
|
+ );
|
|
+ // Sakura end - use maxEntityCollision limit for entity retrieval
|
|
if (!entities.isEmpty()) {
|
|
// Paper - don't run getEntities if we're not going to use its result; moved up
|
|
if (_int > 0 && entities.size() > _int - 1 && this.random.nextInt(4) == 0) {
|