aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0044-Configurable-Disabling-Cat-Chest-Detection.patch
blob: 9c34c4ef30af39c570dc0b99fa7f527fe31e4dd4 (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
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 3 Mar 2016 01:13:45 -0600
Subject: [PATCH] Configurable Disabling Cat Chest Detection

Offers a gameplay feature to stop cats from blocking chests

diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 5a4c3a8c511f22c8c3240c9c7cd83a65119c1054..70e074cdf2087e638af8e0f3878d0ef8eb7305cc 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -186,4 +186,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/world/level/block/BlockChest.java b/src/main/java/net/minecraft/world/level/block/BlockChest.java
index b229faad99120c67b089f7680d800fbe594fe7da..b2c29cff5883868cb56a4e376ab946ac929abc94 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockChest.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockChest.java
@@ -312,6 +312,11 @@ public class BlockChest extends BlockChestAbstract<TileEntityChest> implements I
     }
 
     private static boolean b(GeneratorAccess generatoraccess, BlockPosition blockposition) {
+        // Paper start - Option to disable chest cat detection
+        if (((World) generatoraccess).paperConfig.disableChestCatDetection) {
+            return false;
+        }
+        // Paper end
         List<EntityCat> list = generatoraccess.a(EntityCat.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)));
 
         if (!list.isEmpty()) {