aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0050-Disable-chest-cat-detection.patch
blob: 513aa782ade7033b5d24db3c927aae906957442a (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
From e86c5102d5b832a152202db0b357323fc3755fce Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 3 Mar 2016 01:13:45 -0600
Subject: [PATCH] Disable chest cat detection


diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index abcfb9216..4c57b9cbf 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -222,4 +222,9 @@ public class PaperWorldConfig {
     private void containerUpdateTickRate() {
         containerUpdateTickRate = getInt("container-update-tick-rate", 1);
     }
+
+    public boolean disableChestCatDetection;
+    private void disableChestCatDetection() {
+        disableChestCatDetection = getBoolean("game-mechanics.disable-chest-cat-detection", false);
+    }
 }
diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java
index da2cfe206..bc398ec52 100644
--- a/src/main/java/net/minecraft/server/BlockChest.java
+++ b/src/main/java/net/minecraft/server/BlockChest.java
@@ -399,6 +399,11 @@ public class BlockChest extends BlockTileEntity {
     }
 
     private boolean j(World world, BlockPosition blockposition) {
+        // Paper start - Option ti dsiable chest cat detection
+        if (world.paperConfig.disableChestCatDetection) {
+            return false;
+        }
+        // Paper end
         Iterator iterator = world.a(EntityOcelot.class, new AxisAlignedBB((double) blockposition.getX(), (double) (blockposition.getY() + 1), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 2), (double) (blockposition.getZ() + 1))).iterator();
 
         EntityOcelot entityocelot;
-- 
2.18.0