mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 11:44:42 +02:00
Refactoring code part 1 to prep for adding a bunch of unit tests
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.meta.BonusDropMeta;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
@ -53,7 +52,7 @@ public final class BlockUtils {
|
||||
* @return true if the player succeeded in the check
|
||||
*/
|
||||
public static boolean checkDoubleDrops(Player player, BlockState blockState, PrimarySkillType skillType, SubSkillType subSkillType) {
|
||||
if (Config.getInstance().getDoubleDropsEnabled(skillType, blockState.getType()) && Permissions.isSubSkillEnabled(player, subSkillType)) {
|
||||
if (mcMMO.p.getGeneralConfig().getDoubleDropsEnabled(skillType, blockState.getType()) && Permissions.isSubSkillEnabled(player, subSkillType)) {
|
||||
return RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkill(player, subSkillType, true));
|
||||
}
|
||||
|
||||
@ -68,10 +67,10 @@ public final class BlockUtils {
|
||||
*/
|
||||
public static boolean shouldBeWatched(BlockState blockState) {
|
||||
return affectedByGigaDrillBreaker(blockState) || affectedByGreenTerra(blockState) || affectedBySuperBreaker(blockState) || hasWoodcuttingXP(blockState)
|
||||
|| Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.MINING, blockState.getType())
|
||||
|| Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.EXCAVATION, blockState.getType())
|
||||
|| Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.WOODCUTTING, blockState.getType())
|
||||
|| Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.SMELTING, blockState.getType());
|
||||
|| mcMMO.p.getGeneralConfig().getDoubleDropsEnabled(PrimarySkillType.MINING, blockState.getType())
|
||||
|| mcMMO.p.getGeneralConfig().getDoubleDropsEnabled(PrimarySkillType.EXCAVATION, blockState.getType())
|
||||
|| mcMMO.p.getGeneralConfig().getDoubleDropsEnabled(PrimarySkillType.WOODCUTTING, blockState.getType())
|
||||
|| mcMMO.p.getGeneralConfig().getDoubleDropsEnabled(PrimarySkillType.SMELTING, blockState.getType());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
@ -37,7 +36,7 @@ public final class ChimaeraWing {
|
||||
* @param player Player whose item usage to check
|
||||
*/
|
||||
public static void activationCheck(Player player) {
|
||||
if (!Config.getInstance().getChimaeraEnabled()) {
|
||||
if (!mcMMO.p.getGeneralConfig().getChimaeraEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -64,13 +63,13 @@ public final class ChimaeraWing {
|
||||
|
||||
int amount = inHand.getAmount();
|
||||
|
||||
if (amount < Config.getInstance().getChimaeraUseCost()) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.NotEnough",String.valueOf(Config.getInstance().getChimaeraUseCost() - amount), "Item.ChimaeraWing.Name");
|
||||
if (amount < mcMMO.p.getGeneralConfig().getChimaeraUseCost()) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.NotEnough",String.valueOf(mcMMO.p.getGeneralConfig().getChimaeraUseCost() - amount), "Item.ChimaeraWing.Name");
|
||||
return;
|
||||
}
|
||||
|
||||
long lastTeleport = mcMMOPlayer.getChimeraWingLastUse();
|
||||
int cooldown = Config.getInstance().getChimaeraCooldown();
|
||||
int cooldown = mcMMO.p.getGeneralConfig().getChimaeraCooldown();
|
||||
|
||||
if (cooldown > 0) {
|
||||
int timeRemaining = SkillUtils.calculateTimeLeft(lastTeleport * Misc.TIME_CONVERSION_FACTOR, cooldown, player);
|
||||
@ -82,7 +81,7 @@ public final class ChimaeraWing {
|
||||
}
|
||||
|
||||
long recentlyHurt = mcMMOPlayer.getRecentlyHurt();
|
||||
int hurtCooldown = Config.getInstance().getChimaeraRecentlyHurtCooldown();
|
||||
int hurtCooldown = mcMMO.p.getGeneralConfig().getChimaeraRecentlyHurtCooldown();
|
||||
|
||||
if (hurtCooldown > 0) {
|
||||
int timeRemaining = SkillUtils.calculateTimeLeft(recentlyHurt * Misc.TIME_CONVERSION_FACTOR, hurtCooldown, player);
|
||||
@ -95,9 +94,9 @@ public final class ChimaeraWing {
|
||||
|
||||
location = player.getLocation();
|
||||
|
||||
if (Config.getInstance().getChimaeraPreventUseUnderground()) {
|
||||
if (mcMMO.p.getGeneralConfig().getChimaeraPreventUseUnderground()) {
|
||||
if (location.getY() < player.getWorld().getHighestBlockYAt(location)) {
|
||||
player.getInventory().setItemInMainHand(new ItemStack(getChimaeraWing(amount - Config.getInstance().getChimaeraUseCost())));
|
||||
player.getInventory().setItemInMainHand(new ItemStack(getChimaeraWing(amount - mcMMO.p.getGeneralConfig().getChimaeraUseCost())));
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.Fail");
|
||||
player.updateInventory();
|
||||
player.setVelocity(new Vector(0, 0.5D, 0));
|
||||
@ -109,7 +108,7 @@ public final class ChimaeraWing {
|
||||
|
||||
mcMMOPlayer.actualizeTeleportCommenceLocation(player);
|
||||
|
||||
long warmup = Config.getInstance().getChimaeraWarmup();
|
||||
long warmup = mcMMO.p.getGeneralConfig().getChimaeraWarmup();
|
||||
|
||||
if (warmup > 0) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.ITEM_MESSAGE, "Teleport.Commencing", String.valueOf(warmup));
|
||||
@ -123,7 +122,7 @@ public final class ChimaeraWing {
|
||||
public static void chimaeraExecuteTeleport() {
|
||||
Player player = mcMMOPlayer.getPlayer();
|
||||
|
||||
if (Config.getInstance().getChimaeraUseBedSpawn() && player.getBedSpawnLocation() != null) {
|
||||
if (mcMMO.p.getGeneralConfig().getChimaeraUseBedSpawn() && player.getBedSpawnLocation() != null) {
|
||||
player.teleport(player.getBedSpawnLocation());
|
||||
}
|
||||
else {
|
||||
@ -136,12 +135,12 @@ public final class ChimaeraWing {
|
||||
}
|
||||
}
|
||||
|
||||
player.getInventory().setItemInMainHand(new ItemStack(getChimaeraWing(player.getInventory().getItemInMainHand().getAmount() - Config.getInstance().getChimaeraUseCost())));
|
||||
player.getInventory().setItemInMainHand(new ItemStack(getChimaeraWing(player.getInventory().getItemInMainHand().getAmount() - mcMMO.p.getGeneralConfig().getChimaeraUseCost())));
|
||||
player.updateInventory();
|
||||
mcMMOPlayer.actualizeChimeraWingLastUse();
|
||||
mcMMOPlayer.setTeleportCommenceLocation(null);
|
||||
|
||||
if (Config.getInstance().getChimaeraSoundEnabled()) {
|
||||
if (mcMMO.p.getGeneralConfig().getChimaeraSoundEnabled()) {
|
||||
SoundManager.sendSound(player, location, SoundType.CHIMAERA_WING);
|
||||
}
|
||||
|
||||
@ -149,7 +148,7 @@ public final class ChimaeraWing {
|
||||
}
|
||||
|
||||
public static ItemStack getChimaeraWing(int amount) {
|
||||
ItemStack itemStack = new ItemStack(Config.getInstance().getChimaeraItem(), amount);
|
||||
ItemStack itemStack = new ItemStack(mcMMO.p.getGeneralConfig().getChimaeraItem(), amount);
|
||||
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
//noinspection ConstantConditions
|
||||
@ -165,8 +164,8 @@ public final class ChimaeraWing {
|
||||
}
|
||||
|
||||
public static ShapelessRecipe getChimaeraWingRecipe() {
|
||||
Material ingredient = Config.getInstance().getChimaeraItem();
|
||||
int amount = Config.getInstance().getChimaeraRecipeCost();
|
||||
Material ingredient = mcMMO.p.getGeneralConfig().getChimaeraItem();
|
||||
int amount = mcMMO.p.getGeneralConfig().getChimaeraRecipeCost();
|
||||
|
||||
ShapelessRecipe chimeraWing = new ShapelessRecipe(new NamespacedKey(mcMMO.p, "Chimera"), getChimaeraWing(1));
|
||||
chimeraWing.addIngredient(amount, ingredient);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainSource;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
@ -9,6 +8,7 @@ import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
||||
import com.gmail.nossr50.datatypes.skills.interfaces.Skill;
|
||||
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
|
||||
import com.gmail.nossr50.events.experience.McMMOPlayerLevelChangeEvent;
|
||||
import com.gmail.nossr50.events.experience.McMMOPlayerLevelDownEvent;
|
||||
@ -409,7 +409,7 @@ public final class EventUtils {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
|
||||
String skillName = primarySkillType.toString();
|
||||
int playerSkillLevel = playerProfile.getSkillLevel(primarySkillType);
|
||||
int threshold = Config.getInstance().getHardcoreDeathStatPenaltyLevelThreshold();
|
||||
int threshold = mcMMO.p.getGeneralConfig().getHardcoreDeathStatPenaltyLevelThreshold();
|
||||
if(playerSkillLevel > threshold) {
|
||||
playerProfile.modifySkill(primarySkillType, Math.max(threshold, playerSkillLevel - levelChanged.get(skillName)));
|
||||
playerProfile.removeXp(primarySkillType, experienceChanged.get(skillName));
|
||||
@ -479,7 +479,7 @@ public final class EventUtils {
|
||||
}
|
||||
|
||||
public static McMMOPlayerAbilityDeactivateEvent callAbilityDeactivateEvent(Player player, SuperAbilityType ability) {
|
||||
McMMOPlayerAbilityDeactivateEvent event = new McMMOPlayerAbilityDeactivateEvent(player, PrimarySkillType.byAbility(ability));
|
||||
McMMOPlayerAbilityDeactivateEvent event = new McMMOPlayerAbilityDeactivateEvent(player, Skill.byAbility(ability));
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
return event;
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.worldguard.WorldGuardManager;
|
||||
@ -22,8 +22,8 @@ public final class HardcoreManager {
|
||||
return;
|
||||
}
|
||||
|
||||
double statLossPercentage = Config.getInstance().getHardcoreDeathStatPenaltyPercentage();
|
||||
int levelThreshold = Config.getInstance().getHardcoreDeathStatPenaltyLevelThreshold();
|
||||
double statLossPercentage = mcMMO.p.getGeneralConfig().getHardcoreDeathStatPenaltyPercentage();
|
||||
int levelThreshold = mcMMO.p.getGeneralConfig().getHardcoreDeathStatPenaltyLevelThreshold();
|
||||
|
||||
if(UserManager.getPlayer(player) == null)
|
||||
return;
|
||||
@ -73,8 +73,8 @@ public final class HardcoreManager {
|
||||
return;
|
||||
}
|
||||
|
||||
double vampirismStatLeechPercentage = Config.getInstance().getHardcoreVampirismStatLeechPercentage();
|
||||
int levelThreshold = Config.getInstance().getHardcoreVampirismLevelThreshold();
|
||||
double vampirismStatLeechPercentage = mcMMO.p.getGeneralConfig().getHardcoreVampirismStatLeechPercentage();
|
||||
int levelThreshold = mcMMO.p.getGeneralConfig().getHardcoreVampirismLevelThreshold();
|
||||
|
||||
if(UserManager.getPlayer(killer) == null || UserManager.getPlayer(victim) == null)
|
||||
return;
|
||||
|
@ -1,7 +1,5 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.config.party.ItemWeightConfig;
|
||||
import com.gmail.nossr50.datatypes.treasure.EnchantmentWrapper;
|
||||
@ -186,7 +184,7 @@ public final class ItemUtils {
|
||||
* @return true if the item counts as unarmed, false otherwise
|
||||
*/
|
||||
public static boolean isUnarmed(ItemStack item) {
|
||||
if (Config.getInstance().getUnarmedItemsAsUnarmed()) {
|
||||
if (mcMMO.p.getGeneralConfig().getUnarmedItemsAsUnarmed()) {
|
||||
return !isMinecraftTool(item);
|
||||
}
|
||||
|
||||
@ -622,7 +620,7 @@ public final class ItemUtils {
|
||||
if(itemMeta == null)
|
||||
return;
|
||||
|
||||
itemMeta.addEnchant(Enchantment.DIG_SPEED, existingEnchantLevel + AdvancedConfig.getInstance().getEnchantBuff(), true);
|
||||
itemMeta.addEnchant(Enchantment.DIG_SPEED, existingEnchantLevel + mcMMO.p.getAdvancedConfig().getEnchantBuff(), true);
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.MobHealthbarType;
|
||||
import com.gmail.nossr50.datatypes.meta.OldName;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
@ -36,7 +35,7 @@ public final class MobHealthbarUtils {
|
||||
* @param damage damage done by the attack triggering this
|
||||
*/
|
||||
public static void handleMobHealthbars(LivingEntity target, double damage, mcMMO plugin) {
|
||||
if (mcMMO.isHealthBarPluginEnabled() || !Config.getInstance().getMobHealthbarEnabled()) {
|
||||
if (mcMMO.isHealthBarPluginEnabled() || !mcMMO.p.getGeneralConfig().getMobHealthbarEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -63,12 +62,12 @@ public final class MobHealthbarUtils {
|
||||
}
|
||||
|
||||
boolean oldNameVisible = target.isCustomNameVisible();
|
||||
String newName = createHealthDisplay(Config.getInstance().getMobHealthbarDefault(), target, damage);
|
||||
String newName = createHealthDisplay(mcMMO.p.getGeneralConfig().getMobHealthbarDefault(), target, damage);
|
||||
|
||||
target.setCustomName(newName);
|
||||
target.setCustomNameVisible(true);
|
||||
|
||||
int displayTime = Config.getInstance().getMobHealthbarTime();
|
||||
int displayTime = mcMMO.p.getGeneralConfig().getMobHealthbarTime();
|
||||
|
||||
if (displayTime != -1) {
|
||||
boolean updateName = !ChatColor.stripColor(oldName).equalsIgnoreCase(ChatColor.stripColor(newName));
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.mods.CustomArmorConfig;
|
||||
import com.gmail.nossr50.config.mods.CustomBlockConfig;
|
||||
import com.gmail.nossr50.config.mods.CustomEntityConfig;
|
||||
@ -89,67 +88,67 @@ public class ModManager {
|
||||
}
|
||||
|
||||
public boolean isCustomBoots(Material material) {
|
||||
return Config.getInstance().getArmorModsEnabled() && customBoots.contains(material);
|
||||
return mcMMO.p.getGeneralConfig().getArmorModsEnabled() && customBoots.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomChestplate(Material material) {
|
||||
return Config.getInstance().getArmorModsEnabled() && customChestplates.contains(material);
|
||||
return mcMMO.p.getGeneralConfig().getArmorModsEnabled() && customChestplates.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomHelmet(Material material) {
|
||||
return Config.getInstance().getArmorModsEnabled() && customHelmets.contains(material);
|
||||
return mcMMO.p.getGeneralConfig().getArmorModsEnabled() && customHelmets.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomLeggings(Material material) {
|
||||
return Config.getInstance().getArmorModsEnabled() && customLeggings.contains(material);
|
||||
return mcMMO.p.getGeneralConfig().getArmorModsEnabled() && customLeggings.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomAxe(Material material) {
|
||||
return Config.getInstance().getToolModsEnabled() && customAxes.contains(material);
|
||||
return mcMMO.p.getGeneralConfig().getToolModsEnabled() && customAxes.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomBow(Material material) {
|
||||
return Config.getInstance().getToolModsEnabled() && customBows.contains(material);
|
||||
return mcMMO.p.getGeneralConfig().getToolModsEnabled() && customBows.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomHoe(Material material) {
|
||||
return Config.getInstance().getToolModsEnabled() && customHoes.contains(material);
|
||||
return mcMMO.p.getGeneralConfig().getToolModsEnabled() && customHoes.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomPickaxe(Material material) {
|
||||
return Config.getInstance().getToolModsEnabled() && customPickaxes.contains(material);
|
||||
return mcMMO.p.getGeneralConfig().getToolModsEnabled() && customPickaxes.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomShovel(Material material) {
|
||||
return Config.getInstance().getToolModsEnabled() && customShovels.contains(material);
|
||||
return mcMMO.p.getGeneralConfig().getToolModsEnabled() && customShovels.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomSword(Material material) {
|
||||
return Config.getInstance().getToolModsEnabled() && customSwords.contains(material);
|
||||
return mcMMO.p.getGeneralConfig().getToolModsEnabled() && customSwords.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomOre(Material data) {
|
||||
return Config.getInstance().getBlockModsEnabled() && customOres.contains(data);
|
||||
return mcMMO.p.getGeneralConfig().getBlockModsEnabled() && customOres.contains(data);
|
||||
}
|
||||
|
||||
public boolean isCustomLog(BlockState state) {
|
||||
return Config.getInstance().getBlockModsEnabled() && customLogs.contains(state.getType());
|
||||
return mcMMO.p.getGeneralConfig().getBlockModsEnabled() && customLogs.contains(state.getType());
|
||||
}
|
||||
|
||||
public boolean isCustomAbilityBlock(BlockState state) {
|
||||
return Config.getInstance().getBlockModsEnabled() && customAbilityBlocks.contains(state.getType());
|
||||
return mcMMO.p.getGeneralConfig().getBlockModsEnabled() && customAbilityBlocks.contains(state.getType());
|
||||
}
|
||||
|
||||
public boolean isCustomExcavationBlock(BlockState state) {
|
||||
return Config.getInstance().getBlockModsEnabled() && customExcavationBlocks.contains(state.getType());
|
||||
return mcMMO.p.getGeneralConfig().getBlockModsEnabled() && customExcavationBlocks.contains(state.getType());
|
||||
}
|
||||
|
||||
public boolean isCustomHerbalismBlock(BlockState state) {
|
||||
return Config.getInstance().getBlockModsEnabled() && customHerbalismBlocks.contains(state.getType());
|
||||
return mcMMO.p.getGeneralConfig().getBlockModsEnabled() && customHerbalismBlocks.contains(state.getType());
|
||||
}
|
||||
|
||||
public boolean isCustomMiningBlock(BlockState state) {
|
||||
return Config.getInstance().getBlockModsEnabled() && customMiningBlocks.contains(state.getType());
|
||||
return mcMMO.p.getGeneralConfig().getBlockModsEnabled() && customMiningBlocks.contains(state.getType());
|
||||
}
|
||||
|
||||
public CustomBlock getBlock(BlockState state) {
|
||||
@ -167,7 +166,7 @@ public class ModManager {
|
||||
* @return true if the item is a custom tool, false otherwise
|
||||
*/
|
||||
public boolean isCustomTool(ItemStack item) {
|
||||
return Config.getInstance().getToolModsEnabled() && item != null && customToolMap.containsKey(item.getType());
|
||||
return mcMMO.p.getGeneralConfig().getToolModsEnabled() && item != null && customToolMap.containsKey(item.getType());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -185,7 +184,7 @@ public class ModManager {
|
||||
}
|
||||
|
||||
public boolean isCustomEntity(Entity entity) {
|
||||
if (!Config.getInstance().getEntityModsEnabled()) {
|
||||
if (!mcMMO.p.getGeneralConfig().getEntityModsEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -227,7 +226,7 @@ public class ModManager {
|
||||
}
|
||||
|
||||
public void addCustomEntity(Entity entity) {
|
||||
if (!Config.getInstance().getEntityModsEnabled()) {
|
||||
if (!mcMMO.p.getGeneralConfig().getEntityModsEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
@ -70,11 +69,11 @@ public final class Motd {
|
||||
player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.Enabled", statLossInfo + seperator + vampirismInfo));
|
||||
|
||||
if (deathStatLossEnabled) {
|
||||
player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.DeathStatLoss.Stats", Config.getInstance().getHardcoreDeathStatPenaltyPercentage()));
|
||||
player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.DeathStatLoss.Stats", mcMMO.p.getGeneralConfig().getHardcoreDeathStatPenaltyPercentage()));
|
||||
}
|
||||
|
||||
if (vampirismEnabled) {
|
||||
player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.Vampirism.Stats", Config.getInstance().getHardcoreVampirismStatLeechPercentage()));
|
||||
player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.Vampirism.Stats", mcMMO.p.getGeneralConfig().getHardcoreVampirismStatLeechPercentage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,6 @@ public final class Permissions {
|
||||
*/
|
||||
public static boolean motd(Permissible permissible) { return permissible.hasPermission("mcmmo.motd"); }
|
||||
public static boolean levelUpBroadcast(Permissible permissible) { return permissible.hasPermission("mcmmo.broadcast.levelup"); }
|
||||
public static boolean mobHealthDisplay(Permissible permissible) { return permissible.hasPermission("mcmmo.mobhealthdisplay"); }
|
||||
public static boolean updateNotifications(Permissible permissible) {return permissible.hasPermission("mcmmo.tools.updatecheck"); }
|
||||
public static boolean chimaeraWing(Permissible permissible) { return permissible.hasPermission("mcmmo.item.chimaerawing"); }
|
||||
public static boolean showversion(Permissible permissible) { return permissible.hasPermission("mcmmo.showversion"); }
|
||||
@ -34,8 +33,6 @@ public final class Permissions {
|
||||
/* BYPASS */
|
||||
public static boolean hardcoreBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.hardcoremode"); }
|
||||
public static boolean arcaneBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.arcanebypass"); }
|
||||
public static boolean krakenBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.kraken"); }
|
||||
public static boolean trapsBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.fishingtraps"); }
|
||||
|
||||
/* CHAT */
|
||||
public static boolean partyChat(Permissible permissible) { return permissible.hasPermission("mcmmo.chat.partychat"); }
|
||||
@ -60,9 +57,6 @@ public final class Permissions {
|
||||
public static boolean inspectFar(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.far")); }
|
||||
public static boolean inspectHidden(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.hidden")); }
|
||||
|
||||
public static boolean kraken(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.kraken"); }
|
||||
public static boolean krakenOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.kraken.others"); }
|
||||
|
||||
public static boolean mcability(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcability")); }
|
||||
public static boolean mcabilityOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcability.others")); }
|
||||
|
||||
@ -98,9 +92,6 @@ public final class Permissions {
|
||||
public static boolean xprateSet(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.xprate.set"); }
|
||||
public static boolean xprateReset(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.xprate.reset"); }
|
||||
|
||||
public static boolean vampirismModify(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.vampirism.modify"); }
|
||||
public static boolean vampirismToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.vampirism.toggle"); }
|
||||
|
||||
public static boolean mcpurge(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcpurge"); }
|
||||
public static boolean mcremove(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcremove"); }
|
||||
public static boolean mmoupdate(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoupdate"); }
|
||||
@ -172,7 +163,6 @@ public final class Permissions {
|
||||
public static boolean vanillaXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase(Locale.ENGLISH) + ".vanillaxpboost"); }
|
||||
public static boolean isSubSkillEnabled(Permissible permissible, SubSkillType subSkillType) { return permissible.hasPermission(subSkillType.getPermissionNodeAddress()); }
|
||||
public static boolean isSubSkillEnabled(Permissible permissible, AbstractSubSkill abstractSubSkill) { return permissible.hasPermission(abstractSubSkill.getPermissionNode()); }
|
||||
public static boolean bonusDamage(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase(Locale.ENGLISH) + ".bonusdamage"); }
|
||||
|
||||
/* ACROBATICS */
|
||||
public static boolean dodge(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.dodge"); }
|
||||
@ -209,7 +199,6 @@ public final class Permissions {
|
||||
public static boolean repairMaterialType(Permissible permissible, MaterialType repairMaterialType) { return permissible.hasPermission("mcmmo.ability.repair." + repairMaterialType.toString().toLowerCase(Locale.ENGLISH) + "repair"); }
|
||||
|
||||
/* SALVAGE */
|
||||
public static boolean advancedSalvage(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.salvage.advancedsalvage"); }
|
||||
public static boolean arcaneSalvage(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.salvage.arcanesalvage"); }
|
||||
|
||||
public static boolean salvageItemType(Permissible permissible, ItemType salvageItemType) { return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemType.toString().toLowerCase(Locale.ENGLISH) + "salvage"); }
|
||||
|
@ -16,7 +16,6 @@ import com.gmail.nossr50.commands.party.PartyCommand;
|
||||
import com.gmail.nossr50.commands.party.teleport.PtpCommand;
|
||||
import com.gmail.nossr50.commands.player.*;
|
||||
import com.gmail.nossr50.commands.skills.*;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
@ -283,7 +282,7 @@ public final class CommandRegistrationManager {
|
||||
|
||||
private static void registerMcpurgeCommand() {
|
||||
PluginCommand command = mcMMO.p.getCommand("mcpurge");
|
||||
command.setDescription(LocaleLoader.getString("Commands.Description.mcpurge", Config.getInstance().getOldUsersCutoff()));
|
||||
command.setDescription(LocaleLoader.getString("Commands.Description.mcpurge", mcMMO.p.getGeneralConfig().getOldUsersCutoff()));
|
||||
command.setPermission("mcmmo.commands.mcpurge");
|
||||
command.setPermissionMessage(permissionsMessage);
|
||||
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mcpurge"));
|
||||
@ -389,15 +388,6 @@ public final class CommandRegistrationManager {
|
||||
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mcnotify"));
|
||||
command.setExecutor(new McnotifyCommand());
|
||||
}
|
||||
|
||||
private static void registerMHDCommand() {
|
||||
PluginCommand command = mcMMO.p.getCommand("mhd");
|
||||
command.setDescription("Resets all mob health bar settings for all players to the default"); //TODO: Localize
|
||||
command.setPermission("mcmmo.commands.mhd");
|
||||
command.setPermissionMessage(permissionsMessage);
|
||||
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mhd"));
|
||||
command.setExecutor(new MHDCommand());
|
||||
}
|
||||
|
||||
private static void registerMcscoreboardCommand() {
|
||||
PluginCommand command = mcMMO.p.getCommand("mcscoreboard");
|
||||
@ -455,7 +445,6 @@ public final class CommandRegistrationManager {
|
||||
registerMcnotifyCommand();
|
||||
registerMcrefreshCommand();
|
||||
registerMcscoreboardCommand();
|
||||
registerMHDCommand();
|
||||
registerXprateCommand();
|
||||
|
||||
// Database Commands
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.commands;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
@ -38,7 +37,7 @@ public final class CommandUtils {
|
||||
if(!target.isOnline() && !hasPermission) {
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.Offline"));
|
||||
return true;
|
||||
} else if (sender instanceof Player && !Misc.isNear(((Player) sender).getLocation(), target.getLocation(), Config.getInstance().getInspectDistance()) && !hasPermission) {
|
||||
} else if (sender instanceof Player && !Misc.isNear(((Player) sender).getLocation(), target.getLocation(), mcMMO.p.getGeneralConfig().getInspectDistance()) && !hasPermission) {
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.TooFar"));
|
||||
return true;
|
||||
}
|
||||
@ -209,7 +208,7 @@ public final class CommandUtils {
|
||||
if (skill.isChildSkill()) {
|
||||
return LocaleLoader.getString("Skills.ChildStats", LocaleLoader.getString(StringUtils.getCapitalized(skill.toString()) + ".Listener") + " ", profile.getSkillLevel(skill));
|
||||
}
|
||||
if (profile.getSkillLevel(skill) == Config.getInstance().getLevelCap(skill)){
|
||||
if (profile.getSkillLevel(skill) == mcMMO.p.getGeneralConfig().getLevelCap(skill)){
|
||||
return LocaleLoader.getString("Skills.Stats", LocaleLoader.getString(StringUtils.getCapitalized(skill.toString()) + ".Listener") + " ", profile.getSkillLevel(skill), profile.getSkillXpLevel(skill), LocaleLoader.getString("Skills.MaxXP"));
|
||||
}
|
||||
return LocaleLoader.getString("Skills.Stats", LocaleLoader.getString(StringUtils.getCapitalized(skill.toString()) + ".Listener") + " ", profile.getSkillLevel(skill), profile.getSkillXpLevel(skill), profile.getXpToLevel(skill));
|
||||
@ -258,7 +257,7 @@ public final class CommandUtils {
|
||||
* @return Matched name or {@code partialName} if no match was found
|
||||
*/
|
||||
public static String getMatchedPlayerName(String partialName) {
|
||||
if (Config.getInstance().getMatchOfflinePlayers()) {
|
||||
if (mcMMO.p.getGeneralConfig().getMatchOfflinePlayers()) {
|
||||
List<String> matches = matchPlayer(partialName);
|
||||
|
||||
if (matches.size() == 1) {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.experience;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.experience.FormulaType;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
@ -89,7 +88,7 @@ public class FormulaManager {
|
||||
public int[] calculateNewLevel(PrimarySkillType primarySkillType, int experience, FormulaType formulaType) {
|
||||
int newLevel = 0;
|
||||
int remainder = 0;
|
||||
int maxLevel = Config.getInstance().getLevelCap(primarySkillType);
|
||||
int maxLevel = mcMMO.p.getGeneralConfig().getLevelCap(primarySkillType);
|
||||
|
||||
while (experience > 0 && newLevel < maxLevel) {
|
||||
int experienceToNextLevel = getXPtoNextLevel(newLevel, formulaType);
|
||||
|
@ -1,7 +1,5 @@
|
||||
package com.gmail.nossr50.util.player;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.LevelUpBroadcastPredicate;
|
||||
import com.gmail.nossr50.datatypes.PowerLevelUpBroadcastPredicate;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
@ -50,7 +48,7 @@ public class NotificationManager {
|
||||
if(UserManager.getPlayer(player) == null || !UserManager.getPlayer(player).useChatNotifications())
|
||||
return;
|
||||
|
||||
McMMOMessageType destination = AdvancedConfig.getInstance().doesNotificationUseActionBar(notificationType) ? McMMOMessageType.ACTION_BAR : McMMOMessageType.SYSTEM;
|
||||
McMMOMessageType destination = mcMMO.p.getAdvancedConfig().doesNotificationUseActionBar(notificationType) ? McMMOMessageType.ACTION_BAR : McMMOMessageType.SYSTEM;
|
||||
|
||||
Component message = TextComponentFactory.getNotificationTextComponentFromLocale(key);
|
||||
McMMOPlayerNotificationEvent customEvent = checkNotificationEvent(player, notificationType, destination, message);
|
||||
@ -105,7 +103,7 @@ public class NotificationManager {
|
||||
if(UserManager.getPlayer(player) == null || !UserManager.getPlayer(player).useChatNotifications())
|
||||
return;
|
||||
|
||||
McMMOMessageType destination = AdvancedConfig.getInstance().doesNotificationUseActionBar(notificationType) ? McMMOMessageType.ACTION_BAR : McMMOMessageType.SYSTEM;
|
||||
McMMOMessageType destination = mcMMO.p.getAdvancedConfig().doesNotificationUseActionBar(notificationType) ? McMMOMessageType.ACTION_BAR : McMMOMessageType.SYSTEM;
|
||||
|
||||
Component message = TextComponentFactory.getNotificationMultipleValues(key, values);
|
||||
McMMOPlayerNotificationEvent customEvent = checkNotificationEvent(player, notificationType, destination, message);
|
||||
@ -137,7 +135,7 @@ public class NotificationManager {
|
||||
private static McMMOPlayerNotificationEvent checkNotificationEvent(Player player, NotificationType notificationType, McMMOMessageType destination, Component message) {
|
||||
//Init event
|
||||
McMMOPlayerNotificationEvent customEvent = new McMMOPlayerNotificationEvent(player,
|
||||
notificationType, message, destination, AdvancedConfig.getInstance().doesNotificationSendCopyToChat(notificationType));
|
||||
notificationType, message, destination, mcMMO.p.getAdvancedConfig().doesNotificationSendCopyToChat(notificationType));
|
||||
|
||||
//Call event
|
||||
Bukkit.getServer().getPluginManager().callEvent(customEvent);
|
||||
@ -155,7 +153,7 @@ public class NotificationManager {
|
||||
if(!mcMMOPlayer.useChatNotifications())
|
||||
return;
|
||||
|
||||
McMMOMessageType destination = AdvancedConfig.getInstance().doesNotificationUseActionBar(NotificationType.LEVEL_UP_MESSAGE) ? McMMOMessageType.ACTION_BAR : McMMOMessageType.SYSTEM;
|
||||
McMMOMessageType destination = mcMMO.p.getAdvancedConfig().doesNotificationUseActionBar(NotificationType.LEVEL_UP_MESSAGE) ? McMMOMessageType.ACTION_BAR : McMMOMessageType.SYSTEM;
|
||||
|
||||
Component levelUpTextComponent = TextComponentFactory.getNotificationLevelUpTextComponent(skillName, levelsGained, newLevel);
|
||||
McMMOPlayerNotificationEvent customEvent = checkNotificationEvent(mcMMOPlayer.getPlayer(), NotificationType.LEVEL_UP_MESSAGE, destination, levelUpTextComponent);
|
||||
@ -183,7 +181,7 @@ public class NotificationManager {
|
||||
SoundManager.sendCategorizedSound(mcMMOPlayer.getPlayer(), mcMMOPlayer.getPlayer().getLocation(), SoundType.SKILL_UNLOCKED, SoundCategory.MASTER);
|
||||
|
||||
//ACTION BAR MESSAGE
|
||||
/*if(AdvancedConfig.getInstance().doesNotificationUseActionBar(NotificationType.SUBSKILL_UNLOCKED))
|
||||
/*if(mcMMO.p.getAdvancedConfig().doesNotificationUseActionBar(NotificationType.SUBSKILL_UNLOCKED))
|
||||
mcMMOPlayer.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(LocaleLoader.getString("JSON.SkillUnlockMessage",
|
||||
subSkillType.getLocaleName(),
|
||||
String.valueOf(RankUtils.getRank(mcMMOPlayer.getPlayer(),
|
||||
@ -197,7 +195,7 @@ public class NotificationManager {
|
||||
*/
|
||||
private static void sendAdminNotification(String msg) {
|
||||
//If its not enabled exit
|
||||
if(!Config.getInstance().adminNotifications())
|
||||
if(!mcMMO.p.getGeneralConfig().adminNotifications())
|
||||
return;
|
||||
|
||||
for(Player player : Bukkit.getServer().getOnlinePlayers())
|
||||
@ -274,13 +272,13 @@ public class NotificationManager {
|
||||
return;
|
||||
|
||||
//Check if broadcasting is enabled
|
||||
if(Config.getInstance().shouldLevelUpBroadcasts()) {
|
||||
if(mcMMO.p.getGeneralConfig().shouldLevelUpBroadcasts()) {
|
||||
//Permission check
|
||||
if(!Permissions.levelUpBroadcast(mmoPlayer.getPlayer())) {
|
||||
return;
|
||||
}
|
||||
|
||||
int levelInterval = Config.getInstance().getLevelUpBroadcastInterval();
|
||||
int levelInterval = mcMMO.p.getGeneralConfig().getLevelUpBroadcastInterval();
|
||||
int remainder = level % levelInterval;
|
||||
|
||||
if(remainder == 0) {
|
||||
@ -309,13 +307,13 @@ public class NotificationManager {
|
||||
return;
|
||||
|
||||
//Check if broadcasting is enabled
|
||||
if(Config.getInstance().shouldPowerLevelUpBroadcasts()) {
|
||||
if(mcMMO.p.getGeneralConfig().shouldPowerLevelUpBroadcasts()) {
|
||||
//Permission check
|
||||
if(!Permissions.levelUpBroadcast(mmoPlayer.getPlayer())) {
|
||||
return;
|
||||
}
|
||||
|
||||
int levelInterval = Config.getInstance().getPowerLevelUpBroadcastInterval();
|
||||
int levelInterval = mcMMO.p.getGeneralConfig().getPowerLevelUpBroadcastInterval();
|
||||
int remainder = powerLevel % levelInterval;
|
||||
|
||||
if(remainder == 0) {
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.gmail.nossr50.util.random;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillEvent;
|
||||
import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillRandomCheckEvent;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.skills.SkillActivationType;
|
||||
@ -252,11 +252,11 @@ public class RandomChanceUtil {
|
||||
public static double getStaticRandomChance(@NotNull SubSkillType subSkillType) throws InvalidStaticChance {
|
||||
switch (subSkillType) {
|
||||
case AXES_ARMOR_IMPACT:
|
||||
return AdvancedConfig.getInstance().getImpactChance();
|
||||
return mcMMO.p.getAdvancedConfig().getImpactChance();
|
||||
case AXES_GREATER_IMPACT:
|
||||
return AdvancedConfig.getInstance().getGreaterImpactChance();
|
||||
return mcMMO.p.getAdvancedConfig().getGreaterImpactChance();
|
||||
case TAMING_FAST_FOOD_SERVICE:
|
||||
return AdvancedConfig.getInstance().getFastFoodChance();
|
||||
return mcMMO.p.getAdvancedConfig().getFastFoodChance();
|
||||
default:
|
||||
throw new InvalidStaticChance();
|
||||
}
|
||||
@ -328,10 +328,10 @@ public class RandomChanceUtil {
|
||||
}
|
||||
|
||||
public static double getMaximumProbability(@NotNull SubSkillType subSkillType) {
|
||||
return AdvancedConfig.getInstance().getMaximumProbability(subSkillType);
|
||||
return mcMMO.p.getAdvancedConfig().getMaximumProbability(subSkillType);
|
||||
}
|
||||
|
||||
public static double getMaxBonusLevelCap(@NotNull SubSkillType subSkillType) {
|
||||
return AdvancedConfig.getInstance().getMaxBonusLevel(subSkillType);
|
||||
return mcMMO.p.getAdvancedConfig().getMaxBonusLevel(subSkillType);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.scoreboards;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.database.PlayerStat;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
@ -72,7 +71,7 @@ public class ScoreboardManager {
|
||||
* Stylizes the targetBoard in a Rainbow Pattern
|
||||
* This is off by default
|
||||
*/
|
||||
if (Config.getInstance().getScoreboardRainbows()) {
|
||||
if (mcMMO.p.getGeneralConfig().getScoreboardRainbows()) {
|
||||
// Everything but black, gray, gold
|
||||
List<ChatColor> colors = Lists.newArrayList(
|
||||
ChatColor.WHITE,
|
||||
@ -153,7 +152,7 @@ public class ScoreboardManager {
|
||||
}
|
||||
|
||||
private static String formatAbility(ChatColor color, String abilityName) {
|
||||
if (Config.getInstance().getShowAbilityNames()) {
|
||||
if (mcMMO.p.getGeneralConfig().getShowAbilityNames()) {
|
||||
return getShortenedName(color + abilityName);
|
||||
}
|
||||
else {
|
||||
@ -244,11 +243,11 @@ public class ScoreboardManager {
|
||||
}
|
||||
}
|
||||
|
||||
if (Config.getInstance().getPowerLevelTagsEnabled() && !dirtyPowerLevels.contains(playerName)) {
|
||||
if (mcMMO.p.getGeneralConfig().getPowerLevelTagsEnabled() && !dirtyPowerLevels.contains(playerName)) {
|
||||
dirtyPowerLevels.add(playerName);
|
||||
}
|
||||
|
||||
if (Config.getInstance().getSkillLevelUpBoard()) {
|
||||
if (mcMMO.p.getGeneralConfig().getSkillLevelUpBoard()) {
|
||||
enablePlayerSkillLevelUpScoreboard(player, skill);
|
||||
}
|
||||
|
||||
@ -299,7 +298,7 @@ public class ScoreboardManager {
|
||||
wrapper.setOldScoreboard();
|
||||
wrapper.setTypeSkill(skill);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getSkillScoreboardTime());
|
||||
changeScoreboard(wrapper, mcMMO.p.getGeneralConfig().getSkillScoreboardTime());
|
||||
}
|
||||
}
|
||||
|
||||
@ -318,7 +317,7 @@ public class ScoreboardManager {
|
||||
wrapper.setOldScoreboard();
|
||||
wrapper.setTypeSkill(primarySkillType);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getSkillScoreboardTime());
|
||||
changeScoreboard(wrapper, mcMMO.p.getGeneralConfig().getSkillScoreboardTime());
|
||||
}
|
||||
}
|
||||
|
||||
@ -333,7 +332,7 @@ public class ScoreboardManager {
|
||||
|
||||
wrapper.setOldScoreboard();
|
||||
wrapper.setTypeSkill(skill);
|
||||
changeScoreboard(wrapper, Config.getInstance().getSkillLevelUpTime());
|
||||
changeScoreboard(wrapper, mcMMO.p.getGeneralConfig().getSkillLevelUpTime());
|
||||
}
|
||||
}
|
||||
|
||||
@ -347,7 +346,7 @@ public class ScoreboardManager {
|
||||
wrapper.setOldScoreboard();
|
||||
wrapper.setTypeSelfStats();
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getStatsScoreboardTime());
|
||||
changeScoreboard(wrapper, mcMMO.p.getGeneralConfig().getStatsScoreboardTime());
|
||||
}
|
||||
|
||||
public static void enablePlayerInspectScoreboard(@NotNull Player player, @NotNull PlayerProfile targetProfile) {
|
||||
@ -362,7 +361,7 @@ public class ScoreboardManager {
|
||||
wrapper.setOldScoreboard();
|
||||
wrapper.setTypeInspectStats(targetProfile);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getInspectScoreboardTime());
|
||||
changeScoreboard(wrapper, mcMMO.p.getGeneralConfig().getInspectScoreboardTime());
|
||||
}
|
||||
}
|
||||
|
||||
@ -378,7 +377,7 @@ public class ScoreboardManager {
|
||||
wrapper.setOldScoreboard();
|
||||
wrapper.setTypeInspectStats(targetMcMMOPlayer);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getInspectScoreboardTime());
|
||||
changeScoreboard(wrapper, mcMMO.p.getGeneralConfig().getInspectScoreboardTime());
|
||||
}
|
||||
}
|
||||
|
||||
@ -394,7 +393,7 @@ public class ScoreboardManager {
|
||||
wrapper.setOldScoreboard();
|
||||
wrapper.setTypeCooldowns();
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getCooldownScoreboardTime());
|
||||
changeScoreboard(wrapper, mcMMO.p.getGeneralConfig().getCooldownScoreboardTime());
|
||||
}
|
||||
}
|
||||
|
||||
@ -411,7 +410,7 @@ public class ScoreboardManager {
|
||||
wrapper.setTypeSelfRank();
|
||||
wrapper.acceptRankData(rank);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getRankScoreboardTime());
|
||||
changeScoreboard(wrapper, mcMMO.p.getGeneralConfig().getRankScoreboardTime());
|
||||
}
|
||||
}
|
||||
|
||||
@ -428,7 +427,7 @@ public class ScoreboardManager {
|
||||
wrapper.setTypeInspectRank(targetName);
|
||||
wrapper.acceptRankData(rank);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getRankScoreboardTime());
|
||||
changeScoreboard(wrapper, mcMMO.p.getGeneralConfig().getRankScoreboardTime());
|
||||
}
|
||||
}
|
||||
|
||||
@ -446,7 +445,7 @@ public class ScoreboardManager {
|
||||
wrapper.setTypeTop(skill, pageNumber);
|
||||
wrapper.acceptLeaderboardData(stats);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getTopScoreboardTime());
|
||||
changeScoreboard(wrapper, mcMMO.p.getGeneralConfig().getTopScoreboardTime());
|
||||
}
|
||||
}
|
||||
|
||||
@ -463,7 +462,7 @@ public class ScoreboardManager {
|
||||
wrapper.setTypeTopPower(pageNumber);
|
||||
wrapper.acceptLeaderboardData(stats);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getTopScoreboardTime());
|
||||
changeScoreboard(wrapper, mcMMO.p.getGeneralConfig().getTopScoreboardTime());
|
||||
}
|
||||
}
|
||||
|
||||
@ -517,7 +516,7 @@ public class ScoreboardManager {
|
||||
* @return the main targetBoard objective, or null if disabled
|
||||
*/
|
||||
public static @Nullable Objective getPowerLevelObjective() {
|
||||
if (!Config.getInstance().getPowerLevelTagsEnabled()) {
|
||||
if (!mcMMO.p.getGeneralConfig().getPowerLevelTagsEnabled()) {
|
||||
if(getScoreboardManager() == null)
|
||||
return null;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.scoreboards;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.database.PlayerStat;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
@ -75,7 +74,7 @@ public class ScoreboardWrapper {
|
||||
registered = true;
|
||||
}
|
||||
|
||||
if (Config.getInstance().getPowerLevelTagsEnabled()) {
|
||||
if (mcMMO.p.getGeneralConfig().getPowerLevelTagsEnabled()) {
|
||||
powerObjective.setDisplayName(ScoreboardManager.TAG_POWER_LEVEL);
|
||||
powerObjective.setDisplaySlot(DisplaySlot.BELOW_NAME);
|
||||
|
||||
@ -225,7 +224,7 @@ public class ScoreboardWrapper {
|
||||
|
||||
PlayerProfile profile = UserManager.getPlayer(player).getProfile();
|
||||
|
||||
if (profile.getScoreboardTipsShown() >= Config.getInstance().getTipsAmount()) {
|
||||
if (profile.getScoreboardTipsShown() >= mcMMO.p.getGeneralConfig().getTipsAmount()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.skills;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
@ -536,7 +535,7 @@ public final class CombatUtils {
|
||||
* @return true if the player has access to the limit break
|
||||
*/
|
||||
public static boolean canUseLimitBreak(@NotNull Player player, LivingEntity target, @NotNull SubSkillType subSkillType) {
|
||||
if(target instanceof Player || AdvancedConfig.getInstance().canApplyLimitBreakPVE()) {
|
||||
if(target instanceof Player || mcMMO.p.getAdvancedConfig().canApplyLimitBreakPVE()) {
|
||||
return RankUtils.hasUnlockedSubskill(player, subSkillType)
|
||||
&& Permissions.isSubSkillEnabled(player, subSkillType);
|
||||
} else {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.util.skills;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.sounds.SoundManager;
|
||||
import com.gmail.nossr50.util.sounds.SoundType;
|
||||
import org.apache.commons.lang.math.RandomUtils;
|
||||
@ -24,7 +24,7 @@ public final class ParticleEffectUtils {
|
||||
}
|
||||
|
||||
public static void playBleedEffect(LivingEntity livingEntity) {
|
||||
if (!Config.getInstance().getBleedEffectEnabled()) {
|
||||
if (!mcMMO.p.getGeneralConfig().getBleedEffectEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ public final class ParticleEffectUtils {
|
||||
|
||||
|
||||
public static void playDodgeEffect(Player player) {
|
||||
if (!Config.getInstance().getDodgeEffectEnabled()) {
|
||||
if (!mcMMO.p.getGeneralConfig().getDodgeEffectEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ public final class ParticleEffectUtils {
|
||||
}
|
||||
|
||||
public static void playFluxEffect(Location location) {
|
||||
if (!Config.getInstance().getFluxEffectEnabled()) {
|
||||
if (!mcMMO.p.getGeneralConfig().getFluxEffectEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ public final class ParticleEffectUtils {
|
||||
}
|
||||
|
||||
public static void playGreaterImpactEffect(LivingEntity livingEntity) {
|
||||
if (!Config.getInstance().getGreaterImpactEffectEnabled()) {
|
||||
if (!mcMMO.p.getGeneralConfig().getGreaterImpactEffectEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ public final class ParticleEffectUtils {
|
||||
}
|
||||
|
||||
public static void playCallOfTheWildEffect(LivingEntity livingEntity) {
|
||||
if (!Config.getInstance().getCallOfTheWildEffectEnabled()) {
|
||||
if (!mcMMO.p.getGeneralConfig().getCallOfTheWildEffectEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ public final class ParticleEffectUtils {
|
||||
}
|
||||
|
||||
public static void playAbilityDisabledEffect(Player player) {
|
||||
if (!Config.getInstance().getAbilityDeactivationEffectEnabled()) {
|
||||
if (!mcMMO.p.getGeneralConfig().getAbilityDeactivationEffectEnabled()) {
|
||||
}
|
||||
|
||||
/*if (hasHeadRoom(player)) {
|
||||
|
@ -1,7 +1,5 @@
|
||||
package com.gmail.nossr50.util.skills;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.HiddenConfig;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainSource;
|
||||
@ -56,8 +54,8 @@ public final class SkillUtils {
|
||||
|
||||
public static String[] calculateLengthDisplayValues(Player player, float skillValue, PrimarySkillType skill) {
|
||||
int maxLength = skill.getAbility().getMaxLength();
|
||||
int abilityLengthVar = AdvancedConfig.getInstance().getAbilityLength();
|
||||
int abilityLengthCap = AdvancedConfig.getInstance().getAbilityLengthCap();
|
||||
int abilityLengthVar = mcMMO.p.getAdvancedConfig().getAbilityLength();
|
||||
int abilityLengthCap = mcMMO.p.getAdvancedConfig().getAbilityLengthCap();
|
||||
|
||||
int length;
|
||||
|
||||
@ -125,7 +123,7 @@ public final class SkillUtils {
|
||||
* @return true if this is a valid skill, false otherwise
|
||||
*/
|
||||
public static boolean isSkill(String skillName) {
|
||||
return Config.getInstance().getLocale().equalsIgnoreCase("en_US") ? PrimarySkillType.getSkill(skillName) != null : isLocalizedSkill(skillName);
|
||||
return mcMMO.p.getGeneralConfig().getLocale().equalsIgnoreCase("en_US") ? PrimarySkillType.getSkill(skillName) != null : isLocalizedSkill(skillName);
|
||||
}
|
||||
|
||||
public static void sendSkillMessage(Player player, NotificationType notificationType, String key) {
|
||||
@ -183,8 +181,8 @@ public final class SkillUtils {
|
||||
|
||||
PrimarySkillType skill = mcMMOPlayer.getAbilityMode(SuperAbilityType.SUPER_BREAKER) ? PrimarySkillType.MINING : PrimarySkillType.EXCAVATION;
|
||||
|
||||
int abilityLengthVar = AdvancedConfig.getInstance().getAbilityLength();
|
||||
int abilityLengthCap = AdvancedConfig.getInstance().getAbilityLengthCap();
|
||||
int abilityLengthVar = mcMMO.p.getAdvancedConfig().getAbilityLength();
|
||||
int abilityLengthCap = mcMMO.p.getAdvancedConfig().getAbilityLengthCap();
|
||||
|
||||
int ticks;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.text;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.RankConfig;
|
||||
import com.gmail.nossr50.datatypes.json.McMMOUrl;
|
||||
import com.gmail.nossr50.datatypes.json.McMMOWebLinks;
|
||||
@ -64,7 +63,7 @@ public class TextComponentFactory {
|
||||
|
||||
public static void sendPlayerSubSkillWikiLink(Player player, String subskillformatted)
|
||||
{
|
||||
if(!Config.getInstance().getUrlLinksEnabled())
|
||||
if(!mcMMO.p.getGeneralConfig().getUrlLinksEnabled())
|
||||
return;
|
||||
|
||||
TextComponent.Builder wikiLinkComponent = Component.text().content(LocaleLoader.getString("Overhaul.mcMMO.MmoInfo.Wiki"));
|
||||
|
Reference in New Issue
Block a user