From 3d0c2e6b1409ca0c42b7aafbffae4b517d7db48c Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 29 Jan 2016 16:59:00 +1300 Subject: [PATCH] md_5's player interaction for specs patch diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java index d3b1586..6fd49b3 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1206,6 +1206,17 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList if (movingobjectposition == null || movingobjectposition.type != MovingObjectPosition.EnumMovingObjectType.BLOCK) { CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_AIR, this.player.inventory.getItemInHand()); } + // Spigot start + else if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.BLOCK + && (player.playerInteractManager.getGameMode() == WorldSettings.EnumGamemode.ADVENTURE || player.playerInteractManager.getGameMode() == WorldSettings.EnumGamemode.SPECTATOR)) { + // RIGHT_CLICK_BLOCK sets this flag + if (player.playerInteractManager.firedInteract) { + player.playerInteractManager.firedInteract = false; + } else { + CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, movingobjectposition.a(), movingobjectposition.direction, player.inventory.getItemInHand(), true); + } + } + // Spigot end // Arm swing animation PlayerAnimationEvent event = new PlayerAnimationEvent(this.getPlayer()); -- 1.9.5.msysgit.0