2019-04-05 07:27:37 +02:00
|
|
|
From d1f74537965b0b0d5e0ddd63e619874823c424ce Mon Sep 17 00:00:00 2001
|
2016-03-01 00:09:49 +01:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Thu, 3 Mar 2016 01:13:45 -0600
|
2018-07-23 01:39:56 +02:00
|
|
|
Subject: [PATCH] Configurable Disabling Cat Chest Detection
|
2016-03-01 00:09:49 +01:00
|
|
|
|
2018-07-23 01:39:56 +02:00
|
|
|
Offers a gameplay feature to stop cats from blocking chests
|
2016-03-01 00:09:49 +01:00
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2019-04-05 07:27:37 +02:00
|
|
|
index 4266a87fe..4641eaf2f 100644
|
2016-03-01 00:09:49 +01:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2019-04-05 07:27:37 +02:00
|
|
|
@@ -184,4 +184,9 @@ public class PaperWorldConfig {
|
2016-03-01 00:09:49 +01: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-01-01 04:15:55 +01:00
|
|
|
index 5e1a3df2b..e94786138 100644
|
2016-03-01 00:09:49 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockChest.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockChest.java
|
2019-01-01 04:15:55 +01:00
|
|
|
@@ -232,6 +232,11 @@ public class BlockChest extends BlockTileEntity implements IFluidSource, IFluidC
|
2016-03-01 00:09:49 +01:00
|
|
|
}
|
|
|
|
|
2018-07-15 03:53:17 +02:00
|
|
|
private boolean b(World world, BlockPosition blockposition) {
|
|
|
|
+ // Paper start - Option to disable chest cat detection
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (world.paperConfig.disableChestCatDetection) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
2019-01-01 04:15:55 +01:00
|
|
|
List<EntityOcelot> list = world.a(EntityOcelot.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)));
|
|
|
|
|
2018-07-15 03:53:17 +02:00
|
|
|
if (!list.isEmpty()) {
|
2016-03-01 00:09:49 +01:00
|
|
|
--
|
2019-04-05 06:52:02 +02:00
|
|
|
2.21.0
|
2016-03-01 00:09:49 +01:00
|
|
|
|