From 303b12b79feb6c192b718e7102e357b80912c96a Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 16 Jun 2019 09:10:59 -0700 Subject: [PATCH] Add Smelting config options --- .../commands/player/McrankCommand.java | 2 +- .../nossr50/commands/player/MctopCommand.java | 2 +- .../gmail/nossr50/config/AdvancedConfig.java | 55 +------------ .../gmail/nossr50/config/ConfigManager.java | 5 -- .../com/gmail/nossr50/config/MainConfig.java | 68 --------------- .../com/gmail/nossr50/config/SoundConfig.java | 82 ------------------- .../config/hocon/commands/ConfigCommands.java | 7 ++ .../hocon/commands/ConfigCommandsMisc.java | 16 ++++ .../hocon/skills/smelting/ConfigSmelting.java | 28 +++++++ .../smelting/ConfigSmeltingSecondSmelt.java | 48 +++++++++++ .../smelting/ConfigSmeltingSubSkills.java | 30 +++++++ .../gmail/nossr50/datatypes/party/Party.java | 4 +- .../nossr50/datatypes/player/McMMOPlayer.java | 5 +- .../nossr50/listeners/BlockListener.java | 2 - .../com/gmail/nossr50/party/PartyManager.java | 5 +- .../runnables/skills/AbilityDisableTask.java | 2 - .../nossr50/util/commands/CommandUtils.java | 3 +- .../util/skills/ParticleEffectUtils.java | 20 ++--- .../gmail/nossr50/util/skills/SkillUtils.java | 1 - 19 files changed, 146 insertions(+), 239 deletions(-) delete mode 100644 src/main/java/com/gmail/nossr50/config/SoundConfig.java create mode 100644 src/main/java/com/gmail/nossr50/config/hocon/commands/ConfigCommandsMisc.java create mode 100644 src/main/java/com/gmail/nossr50/config/hocon/skills/smelting/ConfigSmeltingSecondSmelt.java create mode 100644 src/main/java/com/gmail/nossr50/config/hocon/skills/smelting/ConfigSmeltingSubSkills.java diff --git a/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java b/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java index 5e09e687e..58d28860b 100644 --- a/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java @@ -96,7 +96,7 @@ public class McrankCommand implements TabExecutor { return; } - long cooldownMillis = Math.max(MainConfig.getInstance().getDatabasePlayerCooldown(), 1750); + long cooldownMillis = 5000; if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) { sender.sendMessage(LocaleLoader.getString("Commands.Database.CooldownMS", getCDSeconds(mcMMOPlayer, cooldownMillis))); diff --git a/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java b/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java index 0d47d0dae..38df376fc 100644 --- a/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java @@ -89,7 +89,7 @@ public class MctopCommand implements TabExecutor { } McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName()); - long cooldownMillis = Math.max(MainConfig.getInstance().getDatabasePlayerCooldown(), 1750); + long cooldownMillis = 5000; if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) { double seconds = ((mcMMOPlayer.getDatabaseATS() + cooldownMillis) - System.currentTimeMillis()) / 1000; diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index 0b27092b8..961381eeb 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -158,36 +158,6 @@ public class AdvancedConfig extends ConfigValidated { /* GENERAL */ - /** - * This returns the maximum level at which superabilities will stop lengthening from scaling alongside skill level. - * It returns a different value depending on whether or not the server is in retro mode - * - * @return the level at which abilities stop increasing in length - */ - public int getAbilityLengthCap() { - if (!mcMMO.isRetroModeEnabled()) - return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, STANDARD, CAP_LEVEL); - else - return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, RETRO_MODE, CAP_LEVEL); - } - - /** - * This returns the frequency at which abilities will increase in length - * It returns a different value depending on whether or not the server is in retro mode - * - * @return the number of levels required per ability length increase - */ - public int getAbilityLength() { - if (!mcMMO.isRetroModeEnabled()) - return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, STANDARD, INCREASE_LEVEL); - else - return getIntValue(SKILLS, GENERAL, ABILITY, LENGTH, RETRO_MODE, INCREASE_LEVEL); - } - - public int getEnchantBuff() { - return getIntValue(SKILLS, GENERAL, ABILITY, ENCHANT_BUFF); - } - /* Notification Settings */ /* FISHING */ @@ -204,30 +174,6 @@ public class AdvancedConfig extends ConfigValidated { } /* MINING */ - public boolean getDoubleDropSilkTouchEnabled() { - return getBooleanValue(SKILLS, MINING, "DoubleDrops", "SilkTouch"); - } - - public double getBlastDamageDecrease(int rank) { - return getDoubleValue(SKILLS, MINING, BLAST_MINING, BLAST_DAMAGE_DECREASE, RANK, String.valueOf(rank)); - } - - public double getOreBonus(int rank) { - return getDoubleValue(SKILLS, MINING, BLAST_MINING, ORE_BONUS, RANK, String.valueOf(rank)); - } - - public double getDebrisReduction(int rank) { - return getDoubleValue(SKILLS, MINING, BLAST_MINING, DEBRIS_REDUCTION, RANK, String.valueOf(rank)); - } - - public int getDropMultiplier(int rank) { - return getIntValue(SKILLS, MINING, BLAST_MINING, DROP_MULTIPLIER, RANK, String.valueOf(rank)); - } - - public double getBlastRadiusModifier(int rank) { - return getDoubleValue(SKILLS, MINING, BLAST_MINING, BLAST_RADIUS, MODIFIER, RANK, String.valueOf(rank)); - } - public double getArcaneSalvageExtractFullEnchantsChance(int rank) { return getDoubleValue(SKILLS, SALVAGE, ARCANE_SALVAGE, EXTRACT_FULL_ENCHANT, RANK, String.valueOf(rank)); } @@ -289,4 +235,5 @@ public class AdvancedConfig extends ConfigValidated { public double getMaxHorseJumpStrength() { return getDoubleValue(SKILLS, TAMING, CALL_OF_THE_WILD, MAX_HORSE_JUMP_STRENGTH); } + } diff --git a/src/main/java/com/gmail/nossr50/config/ConfigManager.java b/src/main/java/com/gmail/nossr50/config/ConfigManager.java index 9afb8a161..87741fa85 100644 --- a/src/main/java/com/gmail/nossr50/config/ConfigManager.java +++ b/src/main/java/com/gmail/nossr50/config/ConfigManager.java @@ -139,7 +139,6 @@ public final class ConfigManager { private ExcavationTreasureConfig excavationTreasureConfig; private HerbalismTreasureConfig herbalismTreasureConfig; private AdvancedConfig advancedConfig; - private SoundConfig soundConfig; /* CONFIG ERRORS */ @@ -351,10 +350,6 @@ public final class ConfigManager { return configCoreSkills.getConfig(); } - public SoundConfig getSoundConfig() { - return soundConfig; - } - public ConfigDatabase getConfigDatabase() { return configDatabase.getConfig(); } diff --git a/src/main/java/com/gmail/nossr50/config/MainConfig.java b/src/main/java/com/gmail/nossr50/config/MainConfig.java index d17c671a5..5cb5ae203 100644 --- a/src/main/java/com/gmail/nossr50/config/MainConfig.java +++ b/src/main/java/com/gmail/nossr50/config/MainConfig.java @@ -234,74 +234,6 @@ public class MainConfig extends ConfigValidated { return reason; } - /* - * GENERAL SETTINGS - */ - - public boolean getShowProfileLoadedMessage() { - return getBooleanValue(GENERAL, SHOW_PROFILE_LOADED); - } - - public boolean getMatchOfflinePlayers() { - return getBooleanValue(COMMANDS, GENERIC, MATCH_OFFLINE_PLAYERS); - } - - public long getDatabasePlayerCooldown() { - return getLongValue(COMMANDS, DATABASE, PLAYER_COOLDOWN); - } - - public boolean getLevelUpSoundsEnabled() { - return getBooleanValue(GENERAL, LEVEL_UP_SOUNDS); - } - - public boolean getRefreshChunksEnabled() { - return getBooleanValue(GENERAL, REFRESH_CHUNKS); - } - - /* Particles */ - public boolean getAbilityActivationEffectEnabled() { - return getBooleanValue(PARTICLES, ABILITY_ACTIVATION); - } - - public boolean getAbilityDeactivationEffectEnabled() { - return getBooleanValue(PARTICLES, ABILITY_DEACTIVATION); - } - - public boolean getBleedEffectEnabled() { - return getBooleanValue(PARTICLES, BLEED); - } - - public boolean getDodgeEffectEnabled() { - return getBooleanValue(PARTICLES, DODGE); - } - - public boolean getFluxEffectEnabled() { - return getBooleanValue(PARTICLES, FLUX); - } - - public boolean getGreaterImpactEffectEnabled() { - return getBooleanValue(PARTICLES, GREATER_IMPACT); - } - - public boolean getCallOfTheWildEffectEnabled() { - return getBooleanValue(PARTICLES, CALL_OF_THE_WILD); - } - - public boolean getLevelUpEffectsEnabled() { - return getBooleanValue(PARTICLES, LEVEL_UP + ENABLED); - } - - public int getLevelUpEffectsTier() { - return getIntValue(PARTICLES, LEVEL_UP + TIER); - } - - /* - * SKILL SETTINGS - */ - public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) { - return getBooleanValue(DOUBLE_DROPS, StringUtils.getCapitalized(skill.toString()), StringUtils.getPrettyItemString(material).replace(" ", "_")); - } - public boolean getPreventHopperTransferIngredients() { return getBooleanValue(SKILLS, ALCHEMY, PREVENT_HOPPER_TRANSFER_INGREDIENTS); } diff --git a/src/main/java/com/gmail/nossr50/config/SoundConfig.java b/src/main/java/com/gmail/nossr50/config/SoundConfig.java deleted file mode 100644 index 2d71882ab..000000000 --- a/src/main/java/com/gmail/nossr50/config/SoundConfig.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.gmail.nossr50.config; - -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.sounds.SoundType; -import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; - -import java.util.ArrayList; -import java.util.List; - -@ConfigSerializable -public class SoundConfig extends ConfigValidated { - public static final String SOUNDS = "Sounds"; - public static final String VOLUME = "Volume"; - public static final String PITCH = "Pitch"; - public static final String ENABLED = "Enabled"; - public static final String MASTER_VOLUME = "MasterVolume"; - //private static SoundConfig instance; - - public SoundConfig() { - //super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "sounds.yml", true); - super("sounds", mcMMO.p.getDataFolder().getAbsoluteFile(), ConfigConstants.RELATIVE_PATH_CONFIG_DIR, true, true, true, true); - } - - /** - * This grabs an instance of this config class from the Config Manager - * This method is deprecated and will be removed in the future - * - * @return the instance of this config - * @see mcMMO#getConfigManager() - * @deprecated Please use mcMMO.getConfigManager() to grab a specific config instead - */ - @Deprecated - public static SoundConfig getInstance() { - return mcMMO.getConfigManager().getSoundConfig(); - } - - /** - * The version of this config - * - * @return - */ - @Override - public double getConfigVersion() { - return 1; - } - - @Override - public List validateKeys() { - ArrayList reasons = new ArrayList<>(); - - for (SoundType soundType : SoundType.values()) { - if (getDoubleValue(SOUNDS, soundType.toString(), VOLUME) < 0) { - reasons.add("[mcMMO] Sound volume cannot be below 0 for " + soundType.toString()); - } - - //Sounds with custom pitching don't use pitch values - if (!soundType.usesCustomPitch()) { - if (getDoubleValue(SOUNDS, soundType.toString(), PITCH) < 0) { - reasons.add("[mcMMO] Sound pitch cannot be below 0 for " + soundType.toString()); - } - } - } - - return reasons; - } - - public float getMasterVolume() { - return (float) getDoubleValue(SOUNDS, MASTER_VOLUME); - } - - public float getVolume(SoundType soundType) { - return (float) getDoubleValue(SOUNDS, soundType.toString(), VOLUME); - } - - public float getPitch(SoundType soundType) { - return (float) getDoubleValue(SOUNDS, soundType.toString(), PITCH); - } - - public boolean getIsEnabled(SoundType soundType) { - return getBooleanValue(SOUNDS, soundType.toString(), ENABLED); - } -} diff --git a/src/main/java/com/gmail/nossr50/config/hocon/commands/ConfigCommands.java b/src/main/java/com/gmail/nossr50/config/hocon/commands/ConfigCommands.java index 5247d312b..12b8ad320 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/commands/ConfigCommands.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/commands/ConfigCommands.java @@ -15,6 +15,13 @@ public class ConfigCommands { @Setting(value = "Skills", comment = "Settings related to skill commands like /mining or /herbalism") private ConfigCommandsSkills skills = new ConfigCommandsSkills(); + @Setting(value = "Misc", comment = "Various settings for commands that don't fit into other categories.") + private ConfigCommandsMisc misc = new ConfigCommandsMisc(); + + public ConfigCommandsMisc getMisc() { + return misc; + } + public ConfigCommandsAdminChat getAdminChat() { return adminChat; } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/commands/ConfigCommandsMisc.java b/src/main/java/com/gmail/nossr50/config/hocon/commands/ConfigCommandsMisc.java new file mode 100644 index 000000000..d6f4e5605 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/commands/ConfigCommandsMisc.java @@ -0,0 +1,16 @@ +package com.gmail.nossr50.config.hocon.commands; + +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; + +@ConfigSerializable +public class ConfigCommandsMisc { + + private static final boolean MATCH_OFFLINE = true; + @Setting(value = "Match-Offline", comment = "If set to true mcMMO will attempt to match player names from commands to any player that exists in the DB, otherwise it will only try to match online players.") + private boolean matchOffline = MATCH_OFFLINE; + + public boolean isMatchOfflinePlayers() { + return matchOffline; + } +} diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/smelting/ConfigSmelting.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/smelting/ConfigSmelting.java index bbd33659d..bfb8c1558 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/smelting/ConfigSmelting.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/smelting/ConfigSmelting.java @@ -1,8 +1,36 @@ package com.gmail.nossr50.config.hocon.skills.smelting; +import com.gmail.nossr50.config.ConfigConstants; +import com.gmail.nossr50.datatypes.skills.properties.MaxBonusLevel; +import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; +import java.util.HashMap; + @ConfigSerializable public class ConfigSmelting { + @Setting(value = ConfigConstants.SUB_SKILL_NODE) + private ConfigSmeltingSubSkills subskills = new ConfigSmeltingSubSkills(); + + public ConfigSmeltingSubSkills getSubskills() { + return subskills; + } + + public ConfigSmeltingSecondSmelt getSmeltingSecondSmelt() { + return subskills.getSmeltingSecondSmelt(); + } + + + public double getMaxChance() { + return subskills.getMaxChance(); + } + + public MaxBonusLevel getMaxBonusLevel() { + return subskills.getMaxBonusLevel(); + } + + public HashMap getXpMultiplierTable() { + return subskills.getXpMultiplierTable(); + } } \ No newline at end of file diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/smelting/ConfigSmeltingSecondSmelt.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/smelting/ConfigSmeltingSecondSmelt.java new file mode 100644 index 000000000..ade22f3ae --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/smelting/ConfigSmeltingSecondSmelt.java @@ -0,0 +1,48 @@ +package com.gmail.nossr50.config.hocon.skills.smelting; + +import com.gmail.nossr50.config.ConfigConstants; +import com.gmail.nossr50.datatypes.skills.properties.AbstractMaxBonusLevel; +import com.gmail.nossr50.datatypes.skills.properties.MaxBonusLevel; +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; + +import java.util.HashMap; + +@ConfigSerializable +public class ConfigSmeltingSecondSmelt { + + private final static HashMap XP_MULT_MAP_DEFAULT; + + static { + XP_MULT_MAP_DEFAULT = new HashMap<>(); + XP_MULT_MAP_DEFAULT.put(1, 1); + XP_MULT_MAP_DEFAULT.put(2, 2); + XP_MULT_MAP_DEFAULT.put(3, 3); + XP_MULT_MAP_DEFAULT.put(4, 3); + XP_MULT_MAP_DEFAULT.put(5, 4); + XP_MULT_MAP_DEFAULT.put(6, 4); + XP_MULT_MAP_DEFAULT.put(7, 5); + XP_MULT_MAP_DEFAULT.put(8, 5); + } + + @Setting(value = ConfigConstants.MAX_CHANCE_FIELD_NAME, comment = ConfigConstants.MAX_CHANCE_FIELD_DESCRIPTION) + private double maxChance = 50.0; + + @Setting(value = ConfigConstants.MAX_BONUS_LEVEL_FIELD_NAME, comment = ConfigConstants.MAX_BONUS_LEVEL_DESCRIPTION) + private MaxBonusLevel maxBonusLevel = new AbstractMaxBonusLevel(100); + + public double getMaxChance() { + return maxChance; + } + + public MaxBonusLevel getMaxBonusLevel() { + return maxBonusLevel; + } + + @Setting(value = "XP-Multiplier-Per-Rank") + private HashMap xpMultiplierTable = XP_MULT_MAP_DEFAULT; + + public HashMap getXpMultiplierTable() { + return xpMultiplierTable; + } +} diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/smelting/ConfigSmeltingSubSkills.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/smelting/ConfigSmeltingSubSkills.java new file mode 100644 index 000000000..46f017cb0 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/smelting/ConfigSmeltingSubSkills.java @@ -0,0 +1,30 @@ +package com.gmail.nossr50.config.hocon.skills.smelting; + +import com.gmail.nossr50.datatypes.skills.properties.MaxBonusLevel; +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; + +import java.util.HashMap; + +@ConfigSerializable +public class ConfigSmeltingSubSkills { + + @Setting(value = "Second-Smelt") + private ConfigSmeltingSecondSmelt smeltingSecondSmelt = new ConfigSmeltingSecondSmelt(); + + public ConfigSmeltingSecondSmelt getSmeltingSecondSmelt() { + return smeltingSecondSmelt; + } + + public double getMaxChance() { + return smeltingSecondSmelt.getMaxChance(); + } + + public MaxBonusLevel getMaxBonusLevel() { + return smeltingSecondSmelt.getMaxBonusLevel(); + } + + public HashMap getXpMultiplierTable() { + return smeltingSecondSmelt.getXpMultiplierTable(); + } +} diff --git a/src/main/java/com/gmail/nossr50/datatypes/party/Party.java b/src/main/java/com/gmail/nossr50/datatypes/party/Party.java index 856c11712..b2a4ab4f6 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/party/Party.java +++ b/src/main/java/com/gmail/nossr50/datatypes/party/Party.java @@ -238,9 +238,7 @@ public class Party { if (leader != null) { leader.sendMessage(LocaleLoader.getString("Party.LevelUp", levelsGained, getLevel())); - if (MainConfig.getInstance().getLevelUpSoundsEnabled()) { - SoundManager.sendSound(leader, leader.getLocation(), SoundType.LEVEL_UP); - } + SoundManager.sendSound(leader, leader.getLocation(), SoundType.LEVEL_UP); } return; } diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java index f663655a0..4be224a17 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java @@ -41,7 +41,6 @@ import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.experience.ExperienceBarManager; import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; -import com.gmail.nossr50.util.skills.ParticleEffectUtils; import com.gmail.nossr50.util.skills.PerksUtils; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillUtils; @@ -590,9 +589,7 @@ public class McMMOPlayer { return; } - if (MainConfig.getInstance().getLevelUpSoundsEnabled()) { - SoundManager.sendSound(player, player.getLocation(), SoundType.LEVEL_UP); - } + SoundManager.sendSound(player, player.getLocation(), SoundType.LEVEL_UP); /* * Check to see if the player unlocked any new skills diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index 9684ad114..fd18f61d5 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -22,7 +22,6 @@ import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.UserManager; -import com.gmail.nossr50.util.skills.SkillUtils; import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundType; import com.gmail.nossr50.worldguard.WorldGuardManager; @@ -562,7 +561,6 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onBlockDamageCleanup(BlockDamageEvent event) { Player player = event.getPlayer(); - McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); //Profile not loaded if (UserManager.getPlayer(player) == null) { diff --git a/src/main/java/com/gmail/nossr50/party/PartyManager.java b/src/main/java/com/gmail/nossr50/party/PartyManager.java index fa36d107d..004413d06 100644 --- a/src/main/java/com/gmail/nossr50/party/PartyManager.java +++ b/src/main/java/com/gmail/nossr50/party/PartyManager.java @@ -821,13 +821,10 @@ public final class PartyManager { * @param level The current party level */ public static void informPartyMembersLevelUp(Party party, int levelsGained, int level) { - boolean levelUpSoundsEnabled = MainConfig.getInstance().getLevelUpSoundsEnabled(); for (Player member : party.getOnlineMembers()) { member.sendMessage(LocaleLoader.getString("Party.LevelUp", levelsGained, level)); - if (levelUpSoundsEnabled) { - SoundManager.sendSound(member, member.getLocation(), SoundType.LEVEL_UP); - } + SoundManager.sendSound(member, member.getLocation(), SoundType.LEVEL_UP); } } diff --git a/src/main/java/com/gmail/nossr50/runnables/skills/AbilityDisableTask.java b/src/main/java/com/gmail/nossr50/runnables/skills/AbilityDisableTask.java index 0e254e55a..b50075859 100644 --- a/src/main/java/com/gmail/nossr50/runnables/skills/AbilityDisableTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/skills/AbilityDisableTask.java @@ -1,13 +1,11 @@ package com.gmail.nossr50.runnables.skills; -import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.skills.ParticleEffectUtils; import com.gmail.nossr50.util.skills.PerksUtils; import com.gmail.nossr50.util.skills.SkillUtils; import org.bukkit.Chunk; diff --git a/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java b/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java index f25d06d5a..adad0198b 100644 --- a/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java +++ b/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.util.commands; -import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.core.MetadataConstants; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.PlayerProfile; @@ -270,7 +269,7 @@ public final class CommandUtils { * @return Matched name or {@code partialName} if no match was found */ public static String getMatchedPlayerName(String partialName) { - if (MainConfig.getInstance().getMatchOfflinePlayers()) { + if (mcMMO.getConfigManager().getConfigCommands().getMisc().isMatchOfflinePlayers()) { List matches = matchPlayer(partialName); if (matches.size() == 1) { diff --git a/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java b/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java index 1ea153b33..a10dd9337 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java @@ -16,25 +16,25 @@ public final class ParticleEffectUtils { } public static void playBleedEffect(LivingEntity livingEntity) { - if (!MainConfig.getInstance().getBleedEffectEnabled()) { + /*if (!MainConfig.getInstance().getBleedEffectEnabled()) { return; - } + }*/ livingEntity.getWorld().playEffect(livingEntity.getEyeLocation(), Effect.STEP_SOUND, Material.REDSTONE_WIRE); } public static void playDodgeEffect(Player player) { - if (!MainConfig.getInstance().getDodgeEffectEnabled()) { + /*if (!MainConfig.getInstance().getDodgeEffectEnabled()) { return; - } + }*/ playSmokeEffect(player); } public static void playFluxEffect(Location location) { - if (!MainConfig.getInstance().getFluxEffectEnabled()) { + /*if (!MainConfig.getInstance().getFluxEffectEnabled()) { return; - } + }*/ location.getWorld().playEffect(location, Effect.MOBSPAWNER_FLAMES, 1); } @@ -56,9 +56,9 @@ public final class ParticleEffectUtils { } public static void playGreaterImpactEffect(LivingEntity livingEntity) { - if (!MainConfig.getInstance().getGreaterImpactEffectEnabled()) { + /*if (!MainConfig.getInstance().getGreaterImpactEffectEnabled()) { return; - } + }*/ Location location = livingEntity.getEyeLocation(); @@ -66,9 +66,9 @@ public final class ParticleEffectUtils { } public static void playCallOfTheWildEffect(LivingEntity livingEntity) { - if (!MainConfig.getInstance().getCallOfTheWildEffectEnabled()) { + /*if (!MainConfig.getInstance().getCallOfTheWildEffectEnabled()) { return; - } + }*/ livingEntity.getWorld().playEffect(livingEntity.getEyeLocation(), Effect.MOBSPAWNER_FLAMES, 1); } diff --git a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java index dd077fd76..7920b8e38 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.util.skills; -import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.experience.XPGainSource; import com.gmail.nossr50.datatypes.interactions.NotificationType;