From 23c012d0e3c394d42d32e8db66710b0d73ed48db Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 27 Jun 2017 14:45:42 +1200 Subject: [PATCH] Fix modify entity command --- src/me/libraryaddict/disguise/DisguiseListener.java | 8 ++++---- .../disguise/commands/DisguiseModifyEntityCommand.java | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/me/libraryaddict/disguise/DisguiseListener.java b/src/me/libraryaddict/disguise/DisguiseListener.java index 2e798607..34ea1e35 100644 --- a/src/me/libraryaddict/disguise/DisguiseListener.java +++ b/src/me/libraryaddict/disguise/DisguiseListener.java @@ -417,13 +417,13 @@ public class DisguiseListener implements Listener { @EventHandler public void onRightClick(PlayerInteractEntityEvent event) { - if (!disguiseEntity.containsKey(event.getPlayer().getName()) && !disguiseClone - .containsKey(event.getPlayer().getName())) { + Player p = event.getPlayer(); + + if (!disguiseEntity.containsKey(p.getName()) && !disguiseClone.containsKey(p.getName()) && !disguiseModify + .containsKey(p.getName())) { return; } - Player p = event.getPlayer(); - event.setCancelled(true); disguiseRunnable.remove(p.getName()).cancel(); diff --git a/src/me/libraryaddict/disguise/commands/DisguiseModifyEntityCommand.java b/src/me/libraryaddict/disguise/commands/DisguiseModifyEntityCommand.java index 6712b24f..b64c103d 100644 --- a/src/me/libraryaddict/disguise/commands/DisguiseModifyEntityCommand.java +++ b/src/me/libraryaddict/disguise/commands/DisguiseModifyEntityCommand.java @@ -39,6 +39,8 @@ public class DisguiseModifyEntityCommand extends DisguiseBaseCommand implements return true; } + // TODO Validate if any disguises have this arg + LibsDisguises.getInstance().getListener().setDisguiseModify(sender.getName(), args); sender.sendMessage(LibsMsg.DMODIFYENT_CLICK.get(DisguiseConfig.getDisguiseEntityExpire()));