mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 21:47:55 +01:00
Don't use event to get block position (#9295)
This commit is contained in:
parent
dc30ee591d
commit
2ffb704efa
@ -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
|
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
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
+++ b/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 {
|
@@ -513,7 +513,11 @@ public final class ItemStack {
|
||||||
@ -14,7 +14,7 @@ index 103ad5f373a59fadb4783892579f3e681a8fd596..b367ec1feaccbd67e9e28c0d0515e163
|
|||||||
if (this.item instanceof BlockItem) {
|
if (this.item instanceof BlockItem) {
|
||||||
- SoundType soundeffecttype = ((BlockItem) this.item).getBlock().getSoundType(null);
|
- SoundType soundeffecttype = ((BlockItem) this.item).getBlock().getSoundType(null);
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ BlockPos position = ((CraftBlock) placeEvent.getBlock()).getPosition();
|
+ BlockPos position = new net.minecraft.world.item.context.BlockPlaceContext(itemactioncontext).getClickedPos();
|
||||||
+ net.minecraft.world.level.block.state.BlockState blockData = world.getBlockState(position);
|
+ net.minecraft.world.level.block.state.BlockState blockData = world.getBlockState(position);
|
||||||
+ SoundType soundeffecttype = blockData.getSoundType();
|
+ SoundType soundeffecttype = blockData.getSoundType();
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
|
Loading…
Reference in New Issue
Block a user