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; public static Boolean miningrequirespickaxe, excavationRequiresShovel, woodcuttingrequiresaxe;
/* Excavation */ /* Excavation */
public static int mbase; public static int getExcavationBaseXP() { return config.getInt("Experience.Excavation.Base", 40); }
/* Fishing */ /* Fishing */
public static int getFishingBaseXP() { return config.getInt("Experience.Fishing.Base", 800); } 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); } public static int getFishingTierLevelsTier5() { return config.getInt("Fishing.Tier_Levels.Tier5", 800); }
/* Herbalism */ /* Herbalism */
public static Boolean herbalismHungerBonus, wheatRegrowth; public static int getHerbalismXPSugarCane() { return config.getInt("Experience.Herbalism.Sugar_Cane", 30); }
public static int mmelon, mcactus, mmushroom, mflower, msugar, mpumpkin, mwheat, mvines, mlilypad, mnetherwart; 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; public static Boolean enableCobbleToMossy, enableSmoothToMossy, enableDirtToGrass;
/* Mining */ /* Mining */
@ -317,21 +328,6 @@ public class Config extends ConfigLoader{
showDisplayName = config.getBoolean("Spout.Party.HUD.Show_Display_Name", false); showDisplayName = config.getBoolean("Spout.Party.HUD.Show_Display_Name", false);
partybar = config.getBoolean("Spout.Party.HUD.Enabled", true); 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); moak = config.getInt("Experience.Woodcutting.Oak", 70);
mbirch = config.getInt("Experience.Woodcutting.Birch", 90); mbirch = config.getInt("Experience.Woodcutting.Birch", 90);
mspruce = config.getInt("Experience.Woodcutting.Spruce", 80); mspruce = config.getInt("Experience.Woodcutting.Spruce", 80);

View File

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

View File

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

View File

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