Further fix to /npc sound

This commit is contained in:
fullwall 2019-09-17 19:44:43 +08:00
parent 3cef996a24
commit b3589e40f9

View File

@ -1747,8 +1747,9 @@ public class NPCCommands {
if (deathSound != null && deathSound.isEmpty()) { if (deathSound != null && deathSound.isEmpty()) {
deathSound = "none"; deathSound = "none";
} }
if (!StringUtils.isNullOrEmpty(ambientSound) || !StringUtils.isNullOrEmpty(deathSound) if ((!StringUtils.isNullOrEmpty(ambientSound) && !ambientSound.equals("none"))
|| !StringUtils.isNullOrEmpty(hurtSound)) { || (!StringUtils.isNullOrEmpty(deathSound) && !deathSound.equals("none"))
|| (!StringUtils.isNullOrEmpty(hurtSound) && !hurtSound.equals("none"))) {
npc.data().setPersistent(NPC.SILENT_METADATA, false); npc.data().setPersistent(NPC.SILENT_METADATA, false);
} }
Messaging.sendTr(sender, Messages.SOUND_SET, npc.getName(), ambientSound, hurtSound, deathSound); Messaging.sendTr(sender, Messages.SOUND_SET, npc.getName(), ambientSound, hurtSound, deathSound);