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

Paper Changes:
a4f066cc Fix method profiler inbalance introduced in a2a9ffe (#3132)
c65dcad3 Don't delay chunk unloads during entity ticking
bc17ce69 Delay unsafe actions until after entity ticking is done - Fixes #3114
5553e6b3 Disable Sync Events firing Async errors during shutdown
e12c51d9 Use better variable for isStopping() API
586ee2bb Remove patch for MC-111480, fixed in 1.14
09a94215 Remove streams from Mob AI System
bb5c294e Fix Disabling Asynchronous Chunks
089d8356 Implement Chunk Priority / Urgency System for World Gen
fce69af7 Use dedicated thread for main thread blocking chunk loads
588b62e4 Add tick times API and /mspt command (#3102)
11de41c7 Add API MinecraftServer#isStopping (#3129)
942ff3c2 My patches are under MIT (#3130)
2020-04-12 03:45:54 -05:00

37 lines
1.6 KiB
Diff

From e6aa72962f5d52ca162a51c8172c355e70c818ca 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