mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-24 00:51:34 +01:00
Fix PlayerUseItemOnBlockEvent being called with the wrong block position
This commit is contained in:
parent
d91fcde798
commit
ee36853f41
@ -183,7 +183,8 @@ public class BlockPlacementListener {
|
||||
}
|
||||
} else {
|
||||
// Player didn't try to place a block but interacted with one
|
||||
PlayerUseItemOnBlockEvent event = new PlayerUseItemOnBlockEvent(player, hand, usedItem, blockPosition, direction);
|
||||
final BlockPosition usePosition = blockPosition.clone().subtract(offsetX, offsetY, offsetZ);
|
||||
PlayerUseItemOnBlockEvent event = new PlayerUseItemOnBlockEvent(player, hand, usedItem, usePosition, direction);
|
||||
player.callEvent(PlayerUseItemOnBlockEvent.class, event);
|
||||
refreshChunk = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user