Config overhaul part 5

This commit is contained in:
nossr50 2012-04-26 10:18:25 -07:00
parent f6c5aa9f84
commit 77c716bd6c
4 changed files with 27 additions and 31 deletions

View File

@ -93,7 +93,7 @@ public class Config extends ConfigLoader{
public static Boolean miningrequirespickaxe, excavationRequiresShovel, woodcuttingrequiresaxe;
/* Excavation */
public static int mbase;
public static int getExcavationBaseXP() { return config.getInt("Experience.Excavation.Base", 40); }
/* Fishing */
public static int getFishingBaseXP() { return config.getInt("Experience.Fishing.Base", 800); }
@ -105,8 +105,19 @@ public class Config extends ConfigLoader{
public static int getFishingTierLevelsTier5() { return config.getInt("Fishing.Tier_Levels.Tier5", 800); }
/* Herbalism */
public static Boolean herbalismHungerBonus, wheatRegrowth;
public static int mmelon, mcactus, mmushroom, mflower, msugar, mpumpkin, mwheat, mvines, mlilypad, mnetherwart;
public static int getHerbalismXPSugarCane() { return config.getInt("Experience.Herbalism.Sugar_Cane", 30); }
public static int getHerbalismXPWheat() { return config.getInt("Experience.Herbalism.Wheat", 50); }
public static int getHerbalismXPCactus() { return config.getInt("Experience.Herbalism.Cactus", 30); }
public static int getHerbalismXPPumpkin() { return config.getInt("Experience.Herbalism.Pumpkin", 20); }
public static int getHerbalismXPFlowers() { return config.getInt("Experience.Herbalism.Flowers", 100); }
public static int getHerbalismXPMushrooms() { return config.getInt("Experience.Herbalism.Mushrooms", 150); }
public static int getHerbalismXPMelon() { return config.getInt("Experience.Herbalism.Melon", 20); }
public static int getHerbalismXPNetherWart() { return config.getInt("Experience.Herbalism.Nether_Wart", 50); }
public static int getHerbalismXPLilyPads() { return config.getInt("Experience.Herbalism.Lily_Pads", 100); }
public static int getHerbalismXPVines() { return config.getInt("Experience.Herbalism.Vines", 10); }
public static boolean getHerbalismHungerBonusEnabled() { return config.getBoolean("Skills.Herbalism.Hunger_Bonus", true); }
public static boolean getHerbalismWheatRegrowth() { return config.getBoolean("Skills.Herbalism.Instant_Wheat_Regrowth", true); }
public static Boolean enableCobbleToMossy, enableSmoothToMossy, enableDirtToGrass;
/* Mining */
@ -317,21 +328,6 @@ public class Config extends ConfigLoader{
showDisplayName = config.getBoolean("Spout.Party.HUD.Show_Display_Name", false);
partybar = config.getBoolean("Spout.Party.HUD.Enabled", true);
mbase = config.getInt("Experience.Excavation.Base", 40);
msugar = config.getInt("Experience.Herbalism.Sugar_Cane", 30);
mwheat = config.getInt("Experience.Herbalism.Wheat", 50);
mcactus = config.getInt("Experience.Herbalism.Cactus", 30);
mpumpkin = config.getInt("Experience.Herbalism.Pumpkin", 20);
mflower = config.getInt("Experience.Herbalism.Flowers", 100);
mmushroom = config.getInt("Experience.Herbalism.Mushrooms", 150);
mmelon = config.getInt("Experience.Herbalism.Melon", 20);
mnetherwart = config.getInt("Experience.Herbalism.Nether_Wart", 50);
mlilypad = config.getInt("Experience.Herbalism.Lily_Pads", 100);
mvines = config.getInt("Experience.Herbalism.Vines", 10);
herbalismHungerBonus = config.getBoolean("Skills.Herbalism.Hunger_Bonus", true);
wheatRegrowth = config.getBoolean("Skills.Herbalism.Instant_Wheat_Regrowth", true);
moak = config.getInt("Experience.Woodcutting.Oak", 70);
mbirch = config.getInt("Experience.Woodcutting.Birch", 90);
mspruce = config.getInt("Experience.Woodcutting.Spruce", 80);

View File

@ -219,7 +219,7 @@ public class mcEntityListener implements Listener {
*/
@EventHandler (priority = EventPriority.LOW)
public void onFoodLevelChange(FoodLevelChangeEvent event) {
if (Config.herbalismHungerBonus) {
if (Config.getHerbalismHungerBonusEnabled()) {
if (event.getEntity() instanceof Player) {
Player player = (Player) event.getEntity();
PlayerProfile PP = Users.getProfile(player);

View File

@ -66,7 +66,7 @@ public class Excavation {
List<ExcavationTreasure> treasures = new ArrayList<ExcavationTreasure>();
int xp = Config.mbase;
int xp = Config.getExcavationBaseXP();
if (mcPermissions.getInstance().excavationTreasures(player)) {
switch (type) {

View File

@ -132,7 +132,7 @@ public class Herbalism {
case RED_MUSHROOM:
if (!block.hasMetadata("mcmmoPlacedBlock")) {
mat = Material.getMaterial(id);
xp = Config.mmushroom;
xp = Config.getHerbalismXPMushrooms();
}
break;
@ -145,7 +145,7 @@ public class Herbalism {
if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) {
catciDrops++;
}
xp += Config.mcactus;
xp += Config.getHerbalismXPCactus();
}
}
}
@ -154,9 +154,9 @@ public class Herbalism {
case CROPS:
if (data == CropState.RIPE.getData()) {
mat = Material.WHEAT;
xp = Config.mwheat;
xp = Config.getHerbalismXPWheat();
if (Config.wheatRegrowth && mcPermissions.getInstance().greenThumbWheat(player)) {
if (Config.getHerbalismWheatRegrowth() && 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 = Config.mmelon;
xp = Config.getHerbalismXPMelon();
}
break;
case NETHER_WARTS:
if (data == (byte) 0x3) {
mat = Material.NETHER_STALK;
xp = Config.mnetherwart;
xp = Config.getHerbalismXPNetherWart();
}
break;
@ -180,7 +180,7 @@ public class Herbalism {
case JACK_O_LANTERN:
if (!block.hasMetadata("mcmmoPlacedBlock")) {
mat = Material.getMaterial(id);
xp = Config.mpumpkin;
xp = Config.getHerbalismXPPumpkin();
}
break;
@ -188,7 +188,7 @@ public class Herbalism {
case YELLOW_FLOWER:
if (!block.hasMetadata("mcmmoPlacedBlock")) {
mat = Material.getMaterial(id);
xp = Config.mflower;
xp = Config.getHerbalismXPFlowers();
}
break;
@ -201,7 +201,7 @@ public class Herbalism {
if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) {
caneDrops++;
}
xp += Config.msugar;
xp += Config.getHerbalismXPSugarCane();
}
}
}
@ -210,14 +210,14 @@ public class Herbalism {
case VINE:
if (!block.hasMetadata("mcmmoPlacedBlock")) {
mat = type;
xp = Config.mvines;
xp = Config.getHerbalismXPVines();
}
break;
case WATER_LILY:
if (!block.hasMetadata("mcmmoPlacedBlock")) {
mat = type;
xp = Config.mlilypad;
xp = Config.getHerbalismXPLilyPads();
}
break;