Fix sounds being disabled by default

This commit is contained in:
nossr50 2019-06-16 06:46:25 -07:00
parent 726369077e
commit 5a48b568ef
6 changed files with 9 additions and 29 deletions

View File

@ -15,6 +15,7 @@ public class ConfigPlayerNotifications {
NOTIFICATION_MAP_DEFAULT = new HashMap<>(); NOTIFICATION_MAP_DEFAULT = new HashMap<>();
NOTIFICATION_MAP_DEFAULT.put(NotificationType.ABILITY_OFF, new PlayerNotificationSettings(true, false, true)); NOTIFICATION_MAP_DEFAULT.put(NotificationType.ABILITY_OFF, new PlayerNotificationSettings(true, false, true));
NOTIFICATION_MAP_DEFAULT.put(NotificationType.ABILITY_REFRESHED, new PlayerNotificationSettings(true, false, true));
NOTIFICATION_MAP_DEFAULT.put(NotificationType.HARDCORE_MODE, new PlayerNotificationSettings(true, true, true)); NOTIFICATION_MAP_DEFAULT.put(NotificationType.HARDCORE_MODE, new PlayerNotificationSettings(true, true, true));
NOTIFICATION_MAP_DEFAULT.put(NotificationType.REQUIREMENTS_NOT_MET, new PlayerNotificationSettings(true, false, true)); NOTIFICATION_MAP_DEFAULT.put(NotificationType.REQUIREMENTS_NOT_MET, new PlayerNotificationSettings(true, false, true));
NOTIFICATION_MAP_DEFAULT.put(NotificationType.ABILITY_COOLDOWN, new PlayerNotificationSettings(true, false, true)); NOTIFICATION_MAP_DEFAULT.put(NotificationType.ABILITY_COOLDOWN, new PlayerNotificationSettings(true, false, true));

View File

@ -24,11 +24,13 @@ public class SoundSetting {
} }
public SoundSetting(double volume, double pitch) { public SoundSetting(double volume, double pitch) {
this.enabled = true;
this.volume = (float) volume; this.volume = (float) volume;
this.pitch = (float) pitch; this.pitch = (float) pitch;
} }
public SoundSetting(double volume) { public SoundSetting(double volume) {
this.enabled = true;
this.volume = (float) volume; this.volume = (float) volume;
this.pitch = 1.0F; this.pitch = 1.0F;
} }

View File

@ -842,9 +842,6 @@ public class McMMOPlayer {
return; return;
} }
// Notify people that ability has been activated
ParticleEffectUtils.playAbilityEnabledEffect(player);
if (useChatNotifications()) { if (useChatNotifications()) {
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUPER_ABILITY, ability.getAbilityOn()); mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUPER_ABILITY, ability.getAbilityOn());
//player.sendMessage(ability.getAbilityOn()); //player.sendMessage(ability.getAbilityOn());

View File

@ -39,9 +39,7 @@ public class AbilityDisableTask extends BukkitRunnable {
// Fallthrough // Fallthrough
case BERSERK: case BERSERK:
if (MainConfig.getInstance().getRefreshChunksEnabled()) {
resendChunkRadiusAt(player); resendChunkRadiusAt(player);
}
// Fallthrough // Fallthrough
default: default:
@ -53,8 +51,6 @@ public class AbilityDisableTask extends BukkitRunnable {
mcMMOPlayer.setAbilityMode(ability, false); mcMMOPlayer.setAbilityMode(ability, false);
mcMMOPlayer.setAbilityInformed(ability, false); mcMMOPlayer.setAbilityInformed(ability, false);
ParticleEffectUtils.playAbilityDisabledEffect(player);
if (mcMMOPlayer.useChatNotifications()) { if (mcMMOPlayer.useChatNotifications()) {
//player.sendMessage(ability.getAbilityOff()); //player.sendMessage(ability.getAbilityOff());
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.ABILITY_OFF, ability.getAbilityOff()); mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.ABILITY_OFF, ability.getAbilityOff());

View File

@ -73,24 +73,6 @@ public final class ParticleEffectUtils {
livingEntity.getWorld().playEffect(livingEntity.getEyeLocation(), Effect.MOBSPAWNER_FLAMES, 1); livingEntity.getWorld().playEffect(livingEntity.getEyeLocation(), Effect.MOBSPAWNER_FLAMES, 1);
} }
public static void playAbilityEnabledEffect(Player player) {
if (!MainConfig.getInstance().getAbilityActivationEffectEnabled()) {
}
/* if (hasHeadRoom(player)) {
fireworkParticleShower(player, Color.GREEN);
}*/
}
public static void playAbilityDisabledEffect(Player player) {
if (!MainConfig.getInstance().getAbilityDeactivationEffectEnabled()) {
}
/*if (hasHeadRoom(player)) {
fireworkParticleShower(player, Color.RED);
}*/
}
/* public static void fireworkParticleShower(Player player, Color color) { /* public static void fireworkParticleShower(Player player, Color color) {
Location location = player.getLocation(); Location location = player.getLocation();
location.setY(location.getY() + (player.isInsideVehicle() ? 1.0 : -1.0)); location.setY(location.getY() + (player.isInsideVehicle() ? 1.0 : -1.0));

View File

@ -31,6 +31,8 @@ import java.util.List;
public class SkillUtils { public class SkillUtils {
public static final int ENCHANT_SPEED_VAR = 5;
public static void applyXpGain(McMMOPlayer mcMMOPlayer, PrimarySkillType skill, float xp, XPGainReason xpGainReason) { public static void applyXpGain(McMMOPlayer mcMMOPlayer, PrimarySkillType skill, float xp, XPGainReason xpGainReason) {
mcMMOPlayer.beginXpGain(skill, xp, xpGainReason, XPGainSource.SELF); mcMMOPlayer.beginXpGain(skill, xp, xpGainReason, XPGainSource.SELF);
} }
@ -162,7 +164,7 @@ public class SkillUtils {
} }
itemLore.add("mcMMO Ability Tool"); itemLore.add("mcMMO Ability Tool");
itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel + AdvancedConfig.getInstance().getEnchantBuff(), true); itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel + ENCHANT_SPEED_VAR, true);
itemMeta.setLore(itemLore); itemMeta.setLore(itemLore);
heldItem.setItemMeta(itemMeta); heldItem.setItemMeta(itemMeta);
@ -227,10 +229,10 @@ public class SkillUtils {
if (itemLore.remove("mcMMO Ability Tool")) { if (itemLore.remove("mcMMO Ability Tool")) {
int efficiencyLevel = item.getEnchantmentLevel(Enchantment.DIG_SPEED); int efficiencyLevel = item.getEnchantmentLevel(Enchantment.DIG_SPEED);
if (efficiencyLevel <= AdvancedConfig.getInstance().getEnchantBuff()) { if (efficiencyLevel <= ENCHANT_SPEED_VAR) {
itemMeta.removeEnchant(Enchantment.DIG_SPEED); itemMeta.removeEnchant(Enchantment.DIG_SPEED);
} else { } else {
itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel - AdvancedConfig.getInstance().getEnchantBuff(), true); itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel - ENCHANT_SPEED_VAR, true);
} }
itemMeta.setLore(itemLore); itemMeta.setLore(itemLore);