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

Paper Changes:
c096fe19 Port 20w15a Villager AI optimizations
832687de Restore preventing saving bad entities patch to full effect
df8eedee Restore Optimize Pathfinding patch
97b1cc36 Allow shutting down server during a watchdog hang gracefully
06044e24 Async command map building
2020-04-12 17:33:46 -05:00

37 lines
1.6 KiB
Diff

From 249a6ce53535798d8b0e0064a6f390f9dde36098 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