1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 20:16:13 +01:00

Sound fix

This commit is contained in:
Zrips 2016-03-02 16:14:44 +02:00
parent b097296931
commit d2299bfe03
3 changed files with 25 additions and 8 deletions

View File

@ -328,6 +328,14 @@ public class PlayerManager {
// }
}
private Sound getSound(String soundName) {
for (Sound one : Sound.values()) {
if (one.name().equalsIgnoreCase(soundName))
return one;
}
return null;
}
/**
* Broadcasts level up about a player
* @param jPlayer
@ -352,8 +360,13 @@ public class PlayerManager {
if (levelUpEvent.isCancelled())
return;
if (ConfigManager.getJobsConfiguration().SoundLevelupUse)
player.getWorld().playSound(player.getLocation(), Sound.valueOf(levelUpEvent.getSoundName()), levelUpEvent.getSoundVolume(), levelUpEvent.getSoundPitch());
if (ConfigManager.getJobsConfiguration().SoundLevelupUse) {
Sound sound = getSound(levelUpEvent.getSoundName());
if (sound != null)
player.getWorld().playSound(player.getLocation(), sound, levelUpEvent.getSoundVolume(), levelUpEvent.getSoundPitch());
else
Bukkit.getConsoleSender().sendMessage("[Jobs] Cant find sound by name: " + levelUpEvent.getTitleChangeSoundName() + ". Please update it");
}
String message;
if (ConfigManager.getJobsConfiguration().isBroadcastingLevelups()) {
@ -388,10 +401,14 @@ public class PlayerManager {
if (levelUpEvent.getNewTitle() != null && !levelUpEvent.getNewTitle().equals(levelUpEvent.getOldTitle())) {
if (ConfigManager.getJobsConfiguration().SoundTitleChangeUse)
player.getWorld().playSound(player.getLocation(), Sound.valueOf(levelUpEvent.getTitleChangeSoundName()), levelUpEvent.getTitleChangeVolume(), levelUpEvent
.getTitleChangePitch());
if (ConfigManager.getJobsConfiguration().SoundTitleChangeUse) {
Sound sound = getSound(levelUpEvent.getTitleChangeSoundName());
if (sound != null)
player.getWorld().playSound(player.getLocation(), sound, levelUpEvent.getTitleChangeVolume(),
levelUpEvent.getTitleChangePitch());
else
Bukkit.getConsoleSender().sendMessage("[Jobs] Cant find sound by name: " + levelUpEvent.getTitleChangeSoundName() + ". Please update it");
}
// user would skill up
if (ConfigManager.getJobsConfiguration().isBroadcastingSkillups()) {
message = Language.getMessage("message.skillup.broadcast");

View File

@ -326,7 +326,7 @@ public class JobsPaymentListener implements Listener {
multiplier = multiplier * ConfigManager.getJobsConfiguration().gigaDrillMultiplier;
else if (AbilityAPI.superBreakerEnabled(player))
multiplier = multiplier * ConfigManager.getJobsConfiguration().superBreakerMultiplier;
} catch (IndexOutOfBoundsException e) {
} catch (Exception e) {
}
// Item in hand

View File

@ -1,7 +1,7 @@
name: Jobs
description: Jobs Plugin for the BukkitAPI
main: com.gamingmesh.jobs.JobsPlugin
version: 2.63.0
version: 2.63.1
author: phrstbrn
softdepend: [Vault, CoreProtect, MythicMobs, McMMO]
commands: