From f6113cb774eaa482641a59746d56b9dd8e6437ac Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 6 Nov 2013 22:23:46 +1300 Subject: [PATCH] Change potioneffect to potioneffecttype. Fix not having it in displayed opens. --- src/me/libraryaddict/disguise/BaseDisguiseCommand.java | 6 ++++-- .../disguise/commands/DisguiseHelpCommand.java | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/me/libraryaddict/disguise/BaseDisguiseCommand.java b/src/me/libraryaddict/disguise/BaseDisguiseCommand.java index 27e787b8..4d6bfe21 100644 --- a/src/me/libraryaddict/disguise/BaseDisguiseCommand.java +++ b/src/me/libraryaddict/disguise/BaseDisguiseCommand.java @@ -235,13 +235,15 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { } // Parse to potion effect - } else if (param == PotionEffect.class) { + } else if (param == PotionEffectType.class) { try { PotionEffectType potionType = PotionEffectType.getByName(valueString.toUpperCase()); if (potionType == null && isNumeric(valueString)) { potionType = PotionEffectType.getById(Integer.parseInt(valueString)); } - value = new PotionEffect(potionType, 0, 0); + if (potionType == null) + throw new Exception(); + value = potionType; } catch (Exception ex) { throw parseToException("potioneffect type", valueString, methodName); } diff --git a/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java b/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java index 2d0a4016..2d31dee2 100644 --- a/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java +++ b/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java @@ -104,6 +104,8 @@ public class DisguiseHelpCommand extends BaseDisguiseCommand { valueType = "Ocelot type"; } else if (Profession.class == c) { valueType = "Villager Profession"; + } else if (PotionEffectType.class == c) { + valueType = "Potioneffect Type"; } if (valueType != null) { methods.add(ChatColor.RED + method.getName() + ChatColor.DARK_RED + "(" + ChatColor.GREEN