Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/Spigot-Server-Patches/0043-Configurable-Disabling-Cat-Chest-Detection.patch

41 Zeilen
1.9 KiB
Diff

From 8405fca5dd7106f16174a4f33ebc7d50a4ec3a96 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
index 71af3fcfed..e28d5b19a3 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
@@ -175,4 +175,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
index 5401f7d754..27e6d2b5f2 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
@@ -216,6 +216,11 @@ public class BlockChest extends BlockTileEntity implements IFluidSource, IFluidC
2016-03-01 00:09:49 +01: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
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))); // Paper - decompile fix
if (!list.isEmpty()) {
for(EntityOcelot entityocelot : list) {
2016-03-01 00:09:49 +01:00
--
2.19.0
2016-03-01 00:09:49 +01:00