Paper/patches/server/0057-Configurable-Disabling-Cat-Chest-Detection.patch

24 lines
1.3 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
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
2024-04-26 05:15:07 +02:00
index 0b7b447aeb0e592b51e4ae205df09e1b8ef4d0bb..491474b66856fccb038ee436968c9a5d3e4bf75c 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/ChestBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
2024-04-24 03:25:14 +02:00
@@ -349,6 +349,11 @@ public class ChestBlock extends AbstractChestBlock<ChestBlockEntity> implements
2021-06-11 14:02:28 +02:00
}
private static boolean isCatSittingOnChest(LevelAccessor world, BlockPos pos) {
+ // Paper start - Option to disable chest cat detection
+ if (world.getMinecraftWorld().paperConfig().entities.behavior.disableChestCatDetection) {
2021-06-11 14:02:28 +02:00
+ return false;
+ }
+ // Paper end - Option to disable chest cat detection
2021-06-11 14:02:28 +02:00
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()) {