2020-05-06 17:48:49 +08:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2016-03-01 07:09:49 +08:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Thu, 3 Mar 2016 01:13:45 -0600
|
2018-07-23 07:39:56 +08:00
|
|
|
Subject: [PATCH] Configurable Disabling Cat Chest Detection
|
2016-03-01 07:09:49 +08:00
|
|
|
|
2018-07-23 07:39:56 +08:00
|
|
|
Offers a gameplay feature to stop cats from blocking chests
|
2016-03-01 07:09:49 +08:00
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2020-11-12 09:48:12 +08:00
|
|
|
index 5a4c3a8c511f22c8c3240c9c7cd83a65119c1054..70e074cdf2087e638af8e0f3878d0ef8eb7305cc 100644
|
2016-03-01 07:09:49 +08:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2020-11-12 09:48:12 +08:00
|
|
|
@@ -186,4 +186,9 @@ public class PaperWorldConfig {
|
2016-03-01 07:09:49 +08: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);
|
|
|
|
+ }
|
|
|
|
}
|
2021-03-16 15:19:45 +08:00
|
|
|
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
|
2016-03-01 07:09:49 +08:00
|
|
|
}
|
|
|
|
|
2019-04-25 14:53:51 +08:00
|
|
|
private static boolean b(GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
2018-07-15 09:53:17 +08:00
|
|
|
+ // Paper start - Option to disable chest cat detection
|
2019-04-25 14:53:51 +08:00
|
|
|
+ if (((World) generatoraccess).paperConfig.disableChestCatDetection) {
|
2016-03-01 07:09:49 +08:00
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
2019-04-25 14:53:51 +08: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 11:15:55 +08:00
|
|
|
|
2018-07-15 09:53:17 +08:00
|
|
|
if (!list.isEmpty()) {
|