diff options
author | Shane Freeder <[email protected]> | 2021-11-30 05:31:24 +0000 |
---|---|---|
committer | Shane Freeder <[email protected]> | 2021-11-30 05:31:24 +0000 |
commit | 3e73355e2e47485163ad91dcd07caafe98639194 (patch) | |
tree | 3b137b6c32b17ebacd8fa910913b46c9daee1b15 | |
parent | 22aaf913686c8518e375deb01c6cde74942d3ac2 (diff) | |
download | Paper-3e73355e2e47485163ad91dcd07caafe98639194.tar.gz Paper-3e73355e2e47485163ad91dcd07caafe98639194.zip |
Prevent ContainerOpenersCounter openCount from going negative
-rw-r--r-- | patches/server/0846-Prevent-ContainerOpenersCounter-openCount-from-going.patch | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/patches/server/0846-Prevent-ContainerOpenersCounter-openCount-from-going.patch b/patches/server/0846-Prevent-ContainerOpenersCounter-openCount-from-going.patch new file mode 100644 index 0000000000..879289cfe2 --- /dev/null +++ b/patches/server/0846-Prevent-ContainerOpenersCounter-openCount-from-going.patch @@ -0,0 +1,18 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder <[email protected]> +Date: Tue, 30 Nov 2021 05:30:35 +0000 +Subject: [PATCH] Prevent ContainerOpenersCounter openCount from going negative + + +diff --git a/src/main/java/net/minecraft/world/level/block/entity/ContainerOpenersCounter.java b/src/main/java/net/minecraft/world/level/block/entity/ContainerOpenersCounter.java +index febf50f73a7fe8def045befa9fa1a3ce756378a9..c62acadee15d1a89d90d047d09d710154c0b074f 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/ContainerOpenersCounter.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/ContainerOpenersCounter.java +@@ -50,6 +50,7 @@ public abstract class ContainerOpenersCounter { + + public void decrementOpeners(Player player, Level world, BlockPos pos, BlockState state) { + int oldPower = Math.max(0, Math.min(15, this.openCount)); // CraftBukkit - Get power before new viewer is added ++ if (this.openCount == 0) return; // Paper + int i = this.openCount--; + + // CraftBukkit start - Call redstone event |