Part 1 of refactoring/config overhaul

This commit is contained in:
nossr50
2012-04-26 07:27:57 -07:00
parent f09b055872
commit 9606dd3501
40 changed files with 385 additions and 859 deletions

View File

@ -15,7 +15,7 @@ import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.LoadTreasures;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
@ -66,7 +66,7 @@ public class Excavation {
List<ExcavationTreasure> treasures = new ArrayList<ExcavationTreasure>();
int xp = LoadProperties.mbase;
int xp = Config.mbase;
if (mcPermissions.getInstance().excavationTreasures(player)) {
switch (type) {
@ -131,7 +131,7 @@ public class Excavation {
* @param block The block to check
*/
public static void gigaDrillBreaker(Player player, Block block) {
Skills.abilityDurabilityLoss(player.getItemInHand(), LoadProperties.abilityDurabilityLoss);
Skills.abilityDurabilityLoss(player.getItemInHand(), Config.abilityDurabilityLoss);
if (!block.hasMetadata("mcmmoPlacedBlock")) {
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
@ -141,7 +141,7 @@ public class Excavation {
Excavation.excavationProcCheck(block, player);
}
if (LoadProperties.spoutEnabled) {
if (Config.spoutEnabled) {
SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
}
}

View File

@ -21,7 +21,7 @@ import com.gmail.nossr50.Combat;
import com.gmail.nossr50.ItemChecks;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.LoadTreasures;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
@ -42,16 +42,16 @@ public class Fishing {
int level = PP.getSkillLevel(SkillType.FISHING);
int fishingTier;
if (level >= LoadProperties.fishingTier5) {
if (level >= Config.fishingTier5) {
fishingTier = 5;
}
else if (level >= LoadProperties.fishingTier4) {
else if (level >= Config.fishingTier4) {
fishingTier = 4;
}
else if (level >= LoadProperties.fishingTier3) {
else if (level >= Config.fishingTier3) {
fishingTier = 3;
}
else if (level >= LoadProperties.fishingTier2) {
else if (level >= Config.fishingTier2) {
fishingTier = 2;
}
else {
@ -97,7 +97,7 @@ public class Fishing {
break;
}
if (LoadProperties.fishingDrops && rewards.size() > 0) {
if (Config.fishingDrops && rewards.size() > 0) {
FishingTreasure treasure = rewards.get(random.nextInt(rewards.size()));
if (random.nextDouble() * 100 <= treasure.getDropChance()) {
@ -115,7 +115,7 @@ public class Fishing {
theCatch.getItemStack().setDurability((short) (random.nextInt(maxDurability))); //Change durability to random value
}
PP.addXP(SkillType.FISHING, LoadProperties.mfishing);
PP.addXP(SkillType.FISHING, Config.mfishing);
Skills.XpCheckSkill(SkillType.FISHING, player);
}

View File

@ -15,7 +15,7 @@ import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.AbilityType;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
@ -45,13 +45,13 @@ public class Herbalism {
player.updateInventory();
if (m.blockBreakSimulate(block, player, false)) {
if (LoadProperties.enableSmoothToMossy && type.equals(Material.SMOOTH_BRICK)) {
if (Config.enableSmoothToMossy && type.equals(Material.SMOOTH_BRICK)) {
block.setData((byte) 0x1); //Set type of the brick to mossy
}
else if (LoadProperties.enableDirtToGrass && type.equals(Material.DIRT)) {
else if (Config.enableDirtToGrass && type.equals(Material.DIRT)) {
block.setType(Material.GRASS);
}
else if (LoadProperties.enableCobbleToMossy && type.equals(Material.COBBLESTONE)) {
else if (Config.enableCobbleToMossy && type.equals(Material.COBBLESTONE)) {
block.setType(Material.MOSSY_COBBLESTONE);
}
}
@ -132,7 +132,7 @@ public class Herbalism {
case RED_MUSHROOM:
if (!block.hasMetadata("mcmmoPlacedBlock")) {
mat = Material.getMaterial(id);
xp = LoadProperties.mmushroom;
xp = Config.mmushroom;
}
break;
@ -145,7 +145,7 @@ public class Herbalism {
if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) {
catciDrops++;
}
xp += LoadProperties.mcactus;
xp += Config.mcactus;
}
}
}
@ -154,9 +154,9 @@ public class Herbalism {
case CROPS:
if (data == CropState.RIPE.getData()) {
mat = Material.WHEAT;
xp = LoadProperties.mwheat;
xp = Config.mwheat;
if (LoadProperties.wheatRegrowth && mcPermissions.getInstance().greenThumbWheat(player)) {
if (Config.wheatRegrowth && mcPermissions.getInstance().greenThumbWheat(player)) {
greenThumbWheat(block, player, event, plugin);
}
}
@ -165,14 +165,14 @@ public class Herbalism {
case MELON_BLOCK:
if (!block.hasMetadata("mcmmoPlacedBlock")) {
mat = Material.MELON;
xp = LoadProperties.mmelon;
xp = Config.mmelon;
}
break;
case NETHER_WARTS:
if (data == (byte) 0x3) {
mat = Material.NETHER_STALK;
xp = LoadProperties.mnetherwart;
xp = Config.mnetherwart;
}
break;
@ -180,7 +180,7 @@ public class Herbalism {
case JACK_O_LANTERN:
if (!block.hasMetadata("mcmmoPlacedBlock")) {
mat = Material.getMaterial(id);
xp = LoadProperties.mpumpkin;
xp = Config.mpumpkin;
}
break;
@ -188,7 +188,7 @@ public class Herbalism {
case YELLOW_FLOWER:
if (!block.hasMetadata("mcmmoPlacedBlock")) {
mat = Material.getMaterial(id);
xp = LoadProperties.mflower;
xp = Config.mflower;
}
break;
@ -201,7 +201,7 @@ public class Herbalism {
if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) {
caneDrops++;
}
xp += LoadProperties.msugar;
xp += Config.msugar;
}
}
}
@ -210,14 +210,14 @@ public class Herbalism {
case VINE:
if (!block.hasMetadata("mcmmoPlacedBlock")) {
mat = type;
xp = LoadProperties.mvines;
xp = Config.mvines;
}
break;
case WATER_LILY:
if (!block.hasMetadata("mcmmoPlacedBlock")) {
mat = type;
xp = LoadProperties.mlilypad;
xp = Config.mlilypad;
}
break;

View File

@ -15,7 +15,7 @@ import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.spout.SpoutSounds;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
@ -89,56 +89,56 @@ public class Mining {
switch (type) {
case COAL_ORE:
xp += LoadProperties.mcoal;
xp += Config.mcoal;
break;
case DIAMOND_ORE:
xp += LoadProperties.mdiamond;
xp += Config.mdiamond;
break;
case ENDER_STONE:
xp += LoadProperties.mendstone;
xp += Config.mendstone;
break;
case GLOWING_REDSTONE_ORE:
case REDSTONE_ORE:
xp += LoadProperties.mredstone;
xp += Config.mredstone;
break;
case GLOWSTONE:
xp += LoadProperties.mglowstone;
xp += Config.mglowstone;
break;
case GOLD_ORE:
xp += LoadProperties.mgold;
xp += Config.mgold;
break;
case IRON_ORE:
xp += LoadProperties.miron;
xp += Config.miron;
break;
case LAPIS_ORE:
xp += LoadProperties.mlapis;
xp += Config.mlapis;
break;
case MOSSY_COBBLESTONE:
xp += LoadProperties.mmossstone;
xp += Config.mmossstone;
break;
case NETHERRACK:
xp += LoadProperties.mnetherrack;
xp += Config.mnetherrack;
break;
case OBSIDIAN:
xp += LoadProperties.mobsidian;
xp += Config.mobsidian;
break;
case SANDSTONE:
xp += LoadProperties.msandstone;
xp += Config.msandstone;
break;
case STONE:
xp += LoadProperties.mstone;
xp += Config.mstone;
break;
default:
@ -216,7 +216,7 @@ public class Mining {
public static void SuperBreakerBlockCheck(Player player, Block block) {
Material type = block.getType();
int tier = m.getTier(player.getItemInHand());
int durabilityLoss = LoadProperties.abilityDurabilityLoss;
int durabilityLoss = Config.abilityDurabilityLoss;
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
switch (type) {
@ -259,7 +259,7 @@ public class Mining {
miningBlockCheck(player, block);
if (LoadProperties.spoutEnabled) {
if (Config.spoutEnabled) {
SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
}
}

View File

@ -19,7 +19,7 @@ import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.spout.SpoutSounds;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
@ -47,21 +47,21 @@ public class Repair {
/*
* REPAIR ARMOR
*/
if (ItemChecks.isArmor(is) && LoadProperties.repairArmor && mcPermissions.getInstance().armorRepair(player)) {
if (ItemChecks.isDiamondArmor(is) && inventory.contains(LoadProperties.rDiamond) && skillLevel >= LoadProperties.repairDiamondLevel && mcPermissions.getInstance().diamondRepair(player)) {
repairItem(player, is, new ItemStack(LoadProperties.rDiamond));
if (ItemChecks.isArmor(is) && Config.repairArmor && mcPermissions.getInstance().armorRepair(player)) {
if (ItemChecks.isDiamondArmor(is) && inventory.contains(Config.rDiamond) && skillLevel >= Config.repairDiamondLevel && mcPermissions.getInstance().diamondRepair(player)) {
repairItem(player, is, new ItemStack(Config.rDiamond));
xpHandler(player, PP, is, durabilityBefore, 6, true);
}
else if (ItemChecks.isIronArmor(is) && inventory.contains(LoadProperties.rIron) && skillLevel >= LoadProperties.repairIronLevel && mcPermissions.getInstance().ironRepair(player)) {
repairItem(player, is, new ItemStack(LoadProperties.rIron));
else if (ItemChecks.isIronArmor(is) && inventory.contains(Config.rIron) && skillLevel >= Config.repairIronLevel && mcPermissions.getInstance().ironRepair(player)) {
repairItem(player, is, new ItemStack(Config.rIron));
xpHandler(player, PP, is, durabilityBefore, 2, true);
}
else if (ItemChecks.isGoldArmor(is) && inventory.contains(LoadProperties.rGold) && skillLevel >= LoadProperties.repairGoldLevel && mcPermissions.getInstance().goldRepair(player)) {
repairItem(player, is, new ItemStack(LoadProperties.rGold));
else if (ItemChecks.isGoldArmor(is) && inventory.contains(Config.rGold) && skillLevel >= Config.repairGoldLevel && mcPermissions.getInstance().goldRepair(player)) {
repairItem(player, is, new ItemStack(Config.rGold));
xpHandler(player, PP, is, durabilityBefore, 4, true);
}
else if (ItemChecks.isLeatherArmor(is) && inventory.contains(LoadProperties.rLeather) && mcPermissions.getInstance().leatherRepair(player)) {
repairItem(player, is, new ItemStack(LoadProperties.rLeather));
else if (ItemChecks.isLeatherArmor(is) && inventory.contains(Config.rLeather) && mcPermissions.getInstance().leatherRepair(player)) {
repairItem(player, is, new ItemStack(Config.rLeather));
xpHandler(player, PP, is, durabilityBefore, 1, true);
}
else {
@ -72,29 +72,29 @@ public class Repair {
/*
* REPAIR TOOLS
*/
else if (ItemChecks.isTool(is) && LoadProperties.repairTools && mcPermissions.getInstance().toolRepair(player)) {
if (ItemChecks.isStoneTool(is) && inventory.contains(LoadProperties.rStone) && skillLevel >= LoadProperties.repairStoneLevel && mcPermissions.getInstance().stoneRepair(player)) {
repairItem(player, is, new ItemStack(LoadProperties.rStone));
else if (ItemChecks.isTool(is) && Config.repairTools && mcPermissions.getInstance().toolRepair(player)) {
if (ItemChecks.isStoneTool(is) && inventory.contains(Config.rStone) && skillLevel >= Config.repairStoneLevel && mcPermissions.getInstance().stoneRepair(player)) {
repairItem(player, is, new ItemStack(Config.rStone));
xpHandler(player, PP, is, durabilityBefore, 2, false);
}
else if (ItemChecks.isWoodTool(is) && inventory.contains(LoadProperties.rWood) && mcPermissions.getInstance().woodRepair(player)) {
repairItem(player, is, new ItemStack(LoadProperties.rWood));
else if (ItemChecks.isWoodTool(is) && inventory.contains(Config.rWood) && mcPermissions.getInstance().woodRepair(player)) {
repairItem(player, is, new ItemStack(Config.rWood));
xpHandler(player, PP, is, durabilityBefore, 2, false);
}
else if (ItemChecks.isIronTool(is) && inventory.contains(LoadProperties.rIron) && skillLevel >= LoadProperties.repairIronLevel && mcPermissions.getInstance().ironRepair(player)) {
repairItem(player, is, new ItemStack(LoadProperties.rIron));
else if (ItemChecks.isIronTool(is) && inventory.contains(Config.rIron) && skillLevel >= Config.repairIronLevel && mcPermissions.getInstance().ironRepair(player)) {
repairItem(player, is, new ItemStack(Config.rIron));
xpHandler(player, PP, is, durabilityBefore, 1, true);
}
else if (ItemChecks.isDiamondTool(is) && inventory.contains(LoadProperties.rDiamond) && skillLevel >= LoadProperties.repairDiamondLevel && mcPermissions.getInstance().diamondRepair(player)) {
repairItem(player, is, new ItemStack(LoadProperties.rDiamond));
else if (ItemChecks.isDiamondTool(is) && inventory.contains(Config.rDiamond) && skillLevel >= Config.repairDiamondLevel && mcPermissions.getInstance().diamondRepair(player)) {
repairItem(player, is, new ItemStack(Config.rDiamond));
xpHandler(player, PP, is, durabilityBefore, 1, true);
}
else if (ItemChecks.isGoldTool(is) && inventory.contains(LoadProperties.rGold) && skillLevel >= LoadProperties.repairGoldLevel && mcPermissions.getInstance().goldRepair(player)) {
repairItem(player, is, new ItemStack(LoadProperties.rGold));
else if (ItemChecks.isGoldTool(is) && inventory.contains(Config.rGold) && skillLevel >= Config.repairGoldLevel && mcPermissions.getInstance().goldRepair(player)) {
repairItem(player, is, new ItemStack(Config.rGold));
xpHandler(player, PP, is, durabilityBefore, 8, true);
}
else if (ItemChecks.isStringTool(is) && inventory.contains(LoadProperties.rString) && skillLevel >= LoadProperties.repairStringLevel && mcPermissions.getInstance().stringRepair(player)){
repairItem(player, is, new ItemStack(LoadProperties.rString));
else if (ItemChecks.isStringTool(is) && inventory.contains(Config.rString) && skillLevel >= Config.repairStringLevel && mcPermissions.getInstance().stringRepair(player)){
repairItem(player, is, new ItemStack(Config.rString));
xpHandler(player, PP, is, durabilityBefore, 2, false);
}
else {
@ -142,7 +142,7 @@ public class Repair {
Skills.XpCheckSkill(SkillType.REPAIR, player);
//CLANG CLANG
if (LoadProperties.spoutEnabled) {
if (Config.spoutEnabled) {
SpoutSounds.playRepairNoise(player, mcMMO.p);
}
}
@ -156,16 +156,16 @@ public class Repair {
public static int getArcaneForgingRank(PlayerProfile PP) {
int skillLevel = PP.getSkillLevel(SkillType.REPAIR);
if (skillLevel >= LoadProperties.arcaneRank4) {
if (skillLevel >= Config.arcaneRank4) {
return 4;
}
else if (skillLevel >= LoadProperties.arcaneRank3) {
else if (skillLevel >= Config.arcaneRank3) {
return 3;
}
else if (skillLevel >= LoadProperties.arcaneRank2) {
else if (skillLevel >= Config.arcaneRank2) {
return 2;
}
else if (skillLevel >= LoadProperties.arcaneRank1) {
else if (skillLevel >= Config.arcaneRank1) {
return 1;
}
else {
@ -204,7 +204,7 @@ public class Repair {
if (random.nextInt(100) <= getEnchantChance(rank)) {
int enchantLevel = enchant.getValue();
if (LoadProperties.mayDowngradeEnchants && enchantLevel > 1) {
if (Config.mayDowngradeEnchants && enchantLevel > 1) {
if (random.nextInt(100) <= getDowngradeChance(rank)) {
is.addEnchantment(enchantment, enchantLevel--);
downgraded = true;
@ -238,16 +238,16 @@ public class Repair {
public static int getEnchantChance(int rank) {
switch (rank) {
case 4:
return LoadProperties.keepEnchantsRank4;
return Config.keepEnchantsRank4;
case 3:
return LoadProperties.keepEnchantsRank3;
return Config.keepEnchantsRank3;
case 2:
return LoadProperties.keepEnchantsRank2;
return Config.keepEnchantsRank2;
case 1:
return LoadProperties.keepEnchantsRank1;
return Config.keepEnchantsRank1;
default:
return 0;
@ -263,16 +263,16 @@ public class Repair {
public static int getDowngradeChance(int rank) {
switch (rank) {
case 4:
return LoadProperties.downgradeRank4;
return Config.downgradeRank4;
case 3:
return LoadProperties.downgradeRank3;
return Config.downgradeRank3;
case 2:
return LoadProperties.downgradeRank2;
return Config.downgradeRank2;
case 1:
return LoadProperties.downgradeRank1;
return Config.downgradeRank1;
default:
return 100;
@ -356,45 +356,45 @@ public class Repair {
}
else {
if (ItemChecks.isDiamondTool(is) || ItemChecks.isDiamondArmor(is)) {
if (skillLevel < LoadProperties.repairDiamondLevel) {
if (skillLevel < Config.repairDiamondLevel) {
player.sendMessage(mcLocale.getString("Repair.Skills.AdeptDiamond"));
}
else {
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.BLUE + m.prettyItemString(LoadProperties.rDiamond));
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.BLUE + m.prettyItemString(Config.rDiamond));
}
}
else if (ItemChecks.isIronTool(is) || ItemChecks.isIronArmor(is)) {
if (skillLevel < LoadProperties.repairIronLevel) {
if (skillLevel < Config.repairIronLevel) {
player.sendMessage(mcLocale.getString("Repair.Skills.AdeptIron"));
}
else {
player.sendMessage(mcLocale.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + m.prettyItemString(LoadProperties.rIron));
player.sendMessage(mcLocale.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + m.prettyItemString(Config.rIron));
}
}
else if (ItemChecks.isGoldTool(is) || ItemChecks.isGoldArmor(is)) {
if (skillLevel < LoadProperties.repairGoldLevel) {
if (skillLevel < Config.repairGoldLevel) {
player.sendMessage(mcLocale.getString("Repair.Skills.AdeptGold"));
}
else {
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.GOLD + m.prettyItemString(LoadProperties.rGold));
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.GOLD + m.prettyItemString(Config.rGold));
}
}
else if (ItemChecks.isStoneTool(is)) {
if (skillLevel < LoadProperties.repairStoneLevel) {
if (skillLevel < Config.repairStoneLevel) {
player.sendMessage(mcLocale.getString("Repair.Skills.AdeptStone"));
}
else {
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.GRAY + m.prettyItemString(LoadProperties.rStone));
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.GRAY + m.prettyItemString(Config.rStone));
}
}
else if (ItemChecks.isWoodTool(is)) {
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.DARK_GREEN + m.prettyItemString(LoadProperties.rWood));
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.DARK_GREEN + m.prettyItemString(Config.rWood));
}
else if (ItemChecks.isLeatherArmor(is)) {
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.YELLOW + m.prettyItemString(LoadProperties.rLeather));
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.YELLOW + m.prettyItemString(Config.rLeather));
}
else if (ItemChecks.isStringTool(is)) {
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.YELLOW + m.prettyItemString(LoadProperties.rString));
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.YELLOW + m.prettyItemString(Config.rString));
}
}
}
@ -445,7 +445,7 @@ public class Repair {
}
/* Handle the enchants */
if (LoadProperties.mayLoseEnchants && !mcPermissions.getInstance().arcaneBypass(player)) {
if (Config.mayLoseEnchants && !mcPermissions.getInstance().arcaneBypass(player)) {
addEnchants(player, item);
}
@ -462,7 +462,7 @@ public class Repair {
PlayerProfile PP = Users.getProfile(player);
if (!PP.getPlacedAnvil()) {
if (LoadProperties.spoutEnabled) {
if (Config.spoutEnabled) {
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
if (sPlayer.isSpoutCraftEnabled()) {

View File

@ -14,7 +14,7 @@ import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.spout.SpoutStuff;
import com.gmail.nossr50.datatypes.AbilityType;
import com.gmail.nossr50.datatypes.PlayerProfile;
@ -80,7 +80,7 @@ public class Skills {
* @param skill The skill the ability is tied to
*/
public static void activationCheck(Player player, SkillType skill) {
if (LoadProperties.enableOnlyActivateWhenSneaking && !player.isSneaking()) {
if (Config.enableOnlyActivateWhenSneaking && !player.isSneaking()) {
return;
}
@ -111,7 +111,7 @@ public class Skills {
}
}
if (LoadProperties.enableAbilityMessages) {
if (Config.enableAbilityMessages) {
player.sendMessage(tool.getRaiseTool());
}
@ -201,7 +201,7 @@ public class Skills {
}
}
if (!LoadProperties.useMySQL) {
if (!Config.getUseMySQL()) {
ProcessLeaderboardUpdate(skillType, player);
ProcessLeaderboardUpdate(SkillType.ALL, player);
}
@ -209,18 +209,18 @@ public class Skills {
String capitalized = m.getCapitalized(skillType.toString());
/* Spout Stuff */
if (LoadProperties.spoutEnabled && player instanceof SpoutPlayer) {
if (Config.spoutEnabled && player instanceof SpoutPlayer) {
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
if (sPlayer.isSpoutCraftEnabled()) {
if (LoadProperties.xpbar) {
if (Config.xpbar) {
SpoutStuff.updateXpBar(player);
}
SpoutStuff.levelUpNotification(skillType, sPlayer);
/* Update custom titles */
if (LoadProperties.showPowerLevel) {
if (Config.getShowPowerLevelForSpout()) {
sPlayer.setTitle(sPlayer.getName()+ "\n" + ChatColor.YELLOW + "P" + ChatColor.GOLD + "lvl" + ChatColor.WHITE + "." + ChatColor.GREEN + String.valueOf(PP.getPowerLevel()));
}
}
@ -234,10 +234,10 @@ public class Skills {
}
/* Always update XP Bar (Check if no levels were gained first to remove redundancy) */
if (skillups == 0 && LoadProperties.spoutEnabled && player instanceof SpoutPlayer) {
if (skillups == 0 && Config.spoutEnabled && player instanceof SpoutPlayer) {
SpoutPlayer sPlayer = (SpoutPlayer) player;
if (sPlayer.isSpoutCraftEnabled()) {
if (LoadProperties.xpbar) {
if (Config.xpbar) {
SpoutStuff.updateXpBar(player);
}
}
@ -349,7 +349,7 @@ public class Skills {
* @param durabilityLoss The durability to remove from the item
*/
public static void abilityDurabilityLoss(ItemStack inhand, int durabilityLoss) {
if (LoadProperties.toolsLoseDurabilityFromAbilities) {
if (Config.toolsLoseDurabilityFromAbilities) {
if (!inhand.containsEnchantment(Enchantment.DURABILITY)) {
inhand.setDurability((short) (inhand.getDurability() + durabilityLoss));
}

View File

@ -22,7 +22,7 @@ import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale;
@ -214,12 +214,12 @@ public class Taming {
switch (type) {
case WOLF:
summonItem = Material.BONE;
summonAmount = LoadProperties.bonesConsumedByCOTW;
summonAmount = Config.bonesConsumedByCOTW;
break;
case OCELOT:
summonItem = Material.RAW_FISH;
summonAmount = LoadProperties.fishConsumedByCOTW;
summonAmount = Config.fishConsumedByCOTW;
break;
default:

View File

@ -16,7 +16,7 @@ import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
@ -53,7 +53,7 @@ public class WoodCutting {
* @param PP The PlayerProfile of the player
*/
private static void removeBlocks(ArrayList<Block> toBeFelled, Player player, PlayerProfile PP) {
if (toBeFelled.size() >= LoadProperties.treeFellerThreshold) {
if (toBeFelled.size() >= Config.treeFellerThreshold) {
player.sendMessage(mcLocale.getString("Woodcutting.Skills.TreeFellerThreshold"));
return;
}
@ -116,19 +116,19 @@ public class WoodCutting {
switch (species) {
case GENERIC:
xp += LoadProperties.moak;
xp += Config.moak;
break;
case REDWOOD:
xp += LoadProperties.mspruce;
xp += Config.mspruce;
break;
case BIRCH:
xp += LoadProperties.mbirch;
xp += Config.mbirch;
break;
case JUNGLE:
xp += LoadProperties.mjungle / 4; //Nerf XP from Jungle Trees when using Tree Feller
xp += Config.mjungle / 4; //Nerf XP from Jungle Trees when using Tree Feller
break;
default:
@ -187,7 +187,7 @@ public class WoodCutting {
private static void processTreeFelling(Block currentBlock, ArrayList<Block> toBeFelled) {
Material type = currentBlock.getType();
if(toBeFelled.size() >= LoadProperties.treeFellerThreshold) {
if(toBeFelled.size() >= Config.treeFellerThreshold) {
return;
}
@ -281,19 +281,19 @@ public class WoodCutting {
switch (species) {
case GENERIC:
xp += LoadProperties.moak;
xp += Config.moak;
break;
case REDWOOD:
xp += LoadProperties.mspruce;
xp += Config.mspruce;
break;
case BIRCH:
xp += LoadProperties.mbirch;
xp += Config.mbirch;
break;
case JUNGLE:
xp += LoadProperties.mjungle;
xp += Config.mjungle;
break;
default:
@ -315,11 +315,11 @@ public class WoodCutting {
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
mcMMO.p.getServer().getPluginManager().callEvent(armswing);
if (LoadProperties.woodcuttingrequiresaxe) {
Skills.abilityDurabilityLoss(player.getItemInHand(), LoadProperties.abilityDurabilityLoss);
if (Config.woodcuttingrequiresaxe) {
Skills.abilityDurabilityLoss(player.getItemInHand(), Config.abilityDurabilityLoss);
}
if (LoadProperties.spoutEnabled) {
if (Config.spoutEnabled) {
SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
}
}
@ -329,7 +329,7 @@ public class WoodCutting {
for (Block x : toBeFelled) {
if (x.getType().equals(Material.LOG)) {
durabilityLoss++;
durabilityLoss = durabilityLoss + LoadProperties.abilityDurabilityLoss;
durabilityLoss = durabilityLoss + Config.abilityDurabilityLoss;
}
}