Config overhaul part 4

This commit is contained in:
nossr50 2012-04-26 10:10:49 -07:00
parent 945e5ca11c
commit f6c5aa9f84
3 changed files with 20 additions and 23 deletions

View File

@ -96,9 +96,13 @@ public class Config extends ConfigLoader{
public static int mbase;
/* Fishing */
public static Boolean fishingDrops;
public static int fishingTier1, fishingTier2, fishingTier3, fishingTier4, fishingTier5;
public static int mfishing;
public static int getFishingBaseXP() { return config.getInt("Experience.Fishing.Base", 800); }
public static boolean getFishingDropsEnabled() { return config.getBoolean("Fishing.Drops_Enabled", true); }
public static int getFishingTierLevelsTier1() { return config.getInt("Fishing.Tier_Levels.Tier1", 0); }
public static int getFishingTierLevelsTier2() { return config.getInt("Fishing.Tier_Levels.Tier2", 200); }
public static int getFishingTierLevelsTier3() { return config.getInt("Fishing.Tier_Levels.Tier3", 400); }
public static int getFishingTierLevelsTier4() { return config.getInt("Fishing.Tier_Levels.Tier4", 600); }
public static int getFishingTierLevelsTier5() { return config.getInt("Fishing.Tier_Levels.Tier5", 800); }
/* Herbalism */
public static Boolean herbalismHungerBonus, wheatRegrowth;
@ -338,7 +342,7 @@ public class Config extends ConfigLoader{
mtameWolf = config.getInt("Experience.Taming.Animal_Taming.Wolf", 250);
mtameOcelot = config.getInt("Experience.Taming.Animal_Taming.Ocelot", 500);
mfishing = config.getInt("Experience.Fishing.Base", 800);
enableOnlyActivateWhenSneaking = config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false);
@ -429,14 +433,7 @@ public class Config extends ConfigLoader{
arcaneRank2 = config.getInt("Arcane_Forging.Rank_Levels.Rank_2", 250);
arcaneRank3 = config.getInt("Arcane_Forging.Rank_Levels.Rank_3", 500);
arcaneRank4 = config.getInt("Arcane_Forging.Rank_Levels.Rank_4", 750);
fishingDrops = config.getBoolean("Fishing.Drops_Enabled", true);
fishingTier1 = config.getInt("Fishing.Tier_Levels.Tier1", 0);
fishingTier2 = config.getInt("Fishing.Tier_Levels.Tier2", 200);
fishingTier3 = config.getInt("Fishing.Tier_Levels.Tier3", 400);
fishingTier4 = config.getInt("Fishing.Tier_Levels.Tier4", 600);
fishingTier5 = config.getInt("Fishing.Tier_Levels.Tier5", 800);
ptpCommandCooldown = config.getInt("Commands.ptp.Cooldown", 30);
detonatorID = config.getInt("Skills.Mining.Detonator_ID", 259);

View File

@ -212,23 +212,23 @@ public class LoadTreasures extends ConfigLoader{
int dropLevel = fTreasure.getDropLevel();
int maxLevel = fTreasure.getMaxLevel();
if(dropLevel <= Config.fishingTier1 && maxLevel >= Config.fishingTier1) {
if(dropLevel <= Config.getFishingTierLevelsTier1() && maxLevel >= Config.getFishingTierLevelsTier1()) {
fishingRewardsTier1.add(fTreasure);
}
if(dropLevel <= Config.fishingTier2 && maxLevel >= Config.fishingTier2) {
if(dropLevel <= Config.getFishingTierLevelsTier2() && maxLevel >= Config.getFishingTierLevelsTier2()) {
fishingRewardsTier2.add(fTreasure);
}
if (dropLevel <= Config.fishingTier3 && maxLevel >= Config.fishingTier3) {
if (dropLevel <= Config.getFishingTierLevelsTier3() && maxLevel >= Config.getFishingTierLevelsTier3()) {
fishingRewardsTier3.add(fTreasure);
}
if (dropLevel <= Config.fishingTier4 && maxLevel >= Config.fishingTier4) {
if (dropLevel <= Config.getFishingTierLevelsTier4() && maxLevel >= Config.getFishingTierLevelsTier4()) {
fishingRewardsTier4.add(fTreasure);
}
if (dropLevel <= Config.fishingTier5 && maxLevel >= Config.fishingTier5) {
if (dropLevel <= Config.getFishingTierLevelsTier5() && maxLevel >= Config.getFishingTierLevelsTier5()) {
fishingRewardsTier5.add(fTreasure);
}

View File

@ -42,16 +42,16 @@ public class Fishing {
int level = PP.getSkillLevel(SkillType.FISHING);
int fishingTier;
if (level >= Config.fishingTier5) {
if (level >= Config.getFishingTierLevelsTier5()) {
fishingTier = 5;
}
else if (level >= Config.fishingTier4) {
else if (level >= Config.getFishingTierLevelsTier4()) {
fishingTier = 4;
}
else if (level >= Config.fishingTier3) {
else if (level >= Config.getFishingTierLevelsTier3()) {
fishingTier = 3;
}
else if (level >= Config.fishingTier2) {
else if (level >= Config.getFishingTierLevelsTier2()) {
fishingTier = 2;
}
else {
@ -97,7 +97,7 @@ public class Fishing {
break;
}
if (Config.fishingDrops && rewards.size() > 0) {
if (Config.getFishingDropsEnabled() && 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, Config.mfishing);
PP.addXP(SkillType.FISHING, Config.getFishingBaseXP());
Skills.XpCheckSkill(SkillType.FISHING, player);
}