mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-03 04:55:28 +02:00
new config pt 9
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
@@ -37,7 +37,7 @@ public final class ChimaeraWing {
|
||||
* @param player Player whose item usage to check
|
||||
*/
|
||||
public static void activationCheck(Player player) {
|
||||
if (!Config.getInstance().getChimaeraEnabled()) {
|
||||
if (!MainConfig.getInstance().getChimaeraEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -60,13 +60,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 < MainConfig.getInstance().getChimaeraUseCost()) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.NotEnough",String.valueOf(MainConfig.getInstance().getChimaeraUseCost() - amount), "Item.ChimaeraWing.Name");
|
||||
return;
|
||||
}
|
||||
|
||||
long lastTeleport = mcMMOPlayer.getChimeraWingLastUse();
|
||||
int cooldown = Config.getInstance().getChimaeraCooldown();
|
||||
int cooldown = MainConfig.getInstance().getChimaeraCooldown();
|
||||
|
||||
if (cooldown > 0) {
|
||||
int timeRemaining = SkillUtils.calculateTimeLeft(lastTeleport * Misc.TIME_CONVERSION_FACTOR, cooldown, player);
|
||||
@@ -78,7 +78,7 @@ public final class ChimaeraWing {
|
||||
}
|
||||
|
||||
long recentlyHurt = mcMMOPlayer.getRecentlyHurt();
|
||||
int hurtCooldown = Config.getInstance().getChimaeraRecentlyHurtCooldown();
|
||||
int hurtCooldown = MainConfig.getInstance().getChimaeraRecentlyHurtCooldown();
|
||||
|
||||
if (hurtCooldown > 0) {
|
||||
int timeRemaining = SkillUtils.calculateTimeLeft(recentlyHurt * Misc.TIME_CONVERSION_FACTOR, hurtCooldown, player);
|
||||
@@ -91,9 +91,9 @@ public final class ChimaeraWing {
|
||||
|
||||
location = player.getLocation();
|
||||
|
||||
if (Config.getInstance().getChimaeraPreventUseUnderground()) {
|
||||
if (MainConfig.getInstance().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 - MainConfig.getInstance().getChimaeraUseCost())));
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.Fail");
|
||||
player.updateInventory();
|
||||
player.setVelocity(new Vector(0, 0.5D, 0));
|
||||
@@ -105,7 +105,7 @@ public final class ChimaeraWing {
|
||||
|
||||
mcMMOPlayer.actualizeTeleportCommenceLocation(player);
|
||||
|
||||
long warmup = Config.getInstance().getChimaeraWarmup();
|
||||
long warmup = MainConfig.getInstance().getChimaeraWarmup();
|
||||
|
||||
if (warmup > 0) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.ITEM_MESSAGE, "Teleport.Commencing", String.valueOf(warmup));
|
||||
@@ -119,7 +119,7 @@ public final class ChimaeraWing {
|
||||
public static void chimaeraExecuteTeleport() {
|
||||
Player player = mcMMOPlayer.getPlayer();
|
||||
|
||||
if (Config.getInstance().getChimaeraUseBedSpawn() && player.getBedSpawnLocation() != null) {
|
||||
if (MainConfig.getInstance().getChimaeraUseBedSpawn() && player.getBedSpawnLocation() != null) {
|
||||
player.teleport(player.getBedSpawnLocation());
|
||||
}
|
||||
else {
|
||||
@@ -132,12 +132,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() - MainConfig.getInstance().getChimaeraUseCost())));
|
||||
player.updateInventory();
|
||||
mcMMOPlayer.actualizeChimeraWingLastUse();
|
||||
mcMMOPlayer.setTeleportCommenceLocation(null);
|
||||
|
||||
if (Config.getInstance().getChimaeraSoundEnabled()) {
|
||||
if (MainConfig.getInstance().getChimaeraSoundEnabled()) {
|
||||
SoundManager.sendSound(player, location, SoundType.CHIMAERA_WING);
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public final class ChimaeraWing {
|
||||
}
|
||||
|
||||
public static ItemStack getChimaeraWing(int amount) {
|
||||
ItemStack itemStack = new ItemStack(Config.getInstance().getChimaeraItem(), amount);
|
||||
ItemStack itemStack = new ItemStack(MainConfig.getInstance().getChimaeraItem(), amount);
|
||||
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
itemMeta.setDisplayName(ChatColor.GOLD + LocaleLoader.getString("Item.ChimaeraWing.Name"));
|
||||
@@ -160,8 +160,8 @@ public final class ChimaeraWing {
|
||||
}
|
||||
|
||||
public static ShapelessRecipe getChimaeraWingRecipe() {
|
||||
Material ingredient = Config.getInstance().getChimaeraItem();
|
||||
int amount = Config.getInstance().getChimaeraRecipeCost();
|
||||
Material ingredient = MainConfig.getInstance().getChimaeraItem();
|
||||
int amount = MainConfig.getInstance().getChimaeraRecipeCost();
|
||||
|
||||
ShapelessRecipe chimeraWing = new ShapelessRecipe(new NamespacedKey(mcMMO.p, "Chimera"), getChimaeraWing(1));
|
||||
chimeraWing.addIngredient(amount, ingredient);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
@@ -14,8 +14,8 @@ public final class HardcoreManager {
|
||||
private HardcoreManager() {}
|
||||
|
||||
public static void invokeStatPenalty(Player player) {
|
||||
double statLossPercentage = Config.getInstance().getHardcoreDeathStatPenaltyPercentage();
|
||||
int levelThreshold = Config.getInstance().getHardcoreDeathStatPenaltyLevelThreshold();
|
||||
double statLossPercentage = MainConfig.getInstance().getHardcoreDeathStatPenaltyPercentage();
|
||||
int levelThreshold = MainConfig.getInstance().getHardcoreDeathStatPenaltyLevelThreshold();
|
||||
|
||||
PlayerProfile playerProfile = UserManager.getPlayer(player).getProfile();
|
||||
int totalLevelsLost = 0;
|
||||
@@ -56,8 +56,8 @@ public final class HardcoreManager {
|
||||
}
|
||||
|
||||
public static void invokeVampirism(Player killer, Player victim) {
|
||||
double vampirismStatLeechPercentage = Config.getInstance().getHardcoreVampirismStatLeechPercentage();
|
||||
int levelThreshold = Config.getInstance().getHardcoreVampirismLevelThreshold();
|
||||
double vampirismStatLeechPercentage = MainConfig.getInstance().getHardcoreVampirismStatLeechPercentage();
|
||||
int levelThreshold = MainConfig.getInstance().getHardcoreVampirismLevelThreshold();
|
||||
|
||||
PlayerProfile killerProfile = UserManager.getPlayer(killer).getProfile();
|
||||
PlayerProfile victimProfile = UserManager.getPlayer(victim).getProfile();
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.party.ItemWeightConfig;
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.ChatColor;
|
||||
@@ -149,7 +148,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 (MainConfig.getInstance().getUnarmedItemsAsUnarmed()) {
|
||||
return !isMinecraftTool(item);
|
||||
}
|
||||
|
||||
@@ -717,7 +716,7 @@ public final class ItemUtils {
|
||||
* @return true if the item is a miscellaneous drop, false otherwise
|
||||
*/
|
||||
public static boolean isMiscDrop(ItemStack item) {
|
||||
return ItemWeightConfig.getInstance().getMiscItems().contains(item.getType());
|
||||
return ItemWeightMainConfig.getInstance().getMiscItems().contains(item.getType());
|
||||
}
|
||||
|
||||
public static boolean isMcMMOItem(ItemStack item) {
|
||||
|
@@ -29,14 +29,14 @@ public final class Misc {
|
||||
|
||||
// Sound Pitches & Volumes from CB
|
||||
/* public static final float ANVIL_USE_PITCH = 0.3F; // Not in CB directly, I went off the place sound values
|
||||
public static final float ANVIL_USE_VOLUME = 1.0F * Config.getInstance().getMasterVolume(); // Not in CB directly, I went off the place sound values
|
||||
public static final float FIZZ_VOLUME = 0.5F * Config.getInstance().getMasterVolume();
|
||||
public static final float POP_VOLUME = 0.2F * Config.getInstance().getMasterVolume();
|
||||
public static final float BAT_VOLUME = 1.0F * Config.getInstance().getMasterVolume();
|
||||
public static final float ANVIL_USE_VOLUME = 1.0F * MainConfig.getInstance().getMasterVolume(); // Not in CB directly, I went off the place sound values
|
||||
public static final float FIZZ_VOLUME = 0.5F * MainConfig.getInstance().getMasterVolume();
|
||||
public static final float POP_VOLUME = 0.2F * MainConfig.getInstance().getMasterVolume();
|
||||
public static final float BAT_VOLUME = 1.0F * MainConfig.getInstance().getMasterVolume();
|
||||
public static final float BAT_PITCH = 0.6F;
|
||||
public static final float GHAST_VOLUME = 1.0F * Config.getInstance().getMasterVolume();
|
||||
public static final float GHAST_VOLUME = 1.0F * MainConfig.getInstance().getMasterVolume();
|
||||
public static final float LEVELUP_PITCH = 0.5F; // Reduced to differentiate between vanilla level-up
|
||||
public static final float LEVELUP_VOLUME = 0.75F * Config.getInstance().getMasterVolume(); // Use max volume always*/
|
||||
public static final float LEVELUP_VOLUME = 0.75F * MainConfig.getInstance().getMasterVolume(); // Use max volume always*/
|
||||
|
||||
public static final Set<String> modNames = ImmutableSet.of("LOTR", "BUILDCRAFT", "ENDERIO", "ENHANCEDBIOMES", "IC2", "METALLURGY", "FORESTRY", "GALACTICRAFT", "RAILCRAFT", "TWILIGHTFOREST", "THAUMCRAFT", "GRAVESTONEMOD", "GROWTHCRAFT", "ARCTICMOBS", "DEMONMOBS", "INFERNOMOBS", "SWAMPMOBS", "MARICULTURE", "MINESTRAPPOLATION");
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
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() || !MainConfig.getInstance().getMobHealthbarEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -58,12 +57,12 @@ public final class MobHealthbarUtils {
|
||||
}
|
||||
|
||||
boolean oldNameVisible = target.isCustomNameVisible();
|
||||
String newName = createHealthDisplay(Config.getInstance().getMobHealthbarDefault(), target, damage);
|
||||
String newName = createHealthDisplay(MainConfig.getInstance().getMobHealthbarDefault(), target, damage);
|
||||
|
||||
target.setCustomName(newName);
|
||||
target.setCustomNameVisible(true);
|
||||
|
||||
int displayTime = Config.getInstance().getMobHealthbarTime();
|
||||
int displayTime = MainConfig.getInstance().getMobHealthbarTime();
|
||||
|
||||
if (displayTime != -1) {
|
||||
boolean updateName = !ChatColor.stripColor(oldName).equalsIgnoreCase(ChatColor.stripColor(newName));
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
import com.gmail.nossr50.config.mods.CustomArmorConfig;
|
||||
import com.gmail.nossr50.config.mods.CustomBlockConfig;
|
||||
import com.gmail.nossr50.config.mods.CustomEntityConfig;
|
||||
@@ -89,71 +89,71 @@ public class ModManager {
|
||||
}
|
||||
|
||||
public boolean isCustomBoots(Material material) {
|
||||
return Config.getInstance().getArmorModsEnabled() && customBoots.contains(material);
|
||||
return MainConfig.getInstance().getArmorModsEnabled() && customBoots.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomChestplate(Material material) {
|
||||
return Config.getInstance().getArmorModsEnabled() && customChestplates.contains(material);
|
||||
return MainConfig.getInstance().getArmorModsEnabled() && customChestplates.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomHelmet(Material material) {
|
||||
return Config.getInstance().getArmorModsEnabled() && customHelmets.contains(material);
|
||||
return MainConfig.getInstance().getArmorModsEnabled() && customHelmets.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomLeggings(Material material) {
|
||||
return Config.getInstance().getArmorModsEnabled() && customLeggings.contains(material);
|
||||
return MainConfig.getInstance().getArmorModsEnabled() && customLeggings.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomAxe(Material material) {
|
||||
return Config.getInstance().getToolModsEnabled() && customAxes.contains(material);
|
||||
return MainConfig.getInstance().getToolModsEnabled() && customAxes.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomBow(Material material) {
|
||||
return Config.getInstance().getToolModsEnabled() && customBows.contains(material);
|
||||
return MainConfig.getInstance().getToolModsEnabled() && customBows.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomHoe(Material material) {
|
||||
return Config.getInstance().getToolModsEnabled() && customHoes.contains(material);
|
||||
return MainConfig.getInstance().getToolModsEnabled() && customHoes.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomPickaxe(Material material) {
|
||||
return Config.getInstance().getToolModsEnabled() && customPickaxes.contains(material);
|
||||
return MainConfig.getInstance().getToolModsEnabled() && customPickaxes.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomShovel(Material material) {
|
||||
return Config.getInstance().getToolModsEnabled() && customShovels.contains(material);
|
||||
return MainConfig.getInstance().getToolModsEnabled() && customShovels.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomSword(Material material) {
|
||||
return Config.getInstance().getToolModsEnabled() && customSwords.contains(material);
|
||||
return MainConfig.getInstance().getToolModsEnabled() && customSwords.contains(material);
|
||||
}
|
||||
|
||||
public boolean isCustomOre(Material data) {
|
||||
return Config.getInstance().getBlockModsEnabled() && customOres.contains(data);
|
||||
return MainConfig.getInstance().getBlockModsEnabled() && customOres.contains(data);
|
||||
}
|
||||
|
||||
public boolean isCustomLog(BlockState state) {
|
||||
return Config.getInstance().getBlockModsEnabled() && customLogs.contains(state.getType());
|
||||
return MainConfig.getInstance().getBlockModsEnabled() && customLogs.contains(state.getType());
|
||||
}
|
||||
|
||||
public boolean isCustomLeaf(BlockState state) {
|
||||
return Config.getInstance().getBlockModsEnabled() && customLeaves.contains(state.getType());
|
||||
return MainConfig.getInstance().getBlockModsEnabled() && customLeaves.contains(state.getType());
|
||||
}
|
||||
|
||||
public boolean isCustomAbilityBlock(BlockState state) {
|
||||
return Config.getInstance().getBlockModsEnabled() && customAbilityBlocks.contains(state.getType());
|
||||
return MainConfig.getInstance().getBlockModsEnabled() && customAbilityBlocks.contains(state.getType());
|
||||
}
|
||||
|
||||
public boolean isCustomExcavationBlock(BlockState state) {
|
||||
return Config.getInstance().getBlockModsEnabled() && customExcavationBlocks.contains(state.getType());
|
||||
return MainConfig.getInstance().getBlockModsEnabled() && customExcavationBlocks.contains(state.getType());
|
||||
}
|
||||
|
||||
public boolean isCustomHerbalismBlock(BlockState state) {
|
||||
return Config.getInstance().getBlockModsEnabled() && customHerbalismBlocks.contains(state.getType());
|
||||
return MainConfig.getInstance().getBlockModsEnabled() && customHerbalismBlocks.contains(state.getType());
|
||||
}
|
||||
|
||||
public boolean isCustomMiningBlock(BlockState state) {
|
||||
return Config.getInstance().getBlockModsEnabled() && customMiningBlocks.contains(state.getType());
|
||||
return MainConfig.getInstance().getBlockModsEnabled() && customMiningBlocks.contains(state.getType());
|
||||
}
|
||||
|
||||
public CustomBlock getBlock(BlockState state) {
|
||||
@@ -171,7 +171,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 MainConfig.getInstance().getToolModsEnabled() && item != null && customToolMap.containsKey(item.getType());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,7 +189,7 @@ public class ModManager {
|
||||
}
|
||||
|
||||
public boolean isCustomEntity(Entity entity) {
|
||||
if (!Config.getInstance().getEntityModsEnabled()) {
|
||||
if (!MainConfig.getInstance().getEntityModsEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ public class ModManager {
|
||||
}
|
||||
|
||||
public void addCustomEntity(Entity entity) {
|
||||
if (!Config.getInstance().getEntityModsEnabled()) {
|
||||
if (!MainConfig.getInstance().getEntityModsEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
@@ -70,11 +70,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", MainConfig.getInstance().getHardcoreDeathStatPenaltyPercentage()));
|
||||
}
|
||||
|
||||
if (vampirismEnabled) {
|
||||
player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.Vampirism.Stats", Config.getInstance().getHardcoreVampirismStatLeechPercentage()));
|
||||
player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.Vampirism.Stats", MainConfig.getInstance().getHardcoreVampirismStatLeechPercentage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.RankConfig;
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.json.McMMOUrl;
|
||||
import com.gmail.nossr50.datatypes.json.McMMOWebLinks;
|
||||
@@ -57,7 +56,7 @@ public class TextComponentFactory {
|
||||
|
||||
public static void sendPlayerSubSkillWikiLink(Player player, String subskillformatted)
|
||||
{
|
||||
if(!Config.getInstance().getUrlLinksEnabled())
|
||||
if(!MainConfig.getInstance().getUrlLinksEnabled())
|
||||
return;
|
||||
|
||||
Player.Spigot spigotPlayer = player.spigot();
|
||||
|
@@ -4,7 +4,7 @@ import com.gmail.nossr50.config.HiddenConfig;
|
||||
|
||||
public class ChunkletManagerFactory {
|
||||
public static ChunkletManager getChunkletManager() {
|
||||
HiddenConfig hConfig = HiddenConfig.getInstance();
|
||||
HiddenConfig hConfig = HiddenMainConfig.getInstance();
|
||||
|
||||
if (hConfig.getChunkletsEnabled()) {
|
||||
return new HashChunkletManager();
|
||||
|
@@ -4,7 +4,7 @@ import com.gmail.nossr50.config.HiddenConfig;
|
||||
|
||||
public class ChunkManagerFactory {
|
||||
public static ChunkManager getChunkManager() {
|
||||
HiddenConfig hConfig = HiddenConfig.getInstance();
|
||||
HiddenConfig hConfig = HiddenMainConfig.getInstance();
|
||||
|
||||
if (hConfig.getChunkletsEnabled()) {
|
||||
return new HashChunkManager();
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.blockmeta.conversion;
|
||||
|
||||
import com.gmail.nossr50.config.HiddenConfig;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
|
||||
@@ -19,7 +18,7 @@ public class BlockStoreConversionMain implements Runnable {
|
||||
this.world = world;
|
||||
this.scheduler = mcMMO.p.getServer().getScheduler();
|
||||
this.dataDir = new File(this.world.getWorldFolder(), "mcmmo_data");
|
||||
this.converters = new BlockStoreConversionXDirectory[HiddenConfig.getInstance().getConversionRate()];
|
||||
this.converters = new BlockStoreConversionXDirectory[HiddenMainConfig.getInstance().getConversionRate()];
|
||||
}
|
||||
|
||||
public void start() {
|
||||
@@ -52,7 +51,7 @@ public class BlockStoreConversionMain implements Runnable {
|
||||
|
||||
this.xDirs = this.dataDir.listFiles();
|
||||
|
||||
for (this.i = 0; (this.i < HiddenConfig.getInstance().getConversionRate()) && (this.i < this.xDirs.length); this.i++) {
|
||||
for (this.i = 0; (this.i < HiddenMainConfig.getInstance().getConversionRate()) && (this.i < this.xDirs.length); this.i++) {
|
||||
if (this.converters[this.i] == null) {
|
||||
this.converters[this.i] = new BlockStoreConversionXDirectory();
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.blockmeta.conversion;
|
||||
|
||||
import com.gmail.nossr50.config.HiddenConfig;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
|
||||
@@ -21,7 +20,7 @@ public class BlockStoreConversionXDirectory implements Runnable {
|
||||
public void start(org.bukkit.World world, File dataDir) {
|
||||
this.world = world;
|
||||
this.scheduler = mcMMO.p.getServer().getScheduler();
|
||||
this.converters = new BlockStoreConversionZDirectory[HiddenConfig.getInstance().getConversionRate()];
|
||||
this.converters = new BlockStoreConversionZDirectory[HiddenMainConfig.getInstance().getConversionRate()];
|
||||
this.dataDir = dataDir;
|
||||
|
||||
if (this.taskID >= 0) {
|
||||
@@ -53,7 +52,7 @@ public class BlockStoreConversionXDirectory implements Runnable {
|
||||
|
||||
this.zDirs = this.dataDir.listFiles();
|
||||
|
||||
for (this.i = 0; (this.i < HiddenConfig.getInstance().getConversionRate()) && (this.i < this.zDirs.length); this.i++) {
|
||||
for (this.i = 0; (this.i < HiddenMainConfig.getInstance().getConversionRate()) && (this.i < this.zDirs.length); this.i++) {
|
||||
if (this.converters[this.i] == null) {
|
||||
this.converters[this.i] = new BlockStoreConversionZDirectory();
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ 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.config.MainConfig;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
@@ -265,7 +265,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", MainConfig.getInstance().getOldUsersCutoff()));
|
||||
command.setPermission("mcmmo.commands.mcpurge");
|
||||
command.setPermissionMessage(permissionsMessage);
|
||||
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mcpurge"));
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.util.commands;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
@@ -47,7 +47,7 @@ public final class CommandUtils {
|
||||
}
|
||||
|
||||
public static boolean tooFar(CommandSender sender, Player target, boolean hasPermission) {
|
||||
if (sender instanceof Player && !Misc.isNear(((Player) sender).getLocation(), target.getLocation(), Config.getInstance().getInspectDistance()) && !hasPermission) {
|
||||
if (sender instanceof Player && !Misc.isNear(((Player) sender).getLocation(), target.getLocation(), MainConfig.getInstance().getInspectDistance()) && !hasPermission) {
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.TooFar"));
|
||||
return true;
|
||||
}
|
||||
@@ -262,7 +262,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 (MainConfig.getInstance().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.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.runnables.skills.ExperienceBarHideTask;
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.experience;
|
||||
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package com.gmail.nossr50.util.experience;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
import com.gmail.nossr50.datatypes.experience.FormulaType;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
@@ -25,7 +24,7 @@ public class FormulaManager {
|
||||
|
||||
public FormulaManager() {
|
||||
/* Setting for Classic Mode (Scales a lot of stuff up by * 10) */
|
||||
retroModeEnabled = Config.getInstance().getIsRetroMode();
|
||||
retroModeEnabled = MainConfig.getInstance().getIsRetroMode();
|
||||
loadFormula();
|
||||
}
|
||||
|
||||
@@ -80,7 +79,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 = MainConfig.getInstance().getLevelCap(primarySkillType);
|
||||
|
||||
while (experience > 0 && newLevel < maxLevel) {
|
||||
int experienceToNextLevel = getCachedXpToLevel(newLevel, formulaType);
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.player;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
|
@@ -1,6 +1,5 @@
|
||||
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.util.Permissions;
|
||||
|
@@ -1,6 +1,5 @@
|
||||
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.datatypes.skills.subskills.AbstractSubSkill;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.util.scoreboards;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
import com.gmail.nossr50.datatypes.database.PlayerStat;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
@@ -64,7 +64,7 @@ public class ScoreboardManager {
|
||||
* Stylizes the targetBoard in a Rainbow Pattern
|
||||
* This is off by default
|
||||
*/
|
||||
if (Config.getInstance().getScoreboardRainbows()) {
|
||||
if (MainConfig.getInstance().getScoreboardRainbows()) {
|
||||
// Everything but black, gray, gold
|
||||
List<ChatColor> colors = Lists.newArrayList(
|
||||
ChatColor.WHITE,
|
||||
@@ -145,7 +145,7 @@ public class ScoreboardManager {
|
||||
}
|
||||
|
||||
private static String formatAbility(ChatColor color, String abilityName) {
|
||||
if (Config.getInstance().getShowAbilityNames()) {
|
||||
if (MainConfig.getInstance().getShowAbilityNames()) {
|
||||
return getShortenedName(color + abilityName);
|
||||
}
|
||||
else {
|
||||
@@ -218,11 +218,11 @@ public class ScoreboardManager {
|
||||
}
|
||||
}
|
||||
|
||||
if (Config.getInstance().getPowerLevelTagsEnabled() && !dirtyPowerLevels.contains(playerName)) {
|
||||
if (MainConfig.getInstance().getPowerLevelTagsEnabled() && !dirtyPowerLevels.contains(playerName)) {
|
||||
dirtyPowerLevels.add(playerName);
|
||||
}
|
||||
|
||||
if (Config.getInstance().getSkillLevelUpBoard()) {
|
||||
if (MainConfig.getInstance().getSkillLevelUpBoard()) {
|
||||
enablePlayerSkillLevelUpScoreboard(player, skill);
|
||||
}
|
||||
}
|
||||
@@ -255,7 +255,7 @@ public class ScoreboardManager {
|
||||
wrapper.setOldScoreboard();
|
||||
wrapper.setTypeSkill(skill);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getSkillScoreboardTime());
|
||||
changeScoreboard(wrapper, MainConfig.getInstance().getSkillScoreboardTime());
|
||||
}
|
||||
|
||||
public static void enablePlayerSkillLevelUpScoreboard(Player player, PrimarySkillType skill) {
|
||||
@@ -269,7 +269,7 @@ public class ScoreboardManager {
|
||||
wrapper.setOldScoreboard();
|
||||
wrapper.setTypeSkill(skill);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getSkillLevelUpTime());
|
||||
changeScoreboard(wrapper, MainConfig.getInstance().getSkillLevelUpTime());
|
||||
}
|
||||
|
||||
public static void enablePlayerStatsScoreboard(Player player) {
|
||||
@@ -278,7 +278,7 @@ public class ScoreboardManager {
|
||||
wrapper.setOldScoreboard();
|
||||
wrapper.setTypeSelfStats();
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getStatsScoreboardTime());
|
||||
changeScoreboard(wrapper, MainConfig.getInstance().getStatsScoreboardTime());
|
||||
}
|
||||
|
||||
public static void enablePlayerInspectScoreboard(Player player, PlayerProfile targetProfile) {
|
||||
@@ -287,7 +287,7 @@ public class ScoreboardManager {
|
||||
wrapper.setOldScoreboard();
|
||||
wrapper.setTypeInspectStats(targetProfile);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getInspectScoreboardTime());
|
||||
changeScoreboard(wrapper, MainConfig.getInstance().getInspectScoreboardTime());
|
||||
}
|
||||
|
||||
public static void enablePlayerCooldownScoreboard(Player player) {
|
||||
@@ -296,7 +296,7 @@ public class ScoreboardManager {
|
||||
wrapper.setOldScoreboard();
|
||||
wrapper.setTypeCooldowns();
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getCooldownScoreboardTime());
|
||||
changeScoreboard(wrapper, MainConfig.getInstance().getCooldownScoreboardTime());
|
||||
}
|
||||
|
||||
public static void showPlayerRankScoreboard(Player player, Map<PrimarySkillType, Integer> rank) {
|
||||
@@ -306,7 +306,7 @@ public class ScoreboardManager {
|
||||
wrapper.setTypeSelfRank();
|
||||
wrapper.acceptRankData(rank);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getRankScoreboardTime());
|
||||
changeScoreboard(wrapper, MainConfig.getInstance().getRankScoreboardTime());
|
||||
}
|
||||
|
||||
public static void showPlayerRankScoreboardOthers(Player player, String targetName, Map<PrimarySkillType, Integer> rank) {
|
||||
@@ -316,7 +316,7 @@ public class ScoreboardManager {
|
||||
wrapper.setTypeInspectRank(targetName);
|
||||
wrapper.acceptRankData(rank);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getRankScoreboardTime());
|
||||
changeScoreboard(wrapper, MainConfig.getInstance().getRankScoreboardTime());
|
||||
}
|
||||
|
||||
public static void showTopScoreboard(Player player, PrimarySkillType skill, int pageNumber, List<PlayerStat> stats) {
|
||||
@@ -326,7 +326,7 @@ public class ScoreboardManager {
|
||||
wrapper.setTypeTop(skill, pageNumber);
|
||||
wrapper.acceptLeaderboardData(stats);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getTopScoreboardTime());
|
||||
changeScoreboard(wrapper, MainConfig.getInstance().getTopScoreboardTime());
|
||||
}
|
||||
|
||||
public static void showTopPowerScoreboard(Player player, int pageNumber, List<PlayerStat> stats) {
|
||||
@@ -336,7 +336,7 @@ public class ScoreboardManager {
|
||||
wrapper.setTypeTopPower(pageNumber);
|
||||
wrapper.acceptLeaderboardData(stats);
|
||||
|
||||
changeScoreboard(wrapper, Config.getInstance().getTopScoreboardTime());
|
||||
changeScoreboard(wrapper, MainConfig.getInstance().getTopScoreboardTime());
|
||||
}
|
||||
|
||||
// **** Helper methods **** //
|
||||
@@ -381,7 +381,7 @@ public class ScoreboardManager {
|
||||
* @return the main targetBoard objective, or null if disabled
|
||||
*/
|
||||
public static Objective getPowerLevelObjective() {
|
||||
if (!Config.getInstance().getPowerLevelTagsEnabled()) {
|
||||
if (!MainConfig.getInstance().getPowerLevelTagsEnabled()) {
|
||||
Objective objective = mcMMO.p.getServer().getScoreboardManager().getMainScoreboard().getObjective(POWER_OBJECTIVE);
|
||||
|
||||
if (objective != null) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.util.scoreboards;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
import com.gmail.nossr50.datatypes.database.PlayerStat;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
@@ -54,7 +54,7 @@ public class ScoreboardWrapper {
|
||||
sidebarObjective = this.scoreboard.registerNewObjective(ScoreboardManager.SIDEBAR_OBJECTIVE, "dummy");
|
||||
powerObjective = this.scoreboard.registerNewObjective(ScoreboardManager.POWER_OBJECTIVE, "dummy");
|
||||
|
||||
if (Config.getInstance().getPowerLevelTagsEnabled()) {
|
||||
if (MainConfig.getInstance().getPowerLevelTagsEnabled()) {
|
||||
powerObjective.setDisplayName(ScoreboardManager.TAG_POWER_LEVEL);
|
||||
powerObjective.setDisplaySlot(DisplaySlot.BELOW_NAME);
|
||||
|
||||
@@ -207,7 +207,7 @@ public class ScoreboardWrapper {
|
||||
|
||||
PlayerProfile profile = UserManager.getPlayer(player).getProfile();
|
||||
|
||||
if (profile.getScoreboardTipsShown() >= Config.getInstance().getTipsAmount()) {
|
||||
if (profile.getScoreboardTipsShown() >= MainConfig.getInstance().getTipsAmount()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.skills;
|
||||
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.util.skills;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
@@ -18,7 +18,7 @@ public final class ParticleEffectUtils {
|
||||
private ParticleEffectUtils() {};
|
||||
|
||||
public static void playBleedEffect(LivingEntity livingEntity) {
|
||||
if (!Config.getInstance().getBleedEffectEnabled()) {
|
||||
if (!MainConfig.getInstance().getBleedEffectEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public final class ParticleEffectUtils {
|
||||
}
|
||||
|
||||
public static void playDodgeEffect(Player player) {
|
||||
if (!Config.getInstance().getDodgeEffectEnabled()) {
|
||||
if (!MainConfig.getInstance().getDodgeEffectEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class ParticleEffectUtils {
|
||||
}
|
||||
|
||||
public static void playFluxEffect(Location location) {
|
||||
if (!Config.getInstance().getFluxEffectEnabled()) {
|
||||
if (!MainConfig.getInstance().getFluxEffectEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public final class ParticleEffectUtils {
|
||||
}
|
||||
|
||||
public static void playGreaterImpactEffect(LivingEntity livingEntity) {
|
||||
if (!Config.getInstance().getGreaterImpactEffectEnabled()) {
|
||||
if (!MainConfig.getInstance().getGreaterImpactEffectEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public final class ParticleEffectUtils {
|
||||
}
|
||||
|
||||
public static void playCallOfTheWildEffect(LivingEntity livingEntity) {
|
||||
if (!Config.getInstance().getCallOfTheWildEffectEnabled()) {
|
||||
if (!MainConfig.getInstance().getCallOfTheWildEffectEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public final class ParticleEffectUtils {
|
||||
}
|
||||
|
||||
public static void playAbilityEnabledEffect(Player player) {
|
||||
if (!Config.getInstance().getAbilityActivationEffectEnabled()) {
|
||||
if (!MainConfig.getInstance().getAbilityActivationEffectEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public final class ParticleEffectUtils {
|
||||
}
|
||||
|
||||
public static void playAbilityDisabledEffect(Player player) {
|
||||
if (!Config.getInstance().getAbilityDeactivationEffectEnabled()) {
|
||||
if (!MainConfig.getInstance().getAbilityDeactivationEffectEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public final class ParticleEffectUtils {
|
||||
Firework firework = (Firework) player.getWorld().spawnEntity(location, EntityType.FIREWORK);
|
||||
firework.setMetadata(mcMMO.funfettiMetadataKey, new FixedMetadataValue(mcMMO.p, null));
|
||||
FireworkMeta fireworkMeta = firework.getFireworkMeta();
|
||||
FireworkEffect effect = FireworkEffect.builder().flicker(false).withColor(color).with((Config.getInstance().getLargeFireworks() ? Type.BALL_LARGE : Type.BALL)).trail(true).build();
|
||||
FireworkEffect effect = FireworkEffect.builder().flicker(false).withColor(color).with((MainConfig.getInstance().getLargeFireworks() ? Type.BALL_LARGE : Type.BALL)).trail(true).build();
|
||||
fireworkMeta.addEffect(effect);
|
||||
fireworkMeta.addEffect(effect);
|
||||
fireworkMeta.setPower(0);
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.skills;
|
||||
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.skills;
|
||||
|
||||
import com.gmail.nossr50.config.RankConfig;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
|
@@ -1,8 +1,6 @@
|
||||
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.config.MainConfig;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainSource;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
@@ -117,7 +115,7 @@ public 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 MainConfig.getInstance().getLocale().equalsIgnoreCase("en_US") ? PrimarySkillType.getSkill(skillName) != null : isLocalizedSkill(skillName);
|
||||
}
|
||||
|
||||
public static void sendSkillMessage(Player player, NotificationType notificationType, String key) {
|
||||
@@ -131,7 +129,7 @@ public class SkillUtils {
|
||||
}
|
||||
|
||||
public static void handleAbilitySpeedIncrease(Player player) {
|
||||
if (HiddenConfig.getInstance().useEnchantmentBuffs()) {
|
||||
if (HiddenMainConfig.getInstance().useEnchantmentBuffs()) {
|
||||
ItemStack heldItem = player.getInventory().getItemInMainHand();
|
||||
|
||||
if (heldItem == null || heldItem.getType() == Material.AIR) {
|
||||
@@ -189,7 +187,7 @@ public class SkillUtils {
|
||||
}
|
||||
|
||||
public static void handleAbilitySpeedDecrease(Player player) {
|
||||
if (!HiddenConfig.getInstance().useEnchantmentBuffs()) {
|
||||
if (!HiddenMainConfig.getInstance().useEnchantmentBuffs()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.util.sounds;
|
||||
|
||||
import com.gmail.nossr50.config.SoundConfig;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
@@ -15,13 +14,13 @@ public class SoundManager {
|
||||
*/
|
||||
public static void sendSound(Player player, Location location, SoundType soundType)
|
||||
{
|
||||
if(SoundConfig.getInstance().getIsEnabled(soundType))
|
||||
if(SoundMainConfig.getInstance().getIsEnabled(soundType))
|
||||
player.playSound(location, getSound(soundType), SoundCategory.MASTER, getVolume(soundType), getPitch(soundType));
|
||||
}
|
||||
|
||||
public static void sendCategorizedSound(Player player, Location location, SoundType soundType, SoundCategory soundCategory)
|
||||
{
|
||||
if(SoundConfig.getInstance().getIsEnabled(soundType))
|
||||
if(SoundMainConfig.getInstance().getIsEnabled(soundType))
|
||||
player.playSound(location, getSound(soundType), soundCategory, getVolume(soundType), getPitch(soundType));
|
||||
}
|
||||
|
||||
@@ -29,13 +28,13 @@ public class SoundManager {
|
||||
{
|
||||
float totalPitch = Math.min(2.0F, (getPitch(soundType) + pitchModifier));
|
||||
|
||||
if(SoundConfig.getInstance().getIsEnabled(soundType))
|
||||
if(SoundMainConfig.getInstance().getIsEnabled(soundType))
|
||||
player.playSound(location, getSound(soundType), soundCategory, getVolume(soundType), totalPitch);
|
||||
}
|
||||
|
||||
public static void worldSendSound(World world, Location location, SoundType soundType)
|
||||
{
|
||||
if(SoundConfig.getInstance().getIsEnabled(soundType))
|
||||
if(SoundMainConfig.getInstance().getIsEnabled(soundType))
|
||||
world.playSound(location, getSound(soundType), getVolume(soundType), getPitch(soundType));
|
||||
}
|
||||
|
||||
@@ -46,7 +45,7 @@ public class SoundManager {
|
||||
*/
|
||||
private static float getVolume(SoundType soundType)
|
||||
{
|
||||
return SoundConfig.getInstance().getVolume(soundType) * SoundConfig.getInstance().getMasterVolume();
|
||||
return SoundMainConfig.getInstance().getVolume(soundType) * SoundMainConfig.getInstance().getMasterVolume();
|
||||
}
|
||||
|
||||
private static float getPitch(SoundType soundType)
|
||||
@@ -56,7 +55,7 @@ public class SoundManager {
|
||||
else if (soundType == SoundType.POP)
|
||||
return getPopPitch();
|
||||
else
|
||||
return SoundConfig.getInstance().getPitch(soundType);
|
||||
return SoundMainConfig.getInstance().getPitch(soundType);
|
||||
}
|
||||
|
||||
private static Sound getSound(SoundType soundType)
|
||||
|
Reference in New Issue
Block a user