mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Fix breaking pots throwing exception
This commit is contained in:
parent
3913e1d74b
commit
6ee3455f40
1 changed files with 23 additions and 0 deletions
|
@ -0,0 +1,23 @@
|
|||
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
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ 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);
|
||||
}
|
||||
|
Loading…
Reference in a new issue