From 5937eb0631a33aa26de10b71907eae5327b80b14 Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Thu, 19 Jul 2018 15:07:23 +0200 Subject: [PATCH] Deny use of held items in the lobby. This semi-reverts part of the change in e484583b7e0456da3c0287a1db26f473fde3d0f5. 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. --- src/main/java/com/garbagemule/MobArena/ArenaListener.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/garbagemule/MobArena/ArenaListener.java b/src/main/java/com/garbagemule/MobArena/ArenaListener.java index 68d437e..e22ee03 100644 --- a/src/main/java/com/garbagemule/MobArena/ArenaListener.java +++ b/src/main/java/com/garbagemule/MobArena/ArenaListener.java @@ -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;