aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0377-Add-BlockStateMeta-clearBlockState.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0377-Add-BlockStateMeta-clearBlockState.patch')
-rw-r--r--patches/server/0377-Add-BlockStateMeta-clearBlockState.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/patches/server/0377-Add-BlockStateMeta-clearBlockState.patch b/patches/server/0377-Add-BlockStateMeta-clearBlockState.patch
new file mode 100644
index 0000000000..680235a49a
--- /dev/null
+++ b/patches/server/0377-Add-BlockStateMeta-clearBlockState.patch
@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Thu, 11 Jan 2024 12:41:50 -0800
+Subject: [PATCH] Add BlockStateMeta#clearBlockState
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java
+index 301d883a7626e3abd222517400367fc40d6fa2bd..23dbc56edf0d16cf07ced2899942abae28397694 100644
+--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java
++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java
+@@ -198,6 +198,13 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
+ return this.blockEntityTag != null;
+ }
+
++ // Paper start - add method to clear block state
++ @Override
++ public void clearBlockState() {
++ this.blockEntityTag = null;
++ }
++ // Paper end - add method to clear block state
++
+ @Override
+ public BlockState getBlockState() {
+ return (this.blockEntityTag != null) ? this.blockEntityTag.copy() : CraftMetaBlockState.getBlockState(this.material, null);
+diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaShield.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaShield.java
+index 3542c6e72f5ff459d50b73fa210ea835f52dfa49..c8eec04685456d89cb41466cddcc3975d0ceeb29 100644
+--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaShield.java
++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaShield.java
+@@ -257,6 +257,13 @@ public class CraftMetaShield extends CraftMetaItem implements ShieldMeta, BlockS
+ this.banner = (Banner) blockState;
+ }
+
++ // Paper start - add method to clear block state
++ @Override
++ public void clearBlockState() {
++ this.banner = null;
++ }
++ // Paper end - add method to clear block state
++
+ private static Banner getBlockState(DyeColor color) {
+ BlockPos pos = BlockPos.ZERO;
+ Material stateMaterial = CraftMetaShield.shieldToBannerHack(color);