From 9a40df5bd81222dc1d930d8d866dd136ff4b70bc Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 11 May 2020 14:53:58 +1200 Subject: [PATCH] Handle armorstands interaction for commands --- .../utilities/listeners/DisguiseListener.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java b/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java index 1fc23738..d7566702 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java @@ -496,6 +496,21 @@ public class DisguiseListener implements Listener { interactions.remove(p.getName()).onInteract(p, entity); } + @EventHandler + public void onRightClick(PlayerInteractAtEntityEvent event) { + Player p = event.getPlayer(); + + if (!interactions.containsKey(p.getName())) { + return; + } + + event.setCancelled(true); + disguiseRunnable.remove(p.getName()).cancel(); + + Entity entity = event.getRightClicked(); + interactions.remove(p.getName()).onInteract(p, entity); + } + @EventHandler public void onTarget(EntityTargetEvent event) { if (event.getTarget() == null) {