1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2025-07-04 14:44:44 +02:00

Skill Unlock notifications now have sounds

This commit is contained in:
nossr50
2019-01-20 01:21:33 -08:00
parent 6ad9c8e664
commit e962f645b6
4 changed files with 22 additions and 5 deletions
src/main/java/com/gmail/nossr50

@ -8,11 +8,14 @@ import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.events.skills.McMMOPlayerNotificationEvent;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.sounds.SoundManager;
import com.gmail.nossr50.util.sounds.SoundType;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.SoundCategory;
import org.bukkit.entity.Player;
public class NotificationManager {
@ -122,6 +125,9 @@ public class NotificationManager {
//CHAT MESSAGE
mcMMOPlayer.getPlayer().spigot().sendMessage(TextComponentFactory.getSubSkillUnlockedNotificationComponents(mcMMOPlayer.getPlayer(), subSkillType));
//Unlock Sound Effect
SoundManager.sendCategorizedSound(mcMMOPlayer.getPlayer(), mcMMOPlayer.getPlayer().getLocation(), SoundType.SKILL_UNLOCKED, SoundCategory.MASTER);
//ACTION BAR MESSAGE
/*if(AdvancedConfig.getInstance().doesNotificationUseActionBar(NotificationType.SUBSKILL_UNLOCKED))
mcMMOPlayer.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(LocaleLoader.getString("JSON.SkillUnlockMessage",