2024-01-23 21:41:47 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
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
|
2024-10-21 00:06:54 +02:00
|
|
|
index e70b917698b381918b0b30dca7b97d36df28c897..3985e5b4e2d65faa8eaea1d4a2acc6fb1e64f959 100644
|
2024-01-23 21:41:47 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java
|
2024-10-21 00:06:54 +02:00
|
|
|
@@ -239,6 +239,13 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
|
2024-01-23 21:41:47 +01:00
|
|
|
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() {
|
2024-04-24 08:44:48 +02:00
|
|
|
return (this.blockEntityTag != null) ? this.blockEntityTag.copy() : CraftMetaBlockState.getBlockState(this.material, null);
|
2024-08-09 22:05:50 +02:00
|
|
|
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);
|