From 3cef996a245c6730f0f52546b4c73fe124883780 Mon Sep 17 00:00:00 2001 From: fullwall Date: Tue, 17 Sep 2019 19:30:09 +0800 Subject: [PATCH] Fix /npc sound -n bug --- main/src/main/java/net/citizensnpcs/commands/NPCCommands.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java b/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java index bac668180..71ca8bda7 100644 --- a/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java +++ b/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java @@ -37,6 +37,7 @@ import com.google.common.base.Joiner; import com.google.common.base.Splitter; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; +import com.mysql.jdbc.StringUtils; import net.citizensnpcs.Citizens; import net.citizensnpcs.Settings.Setting; @@ -1746,7 +1747,8 @@ public class NPCCommands { if (deathSound != null && deathSound.isEmpty()) { deathSound = "none"; } - if (ambientSound != null || deathSound != null || hurtSound != null) { + if (!StringUtils.isNullOrEmpty(ambientSound) || !StringUtils.isNullOrEmpty(deathSound) + || !StringUtils.isNullOrEmpty(hurtSound)) { npc.data().setPersistent(NPC.SILENT_METADATA, false); } Messaging.sendTr(sender, Messages.SOUND_SET, npc.getName(), ambientSound, hurtSound, deathSound);