aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOwen1212055 <[email protected]>2023-06-08 20:24:02 -0400
committerOwen1212055 <[email protected]>2023-06-08 20:24:12 -0400
commit9d428792c4982e08a63fc8ccbc04d9b06afd994c (patch)
treec15e8859f493ab3025f7e2f93637e94493595d91
parentaed9ef07886b3ac1a8e142ba6ef22818dc23a2ae (diff)
downloadPaper-9d428792c4982e08a63fc8ccbc04d9b06afd994c.tar.gz
Paper-9d428792c4982e08a63fc8ccbc04d9b06afd994c.zip
Fix breaking pots throwing exception
-rw-r--r--patches/server/0971-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/patches/server/0971-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch b/patches/server/0971-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch
new file mode 100644
index 0000000000..e00c112cc9
--- /dev/null
+++ b/patches/server/0971-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch
@@ -0,0 +1,23 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Owen1212055 <[email protected]>
+Date: Thu, 8 Jun 2023 20:23:13 -0400
+Subject: [PATCH] Fix spigot sound playing for BlockItem ItemStacks
+
+
+diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
+index 103ad5f373a59fadb4783892579f3e681a8fd596..b367ec1feaccbd67e9e28c0d0515e163f37135fe 100644
+--- a/src/main/java/net/minecraft/world/item/ItemStack.java
++++ b/src/main/java/net/minecraft/world/item/ItemStack.java
+@@ -513,7 +513,11 @@ public final class ItemStack {
+
+ // SPIGOT-1288 - play sound stripped from ItemBlock
+ if (this.item instanceof BlockItem) {
+- SoundType soundeffecttype = ((BlockItem) this.item).getBlock().getSoundType(null);
++ // Paper start
++ BlockPos position = ((CraftBlock) placeEvent.getBlock()).getPosition();
++ net.minecraft.world.level.block.state.BlockState blockData = world.getBlockState(position);
++ SoundType soundeffecttype = blockData.getSoundType();
++ // Paper end
+ world.playSound(entityhuman, blockposition, soundeffecttype.getPlaceSound(), SoundSource.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F);
+ }
+