From 0e4a85bc4a81504529b7529fbff0727e3675f33f Mon Sep 17 00:00:00 2001 From: fullwall Date: Wed, 8 May 2013 21:08:12 +0800 Subject: [PATCH] Fix /npc wolf collar parsing --- src/main/java/net/citizensnpcs/commands/NPCCommands.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/citizensnpcs/commands/NPCCommands.java b/src/main/java/net/citizensnpcs/commands/NPCCommands.java index da2e9022a..c53c36861 100644 --- a/src/main/java/net/citizensnpcs/commands/NPCCommands.java +++ b/src/main/java/net/citizensnpcs/commands/NPCCommands.java @@ -1151,7 +1151,7 @@ public class NPCCommands { @Command( aliases = { "npc" }, - usage = "wolf (-s(itting) a(ngry) t(amed)) --collar [rgb color]", + usage = "wolf (-s(itting) a(ngry) t(amed)) --collar [hex rgb color|name]", desc = "Sets wolf modifiers", modifiers = { "wolf" }, min = 1, @@ -1168,9 +1168,9 @@ public class NPCCommands { String unparsed = args.getFlag("collar"); DyeColor color = null; try { - DyeColor.valueOf(unparsed.toUpperCase().replace(' ', '_')); + color = DyeColor.valueOf(unparsed.toUpperCase().replace(' ', '_')); } catch (IllegalArgumentException e) { - int rgb = Integer.parseInt(unparsed.replace("#", "")); + int rgb = Integer.parseInt(unparsed.replace("#", ""), 16); color = DyeColor.getByColor(org.bukkit.Color.fromRGB(rgb)); } if (color == null)