mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-26 04:25:21 +01:00
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:
parent
85687c86b5
commit
5937eb0631
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user