Add error message when a skin name is missing from /npc skin

This commit is contained in:
fullwall 2018-03-09 16:41:01 +08:00
parent bf13181bd1
commit a787465c29
3 changed files with 2 additions and 2 deletions

View File

@ -159,5 +159,4 @@
</plugin>
</plugins>
</build>
</project>

View File

@ -1528,7 +1528,7 @@ public class NPCCommands {
npc.data().remove(NPC.PLAYER_SKIN_UUID_METADATA);
} else {
if (args.argsLength() != 2)
throw new CommandException();
throw new CommandException(Messages.SKIN_REQUIRED);
npc.data().setPersistent(NPC.PLAYER_SKIN_UUID_METADATA, args.getString(1));
if (args.hasFlag('p')) {
npc.data().setPersistent(NPC.PLAYER_SKIN_USE_LATEST, false);

View File

@ -213,6 +213,7 @@ public class Messages {
public static final String SKELETON_TYPE_SET = "citizens.commands.npc.skeletontype.set";
public static final String SKIN_CLEARED = "citizens.commands.npc.skin.cleared";
public static final String SKIN_LAYERS_SET = "citizens.commands.npc.skin.layers-set";
public static final String SKIN_REQUIRED = "citizens.commands.npc.skin.missing-skin";
public static final String SKIN_SET = "citizens.commands.npc.skin.set";
public static final String SKIPPING_BROKEN_TRAIT = "citizens.notifications.skipping-broken-trait";
public static final String SKIPPING_INVALID_ANCHOR = "citizens.notifications.skipping-invalid-anchor";