From 74469e0a48b975cc339b8c1038955bef5255bd6e Mon Sep 17 00:00:00 2001 From: Spottedleaf 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 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