summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2014-01-31 14:42:45 -0600
committerTravis Watkins <amaranth@ubuntu.com>2014-01-31 14:55:01 -0600
commit842962530ac2c603ba63b2f703ddfb623c596dd6 (patch)
tree9c32463fbe46a7010643fd62c2d872fed222836f /src
parent99072710711c6ca72f5c9ad6bd211dc73a294b3e (diff)
downloadcraftbukkit-842962530ac2c603ba63b2f703ddfb623c596dd6.tar
craftbukkit-842962530ac2c603ba63b2f703ddfb623c596dd6.tar.gz
craftbukkit-842962530ac2c603ba63b2f703ddfb623c596dd6.tar.lz
craftbukkit-842962530ac2c603ba63b2f703ddfb623c596dd6.tar.xz
craftbukkit-842962530ac2c603ba63b2f703ddfb623c596dd6.zip
Don't call duplicate interact air events. Fixes BUKKIT-5359
Previously we attempted to call interact events in cases that were missing by modifying the arm swing logic. This, however, was too broad and started triggering events in cases we already covered leading to duplicates. Since the only case we can handle cleanly and the primary point of the previous fix was fluids we now instead simply treat fluids as air for this check. This also ensures we do not get duplicate events when the player is in a fluid and hits a normal block, unlike the previous change. This reverts commit 68b702f7 and replaces it with a better fix.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/PlayerConnection.java12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index ee6b0a1e..3b378faf 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -962,19 +962,9 @@ public class PlayerConnection implements PacketPlayInListener {
float f8 = f3 * f5;
double d3 = 5.0D;
Vec3D vec3d1 = vec3d.add((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
- MovingObjectPosition movingobjectposition = this.player.world.rayTrace(vec3d, vec3d1, true);
+ MovingObjectPosition movingobjectposition = this.player.world.rayTrace(vec3d, vec3d1, false);
- boolean valid = false;
if (movingobjectposition == null || movingobjectposition.type != EnumMovingObjectType.BLOCK) {
- valid = true;
- } else {
- Block block = this.player.world.getType(movingobjectposition.b, movingobjectposition.c, movingobjectposition.d);
- if (!block.c()) { // Should be isBreakable?
- valid = true;
- }
- }
-
- if (valid) {
CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_AIR, this.player.inventory.getItemInHand());
}