diff options
author | Owen <[email protected]> | 2023-06-10 02:13:42 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2023-06-10 02:13:42 -0400 |
commit | 2ffb704efaf9811b9da286011e9c4b8f682620a9 (patch) | |
tree | a67a00385d84ba14edf4c4cb4592224698f7d09f | |
parent | dc30ee591d52a55ac1f6dfce6e731a583cc21fad (diff) | |
download | Paper-2ffb704efaf9811b9da286011e9c4b8f682620a9.tar.gz Paper-2ffb704efaf9811b9da286011e9c4b8f682620a9.zip |
Don't use event to get block position (#9295)
-rw-r--r-- | patches/server/0972-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/patches/server/0972-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch b/patches/server/0972-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch index e00c112cc9..1fbc769545 100644 --- a/patches/server/0972-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch +++ b/patches/server/0972-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch @@ -5,7 +5,7 @@ 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 +index 103ad5f373a59fadb4783892579f3e681a8fd596..adb7220be617d6d9f2cdd7fbe4fa2dd24cc7d142 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 { @@ -14,8 +14,8 @@ index 103ad5f373a59fadb4783892579f3e681a8fd596..b367ec1feaccbd67e9e28c0d0515e163 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); ++ BlockPos position = new net.minecraft.world.item.context.BlockPlaceContext(itemactioncontext).getClickedPos(); ++ 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); |