From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hugo Manrique Date: Mon, 23 Jul 2018 12:57:39 +0200 Subject: [PATCH] Option to prevent armor stands from doing entity lookups diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java index 5a838c7070fc5ed8f8f2fdb0073221f4c22e1334..228aed6b75296cf0eb9d611c2396b6a8b6e8018b 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java @@ -337,6 +337,7 @@ public class ArmorStand extends LivingEntity { @Override protected void pushEntities() { + if (!this.level().paperConfig().entities.armorStands.doCollisionEntityLookups) return; // Paper List list = this.level().getEntities((Entity) this, this.getBoundingBox(), ArmorStand.RIDABLE_MINECARTS); Iterator iterator = list.iterator(); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java index be48f90db79509035a87103f20582fb2500449ad..b52a761e84e00f2ccac7b1b9db73e70ffa1c681b 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -849,6 +849,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // Paper end } } + // Paper start - Prevent armor stands from doing entity lookups + @Override + public boolean noCollision(@Nullable Entity entity, AABB box) { + if (entity instanceof net.minecraft.world.entity.decoration.ArmorStand && !entity.level().paperConfig().entities.armorStands.doCollisionEntityLookups) return false; + return LevelAccessor.super.noCollision(entity, box); + } + // Paper end public boolean shouldTickDeath(Entity entity) { return true;