Skip to content

Commit

Permalink
Fix /npc sound - too many sounds to list valid ones
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Mar 3, 2016
1 parent 8ee806f commit 42c2352
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/main/java/net/citizensnpcs/commands/NPCCommands.java
Expand Up @@ -12,7 +12,6 @@
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;
Expand Down Expand Up @@ -1482,8 +1481,7 @@ public void sound(CommandContext args, CommandSender sender, NPC npc) throws Com
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;
}

Expand Down Expand Up @@ -1519,11 +1517,11 @@ public void sound(CommandContext args, CommandSender sender, NPC npc) throws Com
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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/messages_en.properties
Expand Up @@ -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.
Expand Down

0 comments on commit 42c2352

Please sign in to comment.