2023-06-09 02:24:02 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
|
|
|
|
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
|
2024-10-25 13:52:04 +02:00
|
|
|
index 90a55f00c36903d52630c51bf69322973a2b5274..1b7d797dac1ff7ee945cf4ef8c6861475a31903d 100644
|
2023-06-09 02:24:02 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
2024-10-24 00:42:38 +02:00
|
|
|
@@ -577,7 +577,11 @@ public final class ItemStack implements DataComponentHolder {
|
2023-06-09 02:24:02 +02:00
|
|
|
|
2024-10-24 00:42:38 +02:00
|
|
|
// SPIGOT-1288 - play sound stripped from ItemBlock
|
|
|
|
if (this.item instanceof BlockItem) {
|
|
|
|
- SoundType soundeffecttype = ((BlockItem) this.item).getBlock().defaultBlockState().getSoundType(); // TODO: not strictly correct, however currently only affects decorated pots
|
2024-01-15 12:38:39 +01:00
|
|
|
+ // Paper start - Fix spigot sound playing for BlockItem ItemStacks
|
2023-07-04 10:22:56 +02:00
|
|
|
+ BlockPos position = new net.minecraft.world.item.context.BlockPlaceContext(context).getClickedPos();
|
2023-06-10 08:13:42 +02:00
|
|
|
+ net.minecraft.world.level.block.state.BlockState blockData = world.getBlockState(position);
|
2023-06-09 02:24:02 +02:00
|
|
|
+ SoundType soundeffecttype = blockData.getSoundType();
|
2024-01-15 12:38:39 +01:00
|
|
|
+ // Paper end - Fix spigot sound playing for BlockItem ItemStacks
|
2024-10-24 00:42:38 +02:00
|
|
|
world.playSound(entityhuman, blockposition, soundeffecttype.getPlaceSound(), SoundSource.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F);
|
|
|
|
}
|
2023-06-09 02:24:02 +02:00
|
|
|
|