mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 02:55:47 +01:00
38 lines
2.1 KiB
Diff
38 lines
2.1 KiB
Diff
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
|
|
index 5a4c3a8c511f22c8c3240c9c7cd83a65119c1054..70e074cdf2087e638af8e0f3878d0ef8eb7305cc 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -186,4 +186,9 @@ public class PaperWorldConfig {
|
|
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/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
|
|
}
|
|
|
|
private static boolean b(GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
|
+ // Paper start - Option to disable chest cat detection
|
|
+ if (((World) generatoraccess).paperConfig.disableChestCatDetection) {
|
|
+ return false;
|
|
+ }
|
|
+ // Paper end
|
|
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)));
|
|
|
|
if (!list.isEmpty()) {
|