Files
Purpur/patches/server/0124-Tuinity-Don-t-run-entity-collision-code-if-not-neede.patch
William Blake Galbreath a29baddb7d Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
d33ba160 Fix incorrect keyword use on visibleChunksClone
2f343015 Updated Upstream (Bukkit/CraftBukkit)
a65831bd Optimize PlayerChunkMap memory use for visibleChunks
2020-04-08 23:13:56 -05:00

37 lines
1.6 KiB
Diff

From 8d3e6d4ba1cb4ca09811708e434f758235d10adb Mon Sep 17 00:00:00 2001
From: Spottedleaf <spottedleaf@spottedleaf.dev>
Date: Thu, 26 Mar 2020 18:34:18 -0700
Subject: [PATCH] Tuinity - Don't run entity collision code if not needed
Will not run if max entity craming is disabled and
the max collisions per entity is less than or equal to 0
---
src/main/java/net/minecraft/server/EntityLiving.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index fdb8a0f8c7..44889e86e1 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2701,10 +2701,16 @@ public abstract class EntityLiving extends Entity {
protected void doTick() {}
protected void collideNearby() {
+ // Purpur start
+ int i = this.world.getGameRules().getInt(GameRules.MAX_ENTITY_CRAMMING);
+ if (i <= 0 && world.paperConfig.maxCollisionsPerEntity <= 0) {
+ return;
+ }
+ // Purpur end
List<Entity> list = this.world.getEntities(this, this.getBoundingBox(), IEntitySelector.pushable(this, world.purpurConfig.fixClimbingBypassingCrammingRule)); // Purpur
if (!list.isEmpty()) {
- int i = this.world.getGameRules().getInt(GameRules.MAX_ENTITY_CRAMMING);
+ // int i = this.world.getGameRules().getInt(GameRules.MAX_ENTITY_CRAMMING); // Purpur - move up
int j;
if (i > 0 && list.size() > i - 1 && this.random.nextInt(4) == 0) {
--
2.24.0