aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0298-Option-to-prevent-armor-stands-from-doing-entity-loo.patch
blob: 15a15f7ae686cbd70c23f1c9fd6e3256d392ba07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 81263e2380923daafbda6e6c6b923716099a7043 Mon Sep 17 00:00:00 2001
From: Hugo Manrique <hugmanrique@gmail.com>
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/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 8c4ff18868..6c4cb61dc5 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -375,6 +375,11 @@ public class PaperWorldConfig {
         }
     }
 
+    public boolean armorStandEntityLookups = true;
+    private void armorStandEntityLookups() {
+        armorStandEntityLookups = getBoolean("armor-stands-do-collision-entity-lookups", true);
+    }
+
     public int maxCollisionsPerEntity;
     private void maxEntityCollision() {
         maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) );
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index a5f4b9ad94..28fca165cd 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1539,6 +1539,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
         }
     }
 
+    // Paper start - Prevent armor stands from doing entity lookups
+    @Override
+    public boolean getCubes(@Nullable Entity entity, AxisAlignedBB axisAlignedBB) {
+        if (entity instanceof EntityArmorStand && !entity.world.paperConfig.armorStandEntityLookups) return false;
+        return GeneratorAccess.super.getCubes(entity, axisAlignedBB);
+    }
+    // Paper end
+
     public boolean a(AxisAlignedBB axisalignedbb) {
         int i = MathHelper.floor(axisalignedbb.minX);
         int j = MathHelper.f(axisalignedbb.maxX);
-- 
2.21.0