Deny use of held items in the lobby.

This semi-reverts part of the change in e484583b7e.

We're now specifically denying the use of items if there are any. This doesn't cancel the interact event, but just prevents stuff like potion consumption.
This commit is contained in:
Andreas Troelsen 2018-07-19 15:07:23 +02:00
parent 85687c86b5
commit 5937eb0631

View File

@ -1081,6 +1081,11 @@ public class ArenaListener
Player p = event.getPlayer();
if (!arena.inLobby(p)) return;
// Prevent placing blocks and using held items
if (event.hasItem()) {
event.setUseItemInHand(Result.DENY);
}
// Bail if off-hand or if there's no block involved.
if (event.getHand() == EquipmentSlot.OFF_HAND || !event.hasBlock())
return;