This commit is contained in:
Jesse Boyd
2015-10-21 18:31:14 +11:00
parent a6dad4fb7b
commit 6650ea2a4c
5 changed files with 74 additions and 17 deletions

View File

@ -1135,9 +1135,15 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
lb = new BukkitLazyBlock(blockId, block);
final ItemStack hand = player.getItemInHand();
if ((eventType != null) && !player.isSneaking()) {
break;
break;
}
Material type = hand == null ? null : hand.getType();
int id = type == null ? 0 : type.getId();
if ((hand == null) || (hand.getType() == Material.AIR) || hand.getType().isBlock()) {
if (id == 0) {
eventType = PlayerBlockEventType.INTERACT_BLOCK;
lb = new BukkitLazyBlock(id, block);
break;
} else if (id < 198) {
eventType = PlayerBlockEventType.PLACE_BLOCK;
lb = new BukkitLazyBlock(id, block);
break;