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/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2022-06-06 02:17:27 +02:00
|
|
|
index 156059d4951fa01b10cc36d70cd439037c636e4c..adf5a83fc1b62e55ba4524893f8704ad6cd81e97 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2022-06-06 02:17:27 +02:00
|
|
|
@@ -242,4 +242,9 @@ public class PaperWorldConfig {
|
2021-06-11 14:02:28 +02:00
|
|
|
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/ChestBlock.java b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
|
2021-11-23 13:15:10 +01:00
|
|
|
index 306fd5b1893d8a68af2073978bab7e590e936ef5..db726697b00afdee6078849fd224263483349912 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
|
2021-10-17 18:57:00 +02:00
|
|
|
@@ -362,6 +362,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 (((Level) world).paperConfig.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()) {
|