mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	Fix sounds being disabled by default
This commit is contained in:
		@@ -15,6 +15,7 @@ public class ConfigPlayerNotifications {
 | 
			
		||||
        NOTIFICATION_MAP_DEFAULT = new HashMap<>();
 | 
			
		||||
 | 
			
		||||
        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.REQUIREMENTS_NOT_MET, new PlayerNotificationSettings(true, false, true));
 | 
			
		||||
        NOTIFICATION_MAP_DEFAULT.put(NotificationType.ABILITY_COOLDOWN, new PlayerNotificationSettings(true, false, true));
 | 
			
		||||
 
 | 
			
		||||
@@ -24,11 +24,13 @@ public class SoundSetting {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public SoundSetting(double volume, double pitch) {
 | 
			
		||||
        this.enabled = true;
 | 
			
		||||
        this.volume = (float) volume;
 | 
			
		||||
        this.pitch = (float) pitch;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public SoundSetting(double volume) {
 | 
			
		||||
        this.enabled = true;
 | 
			
		||||
        this.volume = (float) volume;
 | 
			
		||||
        this.pitch = 1.0F;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -842,9 +842,6 @@ public class McMMOPlayer {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Notify people that ability has been activated
 | 
			
		||||
        ParticleEffectUtils.playAbilityEnabledEffect(player);
 | 
			
		||||
 | 
			
		||||
        if (useChatNotifications()) {
 | 
			
		||||
            mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUPER_ABILITY, ability.getAbilityOn());
 | 
			
		||||
            //player.sendMessage(ability.getAbilityOn());
 | 
			
		||||
 
 | 
			
		||||
@@ -39,9 +39,7 @@ public class AbilityDisableTask extends BukkitRunnable {
 | 
			
		||||
                // Fallthrough
 | 
			
		||||
 | 
			
		||||
            case BERSERK:
 | 
			
		||||
                if (MainConfig.getInstance().getRefreshChunksEnabled()) {
 | 
			
		||||
                    resendChunkRadiusAt(player);
 | 
			
		||||
                }
 | 
			
		||||
                resendChunkRadiusAt(player);
 | 
			
		||||
                // Fallthrough
 | 
			
		||||
 | 
			
		||||
            default:
 | 
			
		||||
@@ -53,8 +51,6 @@ public class AbilityDisableTask extends BukkitRunnable {
 | 
			
		||||
        mcMMOPlayer.setAbilityMode(ability, false);
 | 
			
		||||
        mcMMOPlayer.setAbilityInformed(ability, false);
 | 
			
		||||
 | 
			
		||||
        ParticleEffectUtils.playAbilityDisabledEffect(player);
 | 
			
		||||
 | 
			
		||||
        if (mcMMOPlayer.useChatNotifications()) {
 | 
			
		||||
            //player.sendMessage(ability.getAbilityOff());
 | 
			
		||||
            mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.ABILITY_OFF, ability.getAbilityOff());
 | 
			
		||||
 
 | 
			
		||||
@@ -73,24 +73,6 @@ public final class ParticleEffectUtils {
 | 
			
		||||
        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) {
 | 
			
		||||
        Location location = player.getLocation();
 | 
			
		||||
        location.setY(location.getY() + (player.isInsideVehicle() ? 1.0 : -1.0));
 | 
			
		||||
 
 | 
			
		||||
@@ -31,6 +31,8 @@ import java.util.List;
 | 
			
		||||
 | 
			
		||||
public class SkillUtils {
 | 
			
		||||
 | 
			
		||||
    public static final int ENCHANT_SPEED_VAR = 5;
 | 
			
		||||
 | 
			
		||||
    public static void applyXpGain(McMMOPlayer mcMMOPlayer, PrimarySkillType skill, float xp, XPGainReason xpGainReason) {
 | 
			
		||||
        mcMMOPlayer.beginXpGain(skill, xp, xpGainReason, XPGainSource.SELF);
 | 
			
		||||
    }
 | 
			
		||||
@@ -162,7 +164,7 @@ public class SkillUtils {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        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);
 | 
			
		||||
        heldItem.setItemMeta(itemMeta);
 | 
			
		||||
@@ -227,10 +229,10 @@ public class SkillUtils {
 | 
			
		||||
            if (itemLore.remove("mcMMO Ability Tool")) {
 | 
			
		||||
                int efficiencyLevel = item.getEnchantmentLevel(Enchantment.DIG_SPEED);
 | 
			
		||||
 | 
			
		||||
                if (efficiencyLevel <= AdvancedConfig.getInstance().getEnchantBuff()) {
 | 
			
		||||
                if (efficiencyLevel <= ENCHANT_SPEED_VAR) {
 | 
			
		||||
                    itemMeta.removeEnchant(Enchantment.DIG_SPEED);
 | 
			
		||||
                } else {
 | 
			
		||||
                    itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel - AdvancedConfig.getInstance().getEnchantBuff(), true);
 | 
			
		||||
                    itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel - ENCHANT_SPEED_VAR, true);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                itemMeta.setLore(itemLore);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user