2019-04-25 06:53:51 +00:00
|
|
|
From c453ea6fa9dccc9e8c61d9f07842f5364377539e Mon Sep 17 00:00:00 2001
|
2016-02-29 23:09:49 +00:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Thu, 3 Mar 2016 01:13:45 -0600
|
2018-07-22 23:39:56 +00:00
|
|
|
Subject: [PATCH] Configurable Disabling Cat Chest Detection
|
2016-02-29 23:09:49 +00:00
|
|
|
|
2018-07-22 23:39:56 +00:00
|
|
|
Offers a gameplay feature to stop cats from blocking chests
|
2016-02-29 23:09:49 +00:00
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2019-04-25 06:53:51 +00:00
|
|
|
index d663b15ceb..2782970393 100644
|
2016-02-29 23:09:49 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2019-04-25 06:53:51 +00:00
|
|
|
@@ -176,4 +176,9 @@ public class PaperWorldConfig {
|
2016-02-29 23:09:49 +00: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/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java
|
2019-04-25 06:53:51 +00:00
|
|
|
index 6b1c64e8f3..ee9d91a8c1 100644
|
2016-02-29 23:09:49 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockChest.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockChest.java
|
2019-04-25 06:53:51 +00:00
|
|
|
@@ -280,6 +280,11 @@ public class BlockChest extends BlockTileEntity implements IBlockWaterlogged {
|
2016-02-29 23:09:49 +00:00
|
|
|
}
|
|
|
|
|
2019-04-25 06:53:51 +00:00
|
|
|
private static boolean b(GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
2018-07-15 01:53:17 +00:00
|
|
|
+ // Paper start - Option to disable chest cat detection
|
2019-04-25 06:53:51 +00:00
|
|
|
+ if (((World) generatoraccess).paperConfig.disableChestCatDetection) {
|
2016-02-29 23:09:49 +00:00
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
2019-04-25 06:53:51 +00:00
|
|
|
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)));
|
2019-01-01 03:15:55 +00:00
|
|
|
|
2018-07-15 01:53:17 +00:00
|
|
|
if (!list.isEmpty()) {
|
2016-02-29 23:09:49 +00:00
|
|
|
--
|
2019-04-05 04:52:02 +00:00
|
|
|
2.21.0
|
2016-02-29 23:09:49 +00:00
|
|
|
|