Fix /npc sound - too many sounds to list valid ones

This commit is contained in:
fullwall 2016-03-03 19:05:22 +08:00
parent a807ee1f38
commit 599d5dd35d
2 changed files with 5 additions and 7 deletions

View File

@ -12,7 +12,6 @@ import org.bukkit.DyeColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.command.BlockCommandSender;
import org.bukkit.command.CommandSender;
@ -1482,8 +1481,7 @@ public class NPCCommands {
String deathSound = npc.data().get(NPC.DEATH_SOUND_METADATA);
String hurtSound = npc.data().get(NPC.HURT_SOUND_METADATA);
if (args.getValueFlags().size() == 0 && args.getFlags().size() == 0) {
Messaging.sendTr(sender, Messages.SOUND_INFO, npc.getName(), ambientSound, hurtSound, deathSound,
Util.listValuesPretty(Sound.values()));
Messaging.sendTr(sender, Messages.SOUND_INFO, npc.getName(), ambientSound, hurtSound, deathSound);
return;
}
@ -1519,11 +1517,11 @@ public class NPCCommands {
npc.data().setPersistent(NPC.AMBIENT_SOUND_METADATA, ambientSound);
}
if (ambientSound.isEmpty())
if (ambientSound != null && ambientSound.isEmpty())
ambientSound = "none";
if (hurtSound.isEmpty())
if (hurtSound != null && hurtSound.isEmpty())
hurtSound = "none";
if (deathSound.isEmpty())
if (deathSound != null && deathSound.isEmpty())
deathSound = "none";
Messaging.sendTr(sender, Messages.SOUND_SET, npc.getName(), ambientSound, hurtSound, deathSound);
}

View File

@ -106,7 +106,7 @@ citizens.commands.npc.size.description=[[{0}]]''s size is [[{1}]].
citizens.commands.npc.size.set=[[{0}]]''s size set to [[{1}]].
citizens.commands.npc.sound.invalid-sound=Invalid sound.
citizens.commands.npc.sound.set=[[{0}]]''s sounds are now: ambient - [[{1}]] hurt - [[{2}]] and death - [[{3}]].
citizens.commands.npc.sound.info=[[{0}]]''s sounds are: ambient - [[{1}]] hurt - [[{2}]] and death - [[{3}]].<br><br>Valid sounds are {4}.
citizens.commands.npc.sound.info=[[{0}]]''s sounds are: ambient - [[{1}]] hurt - [[{2}]] and death - [[{3}]].
citizens.commands.npc.skeletontype.set={0}''s skeleton type set to [[{1}]].
citizens.commands.npc.skeletontype.invalid-type=Invalid skeleton type. Try one of the following: [[{0}]].
citizens.commands.npc.spawn.already-spawned=[[{0}]] is already spawned at another location. Use ''/npc tphere'' to teleport the NPC to your location.