diff options
Diffstat (limited to 'patches/server/0512-Fix-interact-event-not-being-called-sometimes.patch')
-rw-r--r-- | patches/server/0512-Fix-interact-event-not-being-called-sometimes.patch | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/patches/server/0512-Fix-interact-event-not-being-called-sometimes.patch b/patches/server/0512-Fix-interact-event-not-being-called-sometimes.patch index 246f195783..513123dfe6 100644 --- a/patches/server/0512-Fix-interact-event-not-being-called-sometimes.patch +++ b/patches/server/0512-Fix-interact-event-not-being-called-sometimes.patch @@ -11,7 +11,7 @@ Subject: [PATCH] Fix interact event not being called sometimes Co-authored-by: Moulberry <[email protected]> diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b13e19d7214cc8a84693df7f052ca0d4b8a34140..85660d2d5ba535f6d8ace6783314cfe278d34317 100644 +index b13e19d7214cc8a84693df7f052ca0d4b8a34140..30513a13c626d117e2de9ceef46621ef8cde6386 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1761,7 +1761,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -38,7 +38,7 @@ index b13e19d7214cc8a84693df7f052ca0d4b8a34140..85660d2d5ba535f6d8ace6783314cfe2 + } else { // Paper start - Fix interact event not being called sometimes + GameType gameType = this.player.gameMode.getGameModeForPlayer(); + if (gameType == GameType.ADVENTURE && result.getHitBlock() != null) { -+ CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, io.papermc.paper.util.MCUtil.toBlockPosition(result.getHitPosition()), org.bukkit.craftbukkit.block.CraftBlock.blockFaceToNotch(result.getHitBlockFace()), this.player.getInventory().getSelected(), InteractionHand.MAIN_HAND); ++ CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, ((org.bukkit.craftbukkit.block.CraftBlock) result.getHitBlock()).getPosition(), org.bukkit.craftbukkit.block.CraftBlock.blockFaceToNotch(result.getHitBlockFace()), this.player.getInventory().getSelected(), InteractionHand.MAIN_HAND); + } else if (gameType != GameType.CREATIVE && result.getHitEntity() != null && origin.toVector().distanceSquared(result.getHitPosition()) > 3.0D * 3.0D) { + CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_AIR, this.player.getInventory().getSelected(), InteractionHand.MAIN_HAND); + } |