aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0049-Configurable-Disabling-Cat-Chest-Detection.patch
blob: 85180f435269694272424280885892d8fb57a8f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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/net/minecraft/world/level/block/ChestBlock.java b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
index ccde1bef18a7ffe338d71a6feb2dd88228004c34..c6b57d45383441aa35510e759ce3cb82bc98f305 100644
--- a/src/main/java/net/minecraft/world/level/block/ChestBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
@@ -361,6 +361,11 @@ public class ChestBlock extends AbstractChestBlock<ChestBlockEntity> implements
     }
 
     private static boolean isCatSittingOnChest(LevelAccessor world, BlockPos pos) {
+        // Paper start - Option to disable chest cat detection
+        if (world.getMinecraftWorld().paperConfig().entities.behavior.disableChestCatDetection) {
+            return false;
+        }
+        // Paper end
         List<Cat> list = world.getEntitiesOfClass(Cat.class, new AABB((double) pos.getX(), (double) (pos.getY() + 1), (double) pos.getZ(), (double) (pos.getX() + 1), (double) (pos.getY() + 2), (double) (pos.getZ() + 1)));
 
         if (!list.isEmpty()) {