diff options
author | Bjarne Koll <[email protected]> | 2024-06-16 17:21:14 +0200 |
---|---|---|
committer | Bjarne Koll <[email protected]> | 2024-06-16 17:23:42 +0200 |
commit | e1c003355296d70ea50e80d1933aba34e00d0763 (patch) | |
tree | 728ab80298d566c824b32d0e4be332871faef9fb /patches/server/0460-Fix-interact-event-not-being-called-sometimes.patch | |
parent | ec4c712efa6c8eaeb514156357da679e540bfeda (diff) | |
download | Paper-e1c003355296d70ea50e80d1933aba34e00d0763.tar.gz Paper-e1c003355296d70ea50e80d1933aba34e00d0763.zip |
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
2b4b6d14 PR-1023: Convert InventoryView to interface
CraftBukkit Changes:
68603b1c1 Use expanded interaction ranges for traced interact events
eae9f760c PR-1414: Convert InventoryView to interface
ee9eafe67 Fix Implementation for DamageSource#isIndirect for internal custom causing entity
Diffstat (limited to 'patches/server/0460-Fix-interact-event-not-being-called-sometimes.patch')
-rw-r--r-- | patches/server/0460-Fix-interact-event-not-being-called-sometimes.patch | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/patches/server/0460-Fix-interact-event-not-being-called-sometimes.patch b/patches/server/0460-Fix-interact-event-not-being-called-sometimes.patch index c80cc0c64b..50b8b7414c 100644 --- a/patches/server/0460-Fix-interact-event-not-being-called-sometimes.patch +++ b/patches/server/0460-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 291c85c823a24b86235bf7581761c1686f609b82..48ebf9e606079fc091f1c4eed37001bbd0100e55 100644 +index a0bac2fe6222964b098cfaf9470f09c43328fcf5..09e40d6e50b7c1ddd1451981d05ecbbef43cfed2 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1771,7 +1771,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -24,7 +24,7 @@ index 291c85c823a24b86235bf7581761c1686f609b82..48ebf9e606079fc091f1c4eed37001bb } } @@ -2392,13 +2392,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - double d3 = this.player.gameMode.getGameModeForPlayer() == GameType.CREATIVE ? 5.0D : 4.5D; + double d3 = Math.max(this.player.blockInteractionRange(), this.player.entityInteractionRange()); // SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time // SPIGOT-7429: Make sure to call PlayerInteractEvent for spectators and non-pickable entities - org.bukkit.util.RayTraceResult result = this.player.level().getWorld().rayTrace(origin, origin.getDirection(), d3, org.bukkit.FluidCollisionMode.NEVER, false, 0.1, entity -> { @@ -39,7 +39,7 @@ index 291c85c823a24b86235bf7581761c1686f609b82..48ebf9e606079fc091f1c4eed37001bb + GameType gameType = this.player.gameMode.getGameModeForPlayer(); + if (gameType == GameType.ADVENTURE && result.getHitBlock() != null) { + 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) { ++ } else if (gameType != GameType.CREATIVE && result.getHitEntity() != null && origin.toVector().distanceSquared(result.getHitPosition()) > this.player.entityInteractionRange() * this.player.entityInteractionRange()) { + CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_AIR, this.player.getInventory().getSelected(), InteractionHand.MAIN_HAND); + } + } // Paper end - Call interact event |