mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-20 06:12:38 +01:00
Fix /npc wolf collar parsing
This commit is contained in:
parent
684d1e0ff0
commit
0e4a85bc4a
@ -1151,7 +1151,7 @@ public class NPCCommands {
|
|||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
aliases = { "npc" },
|
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",
|
desc = "Sets wolf modifiers",
|
||||||
modifiers = { "wolf" },
|
modifiers = { "wolf" },
|
||||||
min = 1,
|
min = 1,
|
||||||
@ -1168,9 +1168,9 @@ public class NPCCommands {
|
|||||||
String unparsed = args.getFlag("collar");
|
String unparsed = args.getFlag("collar");
|
||||||
DyeColor color = null;
|
DyeColor color = null;
|
||||||
try {
|
try {
|
||||||
DyeColor.valueOf(unparsed.toUpperCase().replace(' ', '_'));
|
color = DyeColor.valueOf(unparsed.toUpperCase().replace(' ', '_'));
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
int rgb = Integer.parseInt(unparsed.replace("#", ""));
|
int rgb = Integer.parseInt(unparsed.replace("#", ""), 16);
|
||||||
color = DyeColor.getByColor(org.bukkit.Color.fromRGB(rgb));
|
color = DyeColor.getByColor(org.bukkit.Color.fromRGB(rgb));
|
||||||
}
|
}
|
||||||
if (color == null)
|
if (color == null)
|
||||||
|
Loading…
Reference in New Issue
Block a user