MASSIVE config overhaul - most keys are now based on the "proper" name

given to a material or entity by Bukkit.

This WILL wipe some custom values you may have set, so please verify
that your values are what you want them to be after the new config file
is generated.
This commit is contained in:
GJ 2013-02-20 16:44:15 -05:00
parent 17a85c94c6
commit c589c5556b
21 changed files with 356 additions and 780 deletions

View File

@ -2,7 +2,13 @@ package com.gmail.nossr50.config;
import java.util.Set;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.EntityType;
import com.gmail.nossr50.skills.utilities.AbilityType;
import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.util.StringUtils;
public class Config extends ConfigLoader {
private static Config instance;
@ -63,10 +69,14 @@ public class Config extends ConfigLoader {
private static String getStringIncludingInts(ConfigurationSection cfg, String key) {
String str = cfg.getString(key);
if (str == null)
if (str == null) {
str = String.valueOf(cfg.getInt(key));
if (str == null)
}
if (str == "0") {
str = "No value set for '" + key + "'";
}
return str;
}
@ -119,30 +129,13 @@ public class Config extends ConfigLoader {
public boolean getAbilitiesEnabled() { return config.getBoolean("Abilities.Enabled", true); }
public boolean getAbilitiesOnlyActivateWhenSneaking() { return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); }
public int getCooldown(AbilityType ability) { return config.getInt("Abilities.Cooldowns." + ability.toString()); }
public int getMaxTicks(AbilityType ability) { return config.getInt("Abilities.Max_Seconds." + ability.toString()); }
/* Durability Settings */
public boolean getAbilitiesDamageTools() { return config.getBoolean("Abilities.Tools.Durability_Loss_Enabled", true); }
public int getAbilityToolDamage() { return config.getInt("Abilities.Tools.Durability_Loss", 2); }
/* Cooldowns */
public int getAbilityCooldownGreenTerra() { return config.getInt("Abilities.Cooldowns.Green_Terra", 240); }
public int getAbilityCooldownSuperBreaker() { return config.getInt("Abilities.Cooldowns.Super_Breaker", 240); }
public int getAbilityCooldownGigaDrillBreaker() { return config.getInt("Abilities.Cooldowns.Giga_Drill_Breaker", 240); }
public int getAbilityCooldownTreeFeller() { return config.getInt("Abilities.Cooldowns.Tree_Feller", 240); }
public int getAbilityCooldownBerserk() { return config.getInt("Abilities.Cooldowns.Berserk", 240); }
public int getAbilityCooldownSerratedStrikes() { return config.getInt("Abilities.Cooldowns.Serrated_Strikes", 240); }
public int getAbilityCooldownSkullSplitter() { return config.getInt("Abilities.Cooldowns.Skull_Splitter", 240); }
public int getAbilityCooldownBlastMining() { return config.getInt("Abilities.Cooldowns.Blast_Mining", 60); }
/* Max ticks */
public int getAbilityMaxTicksGreenTerra() { return config.getInt("Abilities.Max_Seconds.Green_Terra", 0); }
public int getAbilityMaxTicksSuperBreaker() { return config.getInt("Abilities.Max_Seconds.Super_Breaker", 0); }
public int getAbilityMaxTicksGigaDrillBreaker() { return config.getInt("Abilities.Max_Seconds.Giga_Drill_Breaker", 0); }
public int getAbilityMaxTicksTreeFeller() { return config.getInt("Abilities.Max_Seconds.Tree_Feller", 0); }
public int getAbilityMaxTicksBerserk() { return config.getInt("Abilities.Max_Seconds.Berserk", 0); }
public int getAbilityMaxTicksSerratedStrikes() { return config.getInt("Abilities.Max_Seconds.Serrated_Strikes", 0); }
public int getAbilityMaxTicksSkullSplitter() { return config.getInt("Abilities.Max_Seconds.Skull_Splitter", 0); }
public int getAbilityMaxTicksBlastMining() { return config.getInt("Abilities.Max_Seconds.Blast_Mining", 0); }
/* Thresholds */
public int getTreeFellerThreshold() { return config.getInt("Abilities.Limits.Tree_Feller_Threshold", 500); }
@ -150,268 +143,13 @@ public class Config extends ConfigLoader {
* SKILL SETTINGS
*/
/* Tool Requirements */
public boolean getWoodcuttingRequiresTool() { return config.getBoolean("Skills.Woodcutting.Requires_Axe", true); }
public int getXp(SkillType skill, Material material) { return config.getInt("Experience." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); }
public boolean getDoubleDropsEnabled(SkillType skill, Material material) { return config.getBoolean("Double_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); }
/* Excavation */
public int getExcavationClayXP() { return config.getInt("Experience.Excavation.Clay", 40); }
public int getExcavationDirtXP() { return config.getInt("Experience.Excavation.Dirt", 40); }
public int getExcavationGrassXP() { return config.getInt("Experience.Excavation.Grass", 40); }
public int getExcavationGravelXP() { return config.getInt("Experience.Excavation.Gravel", 40); }
public int getExcavationMycelXP() { return config.getInt("Experience.Excavation.Mycel", 40); }
public int getExcavationSandXP() { return config.getInt("Experience.Excavation.Sand", 40); }
public int getExcavationSoulSandXP() { return config.getInt("Experience.Excavation.SoulSand", 40); }
/* Fishing */
public int getFishingBaseXP() { return config.getInt("Experience.Fishing.Base", 800); }
public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }
/* Herbalism */
public int getHerbalismXPSugarCane() { return config.getInt("Experience.Herbalism.Sugar_Cane", 30); }
public int getHerbalismXPWheat() { return config.getInt("Experience.Herbalism.Wheat", 50); }
public int getHerbalismXPCactus() { return config.getInt("Experience.Herbalism.Cactus", 30); }
public int getHerbalismXPPumpkin() { return config.getInt("Experience.Herbalism.Pumpkin", 20); }
public int getHerbalismXPFlowers() { return config.getInt("Experience.Herbalism.Flowers", 100); }
public int getHerbalismXPMushrooms() { return config.getInt("Experience.Herbalism.Mushrooms", 150); }
public int getHerbalismXPMelon() { return config.getInt("Experience.Herbalism.Melon", 20); }
public int getHerbalismXPNetherWart() { return config.getInt("Experience.Herbalism.Nether_Wart", 50); }
public int getHerbalismXPLilyPads() { return config.getInt("Experience.Herbalism.Lily_Pads", 100); }
public int getHerbalismXPVines() { return config.getInt("Experience.Herbalism.Vines", 10); }
public int getHerbalismXPCocoa() { return config.getInt("Experience.Herbalism.Cocoa", 30); }
public int getHerbalismXPCarrot() { return config.getInt("Experience.Herbalism.Carrot", 50); }
public int getHerbalismXPPotato() { return config.getInt("Experience.Herbalism.Potato", 50); }
public boolean getBrownMushroomsDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Brown_Mushrooms", true); }
public boolean getCactiDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Cacti", true); }
public boolean getWheatDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Wheat", true); }
public boolean getMelonsDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Melons", true); }
public boolean getNetherWartsDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Nether_Warts", true); }
public boolean getPumpkinsDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Pumpkins", true); }
public boolean getRedMushroomsDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Red_Mushrooms", true); }
public boolean getRedRosesDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Red_Roses", true); }
public boolean getSugarCaneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Sugar_Cane", true); }
public boolean getVinesDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Vines", true); }
public boolean getWaterLiliesDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Water_Lilies", true); }
public boolean getYellowFlowersDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Yellow_Flowers", true); }
public boolean getCocoaDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Cocoa", true); }
public boolean getCarrotDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Carrot", true); }
public boolean getPotatoDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Potato", true); }
public boolean herbalismDoubleDropsDisabled() {
return doubleDropsDisabled("Herbalism");
}
/* Mining */
public int getMiningXPGoldOre() { return config.getInt("Experience.Mining.Gold", 250); }
public int getMiningXPDiamondOre() { return config.getInt("Experience.Mining.Diamond", 750); }
public int getMiningXPIronOre() { return config.getInt("Experience.Mining.Iron", 250); }
public int getMiningXPRedstoneOre() { return config.getInt("Experience.Mining.Redstone", 150); }
public int getMiningXPLapisOre() { return config.getInt("Experience.Mining.Lapis", 400); }
public int getMiningXPObsidian() { return config.getInt("Experience.Mining.Obsidian", 150); }
public int getMiningXPNetherrack() { return config.getInt("Experience.Mining.Netherrack", 30); }
public int getMiningXPGlowstone() { return config.getInt("Experience.Mining.Glowstone", 30); }
public int getMiningXPCoalOre() { return config.getInt("Experience.Mining.Coal", 100); }
public int getMiningXPStone() { return config.getInt("Experience.Mining.Stone", 30); }
public int getMiningXPSandstone() { return config.getInt("Experience.Mining.Sandstone", 30); }
public int getMiningXPEndStone() { return config.getInt("Experience.Mining.End_Stone", 150); }
public int getMiningXPMossyStone() { return config.getInt("Experience.Mining.Moss_Stone", 30); }
public int getMiningXPEmeraldOre() { return config.getInt("Experience.Mining.Emerald", 1000); }
public boolean getCoalDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Coal", true); }
public boolean getDiamondDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Diamond", true); }
public boolean getEndStoneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.End_Stone", true); }
public boolean getGlowstoneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Glowstone", true); }
public boolean getGoldDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Gold", true); }
public boolean getIronDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Iron", true); }
public boolean getLapisDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Lapis", true); }
public boolean getMossyCobblestoneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Moss_Stone", true); }
public boolean getNetherrackDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Netherrack", true); }
public boolean getObsidianDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Obsidian", true); }
public boolean getRedstoneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Redstone", true); }
public boolean getSandstoneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Sandstone", true); }
public boolean getStoneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Stone", true); }
public boolean getEmeraldDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Emerald", true); }
public boolean miningDoubleDropsDisabled() {
return doubleDropsDisabled("Mining");
}
public int getDetonatorItemID() { return config.getInt("Skills.Mining.Detonator_ID", 259); }
/* Repair */
public boolean getRepairAnvilMessagesEnabled() { return config.getBoolean("Skills.Repair.Anvil_Messages", true); }
public int getRepairAnvilId() { return config.getInt("Skills.Repair.Anvil_ID", 42); }
public boolean getSalvageEnabled() { return config.getBoolean("Skills.Repair.Salvage_enabled", true); }
public int getSalvageAnvilId() { return config.getInt("Skills.Repair.Salvage_Anvil_ID", 41); }
public int getSalvageUnlockLevel() { return config.getInt("Skills.Repair.Salvage_UnlockLevel", 600); }
public boolean getSalvageTools() { return config.getBoolean("Skills.Repair.Salvage_tools", true); }
public boolean getSalvageArmor() { return config.getBoolean("Skills.Repair.Salvage_armor", true); }
/* Smelting */
public int getSmeltingXPCoal() { return config.getInt("Experience.Smelting.Coal", 10); }
public int getSmeltingXPRedstone() { return config.getInt("Experience.Smelting.Redstone", 15); }
public int getSmeltingXPIron() { return config.getInt("Experience.Smelting.Iron", 25); }
public int getSmeltingXPGold() { return config.getInt("Experience.Smelting.Gold", 35); }
public int getSmeltingXPDiamond() { return config.getInt("Experience.Smelting.Diamond", 75); }
public int getSmeltingXPLapis() { return config.getInt("Experience.Smelting.Lapis", 40); }
public int getSmeltingXPEmerald() { return config.getInt("Experience.Smelting.Emerald", 100); }
/* Unarmed */
public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); }
/* Taming */
public int getTamingXPWolf() { return config.getInt("Experience.Taming.Animal_Taming.Wolf", 250); }
public int getTamingXPOcelot() { return config.getInt("Experience.Taming.Animal_Taming.Ocelot", 500); }
public int getTamingCOTWWolfCost() { return config.getInt("Skills.Taming.Call_Of_The_Wild.Bones_Required", 10); }
public int getTamingCOTWOcelotCost() { return config.getInt("Skills.Taming.Call_Of_The_Wild.Fish_Required", 10); }
/* Woodcutting */
public int getWoodcuttingXPOak() { return config.getInt("Experience.Woodcutting.Oak", 70); }
public int getWoodcuttingXPBirch() { return config.getInt("Experience.Woodcutting.Birch", 90); }
public int getWoodcuttingXPSpruce() { return config.getInt("Experience.Woodcutting.Spruce", 80); }
public int getWoodcuttingXPJungle() { return config.getInt("Experience.Woodcutting.Jungle", 100); }
public int getWoodcuttingXPHugeBrownMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Brown", 70); }
public int getWoodcuttingXPHugeRedMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Red", 70); }
public boolean getOakDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Oak", true); }
public boolean getBirchDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Birch", true); }
public boolean getSpruceDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Spruce", true); }
public boolean getJungleDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Jungle", true); }
public boolean woodcuttingDoubleDropsDisabled() {
return doubleDropsDisabled("Woodcutting");
}
/* AFK Leveling */
public boolean getAcrobaticsAFKDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); }
public boolean getHerbalismAFKDisabled() { return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); }
/* Dogde Lightning */
public boolean getDodgeLightningDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); }
/* Level Caps */
public int getLevelCapAcrobatics() {
return getLevelCap("Skills.Acrobatics.Level_Cap");
}
public int getLevelCapArchery() {
return getLevelCap("Skills.Archery.Level_Cap");
}
public int getLevelCapAxes() {
return getLevelCap("Skills.Axes.Level_Cap");
}
public int getLevelCapExcavation() {
return getLevelCap("Skills.Excavation.Level_Cap");
}
public int getLevelCapFishing() {
return getLevelCap("Skills.Fishing.Level_Cap");
}
public int getLevelCapHerbalism() {
return getLevelCap("Skills.Herbalism.Level_Cap");
}
public int getLevelCapMining() {
return getLevelCap("Skills.Mining.Level_Cap");
}
public int getLevelCapRepair() {
return getLevelCap("Skills.Repair.Level_Cap");
}
public int getLevelCapSmelting() {
return getLevelCap("Skills.Smelting.Level_Cap");
}
public int getLevelCapSwords() {
return getLevelCap("Skills.Swords.Level_Cap");
}
public int getLevelCapTaming() {
return getLevelCap("Skills.Taming.Level_Cap");
}
public int getLevelCapUnarmed() {
return getLevelCap("Skills.Unarmed.Level_Cap");
}
public int getLevelCapWoodcutting() {
return getLevelCap("Skills.Woodcutting.Level_Cap");
}
public int getPowerLevelCap() {
return getLevelCap("General.Power_Level_Cap");
}
/* PVP & PVE Settings */
public boolean getAcrobaticsPVP() { return config.getBoolean("Skills.Acrobatics.Enabled_For_PVP", true); }
public boolean getAcrobaticsPVE() { return config.getBoolean("Skills.Acrobatics.Enabled_For_PVE", true); }
public boolean getArcheryPVP() { return config.getBoolean("Skills.Archery.Enabled_For_PVP", true); }
public boolean getArcheryPVE() { return config.getBoolean("Skills.Archery.Enabled_For_PVE", true); }
public boolean getAxesPVP() { return config.getBoolean("Skills.Axes.Enabled_For_PVP", true); }
public boolean getAxesPVE() { return config.getBoolean("Skills.Axes.Enabled_For_PVE", true); }
public boolean getSwordsPVP() { return config.getBoolean("Skills.Swords.Enabled_For_PVP", true); }
public boolean getSwordsPVE() { return config.getBoolean("Skills.Swords.Enabled_For_PVE", true); }
public boolean getTamingPVP() { return config.getBoolean("Skills.Taming.Enabled_For_PVP", true); }
public boolean getTamingPVE() { return config.getBoolean("Skills.Taming.Enabled_For_PVE", true); }
public boolean getUnarmedPVP() { return config.getBoolean("Skills.Unarmed.Enabled_For_PVP", true); }
public boolean getUnarmedPVE() { return config.getBoolean("Skills.Unarmed.Enabled_For_PVE", true); }
/*
* XP SETTINGS
*/
/* General Settings */
public boolean getExperienceGainsMobspawnersEnabled() { return config.getBoolean("Experience.Gains.Mobspawners.Enabled", false); }
public boolean getExperienceGainsPlayerVersusPlayerEnabled() { return config.getBoolean("Experience.PVP.Rewards", true); }
public double getExperienceGainsGlobalMultiplier() { return config.getDouble("Experience.Gains.Multiplier.Global", 1.0); }
public void setExperienceGainsGlobalMultiplier(double value) { config.set("Experience.Gains.Multiplier.Global", value); }
/* Combat XP Multipliers */
public double getPlayerVersusPlayerXP() { return config.getDouble("Experience.Gains.Multiplier.PVP", 1.0); }
public double getAnimalsXP() { return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); }
public double getCreeperXP() { return config.getDouble("Experience.Combat.Multiplier.Creeper", 4.0); }
public double getSkeletonXP() { return config.getDouble("Experience.Combat.Multiplier.Skeleton", 2.0); }
public double getSpiderXP() { return config.getDouble("Experience.Combat.Multiplier.Spider", 3.0); }
public double getGhastXP() { return config.getDouble("Experience.Combat.Multiplier.Ghast", 3.0); }
public double getSlimeXP() { return config.getDouble("Experience.Combat.Multiplier.Slime", 2.0); }
public double getZombieXP() { return config.getDouble("Experience.Combat.Multiplier.Zombie", 2.0); }
public double getPigZombieXP() { return config.getDouble("Experience.Combat.Multiplier.Pig_Zombie", 3.0); }
public double getEndermanXP() { return config.getDouble("Experience.Combat.Multiplier.Enderman", 1.0); }
public double getCaveSpiderXP() { return config.getDouble("Experience.Combat.Multiplier.Cave_Spider", 3.0); }
public double getSilverfishXP() { return config.getDouble("Experience.Combat.Multiplier.Silverfish", 3.0); }
public double getBlazeXP() { return config.getDouble("Experience.Combat.Multiplier.Blaze", 3.0); }
public double getMagmaCubeXP() { return config.getDouble("Experience.Combat.Multiplier.Magma_Cube", 2.0); }
public double getEnderDragonXP() { return config.getDouble("Experience.Combat.Multiplier.Ender_Dragon", 8.0); }
public double getIronGolemXP() { return config.getDouble("Experience.Combat.Multiplier.Iron_Golem", 2.0); }
public double getGiantXP() { return config.getDouble("Experience.Combat.Multiplier.Giant", 4.0); }
public double getWitherXP() { return config.getDouble("Experience.Combat.Multiplier.Wither", 7.0); }
public double getWitherSkeletonXP() { return config.getDouble("Experience.Combat.Multiplier.Wither_Skeleton", 4.0); }
public double getWitchXP() { return config.getDouble("Experience.Combat.Multiplier.Witch", 4.0); }
/* XP Formula Multiplier */
public int getFormulaMultiplierCurve() { return config.getInt("Experience.Formula.Curve_Modifier", 20); }
public double getFormulaMultiplierTaming() { return config.getDouble("Experience.Formula.Multiplier.Taming", 1.0); }
public double getFormulaMultiplierMining() { return config.getDouble("Experience.Formula.Multiplier.Mining", 1.0); }
public double getFormulaMultiplierRepair() { return config.getDouble("Experience.Formula.Multiplier.Repair", 1.0); }
public double getFormulaMultiplierWoodcutting() { return config.getDouble("Experience.Formula.Multiplier.Woodcutting", 1.0); }
public double getFormulaMultiplierUnarmed() { return config.getDouble("Experience.Formula.Multiplier.Unarmed", 1.0); }
public double getFormulaMultiplierHerbalism() { return config.getDouble("Experience.Formula.Multiplier.Herbalism", 1.0); }
public double getFormulaMultiplierExcavation() { return config.getDouble("Experience.Formula.Multiplier.Excavation", 1.0); }
public double getFormulaMultiplierArchery() { return config.getDouble("Experience.Formula.Multiplier.Archery", 1.0); }
public double getFormulaMultiplierSwords() { return config.getDouble("Experience.Formula.Multiplier.Swords", 1.0); }
public double getFormulaMultiplierAxes() { return config.getDouble("Experience.Formula.Multiplier.Axes", 1.0); }
public double getFormulaMultiplierAcrobatics() { return config.getDouble("Experience.Formula.Multiplier.Acrobatics", 1.0); }
public double getFormulaMultiplierFishing() { return config.getDouble("Experience.Formula.Multiplier.Fishing", 1.0); }
private boolean doubleDropsDisabled(String skillName) {
public boolean getDoubleDropsDisabled(SkillType skill) {
String skillName = StringUtils.getCapitalized(skill.toString());
ConfigurationSection section = config.getConfigurationSection("Double_Drops." + skillName);
Set<String> keys = section.getKeys(false);
boolean disabled = true;
for (String key : keys) {
@ -424,8 +162,88 @@ public class Config extends ConfigLoader {
return disabled;
}
private int getLevelCap(String configString) {
int cap = config.getInt(configString, 0);
return ((cap <= 0) ? Integer.MAX_VALUE : cap);
/* Acrobatics */
public boolean getDodgeLightningDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); }
/* Fishing */
public int getFishingBaseXP() { return config.getInt("Experience.Fishing.Base", 800); }
public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }
/* Mining */
public int getDetonatorItemID() { return config.getInt("Skills.Mining.Detonator_ID", 259); }
/* Repair */
public boolean getRepairAnvilMessagesEnabled() { return config.getBoolean("Skills.Repair.Anvil_Messages", true); }
public int getRepairAnvilId() { return config.getInt("Skills.Repair.Anvil_ID", 42); }
public boolean getSalvageEnabled() { return config.getBoolean("Skills.Repair.Salvage_enabled", true); }
public int getSalvageAnvilId() { return config.getInt("Skills.Repair.Salvage_Anvil_ID", 41); }
public int getSalvageUnlockLevel() { return config.getInt("Skills.Repair.Salvage_UnlockLevel", 600); }
public boolean getSalvageTools() { return config.getBoolean("Skills.Repair.Salvage_tools", true); }
public boolean getSalvageArmor() { return config.getBoolean("Skills.Repair.Salvage_armor", true); }
/* Unarmed */
public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); }
/* Taming */
public int getTamingXPWolf() { return config.getInt("Experience.Taming.Animal_Taming.Wolf", 250); }
public int getTamingXPOcelot() { return config.getInt("Experience.Taming.Animal_Taming.Ocelot", 500); }
public int getTamingCOTWWolfCost() { return config.getInt("Skills.Taming.Call_Of_The_Wild.Bones_Required", 10); }
public int getTamingCOTWOcelotCost() { return config.getInt("Skills.Taming.Call_Of_The_Wild.Fish_Required", 10); }
/* Woodcutting */
public boolean getWoodcuttingRequiresTool() { return config.getBoolean("Skills.Woodcutting.Requires_Axe", true); }
public int getWoodcuttingXPOak() { return config.getInt("Experience.Woodcutting.Oak", 70); }
public int getWoodcuttingXPBirch() { return config.getInt("Experience.Woodcutting.Birch", 90); }
public int getWoodcuttingXPSpruce() { return config.getInt("Experience.Woodcutting.Spruce", 80); }
public int getWoodcuttingXPJungle() { return config.getInt("Experience.Woodcutting.Jungle", 100); }
public int getWoodcuttingXPHugeBrownMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Brown", 70); }
public int getWoodcuttingXPHugeRedMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Red", 70); }
public boolean getOakDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Oak", true); }
public boolean getBirchDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Birch", true); }
public boolean getSpruceDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Spruce", true); }
public boolean getJungleDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Jungle", true); }
/* AFK Leveling */
public boolean getAcrobaticsAFKDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); }
public boolean getHerbalismAFKDisabled() { return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); }
/* Level Caps */
public int getPowerLevelCap() {
int cap = config.getInt("General.Power_Level_Cap", 0);
return (cap <= 0) ? Integer.MAX_VALUE : cap;
}
public int getLevelCap(SkillType skill) {
int cap = config.getInt("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Level_Cap");
return (cap <= 0) ? Integer.MAX_VALUE : cap;
}
/* PVP & PVE Settings */
public boolean getPVPEnabled(SkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVP", true); }
public boolean getPVEEnabled(SkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVE", true); }
/*
* XP SETTINGS
*/
/* General Settings */
public boolean getExperienceGainsMobspawnersEnabled() { return config.getBoolean("Experience.Gains.Mobspawners.Enabled", false); }
public boolean getExperienceGainsPlayerVersusPlayerEnabled() { return config.getBoolean("Experience.PVP.Rewards", true); }
public double getExperienceGainsGlobalMultiplier() { return config.getDouble("Experience.Gains.Multiplier.Global", 1.0); }
public void setExperienceGainsGlobalMultiplier(double value) { config.set("Experience.Gains.Multiplier.Global", value); }
/* Combat XP Multipliers */
public double getPlayerVersusPlayerXP() { return config.getDouble("Experience.Gains.Multiplier.PVP", 1.0); }
public double getCombatXP(EntityType entity) { return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); }
public double getAnimalsXP() { return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); }
public double getWitherSkeletonXP() { return config.getDouble("Experience.Combat.Multiplier.Wither_Skeleton", 4.0); }
/* XP Formula Multiplier */
public int getFormulaMultiplierCurve() { return config.getInt("Experience.Formula.Curve_Modifier", 20); }
public double getForumulaMultiplier(SkillType skill) { return config.getDouble("Experience.Formula.Multiplier." + StringUtils.getCapitalized(skill.toString())); }
}

View File

@ -51,6 +51,10 @@ public final class ModChecks {
* @return the block if it exists, null otherwise
*/
public static CustomBlock getCustomBlock(Block block) {
if (!Config.getInstance().getBlockModsEnabled()) {
return null;
}
ItemStack item = (new MaterialData(block.getTypeId(), block.getData())).toItemStack(1);
if (!CustomBlocksConfig.getInstance().customItems.contains(item)) {
@ -79,8 +83,9 @@ public final class ModChecks {
return null;
}
/**
* Check if a custom block is a custom block.
* Check if a custom block is a mining block.
*
* @param block The block to check
* @return true if the block is custom, false otherwise
@ -99,6 +104,26 @@ public final class ModChecks {
return false;
}
/**
* Check if a custom block is a mining block.
*
* @param block The block to check
* @return true if the block is custom, false otherwise
*/
public static boolean isCustomExcavationBlock(Block block) {
ItemStack item = (new MaterialData(block.getTypeId(), block.getData())).toItemStack(1);
if (customBlocksEnabled && CustomBlocksConfig.getInstance().customExcavationBlocks.contains(item)) {
for (CustomBlock b : CustomBlocksConfig.getInstance().customBlocks) {
if ((b.getItemID() == block.getTypeId()) && (b.getDataValue() == block.getData())) {
return true;
}
}
}
return false;
}
/**
* Check if a custom block is a leaf block.
*

View File

@ -17,9 +17,6 @@ public class Acrobatics {
public static int rollXpModifier = AdvancedConfig.getInstance().getRollXPModifier();
public static int fallXpModifier = AdvancedConfig.getInstance().getFallXPModifier();
public static boolean pvpEnabled = Config.getInstance().getAcrobaticsPVP();
public static boolean pveEnabled = Config.getInstance().getAcrobaticsPVE();
public static boolean afkLevelingDisabled = Config.getInstance().getAcrobaticsAFKDisabled();
public static boolean dodgeLightningDisabled = Config.getInstance().getDodgeLightningDisabled();
}

View File

@ -9,7 +9,6 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.util.Misc;
public class Archery {
@ -26,9 +25,6 @@ public class Archery {
public static double dazeMaxBonus = AdvancedConfig.getInstance().getDazeBonusMax();
public static int dazeModifier = AdvancedConfig.getInstance().getDazeModifier();
public static boolean pvpEnabled = Config.getInstance().getArcheryPVP();
public static boolean pveEnabled = Config.getInstance().getArcheryPVE();
public static double distanceXpModifer = 0.025;
protected static void incrementTrackerValue(LivingEntity livingEntity) {

View File

@ -1,7 +1,6 @@
package com.gmail.nossr50.skills.axes;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
public class Axes {
public static int bonusDamageMaxBonus = AdvancedConfig.getInstance().getBonusDamageAxesBonusMax();
@ -20,7 +19,4 @@ public class Axes {
public static int greaterImpactBonusDamage = AdvancedConfig.getInstance().getGreaterImpactBonusDamage();
public static int skullSplitterModifier = AdvancedConfig.getInstance().getSkullSplitterModifier();
public static boolean pvpEnabled = Config.getInstance().getAxesPVP();
public static boolean pveEnabled = Config.getInstance().getAxesPVE();
}

View File

@ -28,40 +28,10 @@ public class Excavation {
*/
public static void excavationProcCheck(Block block, McMMOPlayer mcMMOPlayer) {
Material material = block.getType();
int xp;
int xp = Config.getInstance().getXp(SkillType.EXCAVATION, material);
switch (material) {
case CLAY:
xp = Config.getInstance().getExcavationClayXP();
break;
case DIRT:
xp = Config.getInstance().getExcavationDirtXP();
break;
case GRASS:
xp = Config.getInstance().getExcavationGrassXP();
break;
case GRAVEL:
xp = Config.getInstance().getExcavationGravelXP();
break;
case MYCEL:
xp = Config.getInstance().getExcavationMycelXP();
break;
case SAND:
xp = Config.getInstance().getExcavationSandXP();
break;
case SOUL_SAND:
xp = Config.getInstance().getExcavationSoulSandXP();
break;
default:
xp = ModChecks.getCustomBlock(block).getXpGain();;
break;
if (xp == 0 && ModChecks.isCustomExcavationBlock(block)) {
xp = ModChecks.getCustomBlock(block).getXpGain();
}
Player player = mcMMOPlayer.getPlayer();

View File

@ -45,7 +45,6 @@ public class Herbalism {
public static double doubleDropsMaxChance = AdvancedConfig.getInstance().getHerbalismDoubleDropsChanceMax();
public static int doubleDropsMaxLevel = AdvancedConfig.getInstance().getHerbalismDoubleDropsMaxLevel();
public static boolean doubleDropsDisabled = Config.getInstance().herbalismDoubleDropsDisabled();
public static double hylianLuckMaxChance = AdvancedConfig.getInstance().getHylianLuckChanceMax();
public static int hylianLuckMaxLevel = AdvancedConfig.getInstance().getHylianLucksMaxLevel();

View File

@ -8,46 +8,43 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.util.Permissions;
import com.google.common.collect.Maps;
public enum HerbalismBlock {
BROWN_MUSHROOM(Material.BROWN_MUSHROOM, Config.getInstance().getHerbalismXPMushrooms(), Config.getInstance().getBrownMushroomsDoubleDropsEnabled()),
CACTUS(Material.CACTUS, Config.getInstance().getHerbalismXPCactus(), Config.getInstance().getCactiDoubleDropsEnabled()),
CARROT(Material.CARROT, Material.CARROT_ITEM, Config.getInstance().getHerbalismXPCarrot(), Config.getInstance().getCarrotDoubleDropsEnabled()),
COCOA(Material.COCOA, new ItemStack(Material.INK_SACK, 1, DyeColor.BROWN.getDyeData()), Config.getInstance().getHerbalismXPCocoa(), Config.getInstance().getCocoaDoubleDropsEnabled()),
CROPS(Material.CROPS, Material.WHEAT, Config.getInstance().getHerbalismXPWheat(), Config.getInstance().getWheatDoubleDropsEnabled()),
MELON_BLOCK(Material.MELON_BLOCK, Material.MELON, Config.getInstance().getHerbalismXPMelon(), Config.getInstance().getMelonsDoubleDropsEnabled()),
NETHER_WARTS(Material.NETHER_WARTS, Material.NETHER_STALK, Config.getInstance().getHerbalismXPNetherWart(), Config.getInstance().getNetherWartsDoubleDropsEnabled()),
POTATO(Material.POTATO, Material.POTATO_ITEM, Config.getInstance().getHerbalismXPPotato(), Config.getInstance().getPotatoDoubleDropsEnabled()),
PUMPKIN(Material.PUMPKIN, Config.getInstance().getHerbalismXPPumpkin(), Config.getInstance().getPumpkinsDoubleDropsEnabled()),
RED_MUSHROOM(Material.RED_MUSHROOM, Config.getInstance().getHerbalismXPMushrooms(), Config.getInstance().getRedMushroomsDoubleDropsEnabled()),
RED_ROSE(Material.RED_ROSE, Config.getInstance().getHerbalismXPFlowers(), Config.getInstance().getRedRosesDoubleDropsEnabled()),
SUGAR_CANE_BLOCK(Material.SUGAR_CANE_BLOCK, Material.SUGAR_CANE, Config.getInstance().getHerbalismXPSugarCane(), Config.getInstance().getSugarCaneDoubleDropsEnabled()),
VINE(Material.VINE, Config.getInstance().getHerbalismXPVines(), Config.getInstance().getVinesDoubleDropsEnabled()),
WATER_LILY(Material.WATER_LILY, Config.getInstance().getHerbalismXPLilyPads(), Config.getInstance().getWaterLiliesDoubleDropsEnabled()),
YELLOW_FLOWER(Material.YELLOW_FLOWER, Config.getInstance().getHerbalismXPFlowers(), Config.getInstance().getYellowFlowersDoubleDropsEnabled());
BROWN_MUSHROOM(Material.BROWN_MUSHROOM),
CACTUS(Material.CACTUS),
CARROT(Material.CARROT, Material.CARROT_ITEM),
COCOA(Material.COCOA, new ItemStack(Material.INK_SACK, 1, DyeColor.BROWN.getDyeData())),
CROPS(Material.CROPS, Material.WHEAT),
MELON_BLOCK(Material.MELON_BLOCK, Material.MELON),
NETHER_WARTS(Material.NETHER_WARTS, Material.NETHER_STALK),
POTATO(Material.POTATO, Material.POTATO_ITEM),
PUMPKIN(Material.PUMPKIN),
RED_MUSHROOM(Material.RED_MUSHROOM),
RED_ROSE(Material.RED_ROSE),
SUGAR_CANE_BLOCK(Material.SUGAR_CANE_BLOCK, Material.SUGAR_CANE),
VINE(Material.VINE),
WATER_LILY(Material.WATER_LILY),
YELLOW_FLOWER(Material.YELLOW_FLOWER);
private Material blockType;
private ItemStack dropItem;
private int xpGain;
private boolean doubleDropsEnabled;
private final static Map<Material, HerbalismBlock> BY_MATERIAL = Maps.newHashMap();
private HerbalismBlock(Material blockType, int xpGain, boolean doubleDropsEnabled) {
this(blockType, new ItemStack(blockType), xpGain, doubleDropsEnabled);
private HerbalismBlock(Material blockType) {
this(blockType, new ItemStack(blockType));
}
private HerbalismBlock(Material blockType, Material dropType, int xpGain, boolean doubleDropsEnabled) {
this(blockType, new ItemStack(dropType), xpGain, doubleDropsEnabled);
private HerbalismBlock(Material blockType, Material dropType) {
this(blockType, new ItemStack(dropType));
}
private HerbalismBlock(Material blockType, ItemStack dropItem, int xpGain, boolean doubleDropsEnabled) {
private HerbalismBlock(Material blockType, ItemStack dropItem) {
this.blockType = blockType;
this.dropItem = dropItem;
this.xpGain = xpGain;
this.doubleDropsEnabled = doubleDropsEnabled;
}
static {
@ -61,11 +58,11 @@ public enum HerbalismBlock {
}
public int getXpGain() {
return xpGain;
return Config.getInstance().getXp(SkillType.HERBALISM, blockType);
}
public boolean canDoubleDrop() {
return doubleDropsEnabled;
return Config.getInstance().getDoubleDropsEnabled(SkillType.HERBALISM, blockType);
}
public boolean hasGreenThumbPermission(Player player) {

View File

@ -67,7 +67,7 @@ public class HerbalismCommand extends SkillCommand {
canGreenThumbBlocks = (Permissions.greenThumbBlock(player, Material.DIRT) || Permissions.greenThumbBlock(player, Material.COBBLESTONE) || Permissions.greenThumbBlock(player, Material.COBBLE_WALL) || Permissions.greenThumbBlock(player, Material.SMOOTH_BRICK));
canFarmersDiet = Permissions.farmersDiet(player);
canDoubleDrop = Permissions.doubleDrops(player, skill);
doubleDropsDisabled = Herbalism.doubleDropsDisabled;
doubleDropsDisabled = skill.getDoubleDropsDisabled();
}
@Override

View File

@ -6,7 +6,6 @@ import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
@ -18,12 +17,9 @@ import com.gmail.nossr50.util.Misc;
public class Mining {
private static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
private static Config config = Config.getInstance();
public static int doubleDropsMaxLevel = advancedConfig.getMiningDoubleDropMaxLevel();
public static double doubleDropsMaxChance = advancedConfig.getMiningDoubleDropChance();
public static boolean doubleDropsDisabled = config.miningDoubleDropsDisabled();
public static final int DIAMOND_TOOL_TIER = 4;
public static final int IRON_TOOL_TIER = 3;
@ -36,71 +32,13 @@ public class Mining {
* @param block The block to award XP for
*/
protected static void miningXP(McMMOPlayer mcMMOPlayer, Block block, Material type) {
int xp = 0;
int xp = Config.getInstance().getXp(SkillType.MINING, type);
switch (type) {
case COAL_ORE:
xp += config.getMiningXPCoalOre();
break;
case DIAMOND_ORE:
xp += config.getMiningXPDiamondOre();
break;
case ENDER_STONE:
xp += config.getMiningXPEndStone();
break;
case GLOWING_REDSTONE_ORE:
case REDSTONE_ORE:
xp += config.getMiningXPRedstoneOre();
break;
case GLOWSTONE:
xp += config.getMiningXPGlowstone();
break;
case GOLD_ORE:
xp += config.getMiningXPGoldOre();
break;
case IRON_ORE:
xp += config.getMiningXPIronOre();
break;
case LAPIS_ORE:
xp += config.getMiningXPLapisOre();
break;
case MOSSY_COBBLESTONE:
xp += config.getMiningXPMossyStone();
break;
case NETHERRACK:
xp += config.getMiningXPNetherrack();
break;
case OBSIDIAN:
xp += config.getMiningXPObsidian();
break;
case SANDSTONE:
xp += config.getMiningXPSandstone();
break;
case STONE:
xp += config.getMiningXPStone();
break;
case EMERALD_ORE:
xp += config.getMiningXPEmeraldOre();
break;
default:
if (ModChecks.isCustomMiningBlock(block)) {
xp += ModChecks.getCustomBlock(block).getXpGain();
}
break;
if (type == Material.GLOWING_REDSTONE_ORE) {
xp = Config.getInstance().getXp(SkillType.MINING, Material.REDSTONE_ORE);
}
else if (xp == 0 && ModChecks.isCustomMiningBlock(block)) {
xp = ModChecks.getCustomBlock(block).getXpGain();
}
mcMMOPlayer.beginXpGain(SkillType.MINING, xp);
@ -116,6 +54,10 @@ public class Mining {
protected static void silkTouchDrops(Block block, Location location, Material type) {
ItemStack item = new ItemStack(type);
if (type != Material.GLOWING_REDSTONE_ORE && !Config.getInstance().getDoubleDropsEnabled(SkillType.MINING, type)) {
return;
}
switch (type) {
case ENDER_STONE:
case GOLD_ORE:
@ -127,52 +69,25 @@ public class Mining {
miningDrops(block, location, type);
break;
case COAL_ORE:
if (config.getCoalDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
break;
case DIAMOND_ORE:
if (config.getDiamondDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
break;
case GLOWING_REDSTONE_ORE:
if (Config.getInstance().getDoubleDropsEnabled(SkillType.MINING, Material.REDSTONE_ORE)) {
Misc.dropItem(location, item);
}
break;
case COAL_ORE:
case DIAMOND_ORE:
case REDSTONE_ORE:
if (config.getRedstoneDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
break;
case GLOWSTONE:
if (config.getGlowstoneDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
break;
case LAPIS_ORE:
if (config.getLapisDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
break;
case STONE:
if (config.getStoneDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
break;
case EMERALD_ORE:
if (config.getEmeraldDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
Misc.dropItem(location, item);
break;
default:
if (ModChecks.isCustomMiningBlock(block)) {
ItemStack dropItem = (new MaterialData(block.getTypeId(), block.getData())).toItemStack(1);
ItemStack dropItem = new ItemStack(block.getTypeId(), 1, block.getData());
Misc.dropItem(location, dropItem);
}
@ -188,33 +103,31 @@ public class Mining {
* @param type The material type of the block
*/
protected static void miningDrops(Block block, Location location, Material type) {
if (type != Material.GLOWING_REDSTONE_ORE && !Config.getInstance().getDoubleDropsEnabled(SkillType.MINING, type)) {
return;
}
ItemStack item = new ItemStack(type);
switch (type) {
case COAL_ORE:
if (config.getCoalDoubleDropsEnabled()) {
item = (new MaterialData(Material.COAL, CoalType.COAL.getData())).toItemStack(1);
Misc.dropItem(location, item);
}
item = new ItemStack(Material.COAL, 1, CoalType.COAL.getData());
Misc.dropItem(location, item);
break;
case DIAMOND_ORE:
if (config.getDiamondDoubleDropsEnabled()) {
item = new ItemStack(Material.DIAMOND);
Misc.dropItem(location, item);
}
item = new ItemStack(Material.DIAMOND);
Misc.dropItem(location, item);
break;
case ENDER_STONE:
if (config.getEndStoneDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
case EMERALD_ORE:
item = new ItemStack(Material.EMERALD);
Misc.dropItem(location, item);
break;
case GLOWING_REDSTONE_ORE:
case REDSTONE_ORE:
if (config.getRedstoneDoubleDropsEnabled()) {
if (Config.getInstance().getDoubleDropsEnabled(SkillType.MINING, Material.REDSTONE_ORE)) {
item = new ItemStack(Material.REDSTONE);
Misc.dropItems(location, item, 4);
Misc.randomDropItem(location, item, 50);
@ -222,69 +135,30 @@ public class Mining {
break;
case GLOWSTONE:
if (config.getGlowstoneDoubleDropsEnabled()) {
item = new ItemStack(Material.GLOWSTONE_DUST);
Misc.dropItems(location, item, 2);
Misc.randomDropItems(location, item, 2);
}
break;
case GOLD_ORE:
if (config.getGoldDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
break;
case IRON_ORE:
if (config.getIronDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
item = new ItemStack(Material.GLOWSTONE_DUST);
Misc.dropItems(location, item, 2);
Misc.randomDropItems(location, item, 2);
break;
case LAPIS_ORE:
if (config.getLapisDoubleDropsEnabled()) {
item = new ItemStack(Material.INK_SACK, 1, DyeColor.BLUE.getDyeData());
Misc.dropItems(location, item, 4);
Misc.randomDropItems(location, item, 4);
}
break;
case MOSSY_COBBLESTONE:
if (config.getMossyCobblestoneDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
break;
case NETHERRACK:
if (config.getNetherrackDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
break;
case OBSIDIAN:
if (config.getObsidianDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
break;
case SANDSTONE:
if (config.getSandstoneDoubleDropsEnabled()) {
Misc.dropItem(location, item);
}
item = new ItemStack(Material.INK_SACK, 1, DyeColor.BLUE.getDyeData());
Misc.dropItems(location, item, 4);
Misc.randomDropItems(location, item, 4);
break;
case STONE:
if (config.getStoneDoubleDropsEnabled()) {
item = new ItemStack(Material.COBBLESTONE);
Misc.dropItem(location, item);
}
item = new ItemStack(Material.COBBLESTONE);
Misc.dropItem(location, item);
break;
case EMERALD_ORE:
if (config.getEmeraldDoubleDropsEnabled()) {
item = new ItemStack(Material.EMERALD);
Misc.dropItem(location, item);
}
case ENDER_STONE:
case GOLD_ORE:
case IRON_ORE:
case MOSSY_COBBLESTONE:
case NETHERRACK:
case OBSIDIAN:
case SANDSTONE:
Misc.dropItem(location, item);
break;
default:

View File

@ -92,7 +92,7 @@ public class MiningCommand extends SkillCommand {
canDemoExpert = Permissions.demolitionsExpertise(player);
canDoubleDrop = Permissions.doubleDrops(player, skill);
canSuperBreaker = Permissions.superBreaker(player);
doubleDropsDisabled = Mining.doubleDropsDisabled;
doubleDropsDisabled = skill.getDoubleDropsDisabled();
}
@Override

View File

@ -28,40 +28,10 @@ public class SmeltResourceEventHandler {
protected void handleXPGain() {
Material sourceType = event.getSource().getType();
int xp = 0;
int xp = Config.getInstance().getXp(SkillType.SMELTING, sourceType);
switch (sourceType) {
case COAL_ORE:
xp = Config.getInstance().getSmeltingXPCoal();
break;
case GLOWING_REDSTONE_ORE:
case REDSTONE_ORE:
xp = Config.getInstance().getSmeltingXPRedstone();
break;
case IRON_ORE:
xp = Config.getInstance().getSmeltingXPIron();
break;
case GOLD_ORE:
xp = Config.getInstance().getSmeltingXPGold();
break;
case DIAMOND_ORE:
xp = Config.getInstance().getSmeltingXPDiamond();
break;
case LAPIS_ORE:
xp = Config.getInstance().getSmeltingXPLapis();
break;
case EMERALD_ORE:
xp = Config.getInstance().getSmeltingXPEmerald();
break;
default:
break;
if (sourceType == Material.GLOWING_REDSTONE_ORE) {
xp = Config.getInstance().getXp(SkillType.SMELTING, Material.REDSTONE_ORE);
}
McMMOPlayer mcMMOPlayer = manager.getMcMMOPlayer();

View File

@ -1,7 +1,6 @@
package com.gmail.nossr50.skills.swords;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
public class Swords {
public static double bleedMaxChance = AdvancedConfig.getInstance().getBleedChanceMax();
@ -15,8 +14,5 @@ public class Swords {
public static int serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier();
public static int serratedStrikesBleedTicks = AdvancedConfig.getInstance().getSerratedStrikesTicks();
public static boolean pvpEnabled = Config.getInstance().getSwordsPVP();
public static boolean pveEnabled = Config.getInstance().getSwordsPVE();
}

View File

@ -25,7 +25,4 @@ public class Taming {
public static int wolfXp = Config.getInstance().getTamingXPWolf();
public static int ocelotXp = Config.getInstance().getTamingXPOcelot();
public static boolean pvpEnabled = Config.getInstance().getTamingPVP();
public static boolean pveEnabled = Config.getInstance().getTamingPVE();
}

View File

@ -23,9 +23,6 @@ public class Unarmed {
public static boolean blockCrackerSmoothBrick = Config.getInstance().getUnarmedBlockCrackerSmoothbrickToCracked();
public static boolean pvpEnabled = Config.getInstance().getUnarmedPVP();
public static boolean pveEnabled = Config.getInstance().getUnarmedPVE();
public static double berserkDamageModifier = 1.5;
public static void blockCracker(Player player, Block block) {

View File

@ -12,8 +12,6 @@ import com.gmail.nossr50.util.StringUtils;
public enum AbilityType {
BERSERK(
Config.getInstance().getAbilityCooldownBerserk(),
Config.getInstance().getAbilityMaxTicksBerserk(),
"Unarmed.Skills.Berserk.On",
"Unarmed.Skills.Berserk.Off",
"Unarmed.Skills.Berserk.Other.On",
@ -21,8 +19,6 @@ public enum AbilityType {
"Unarmed.Skills.Berserk.Other.Off"),
SUPER_BREAKER(
Config.getInstance().getAbilityCooldownSuperBreaker(),
Config.getInstance().getAbilityMaxTicksSuperBreaker(),
"Mining.Skills.SuperBreaker.On",
"Mining.Skills.SuperBreaker.Off",
"Mining.Skills.SuperBreaker.Other.On",
@ -30,8 +26,6 @@ public enum AbilityType {
"Mining.Skills.SuperBreaker.Other.Off"),
GIGA_DRILL_BREAKER(
Config.getInstance().getAbilityCooldownGigaDrillBreaker(),
Config.getInstance().getAbilityMaxTicksGigaDrillBreaker(),
"Excavation.Skills.GigaDrillBreaker.On",
"Excavation.Skills.GigaDrillBreaker.Off",
"Excavation.Skills.GigaDrillBreaker.Other.On",
@ -39,8 +33,6 @@ public enum AbilityType {
"Excavation.Skills.GigaDrillBreaker.Other.Off"),
GREEN_TERRA(
Config.getInstance().getAbilityCooldownGreenTerra(),
Config.getInstance().getAbilityMaxTicksGreenTerra(),
"Herbalism.Skills.GTe.On",
"Herbalism.Skills.GTe.Off",
"Herbalism.Skills.GTe.Other.On",
@ -48,8 +40,6 @@ public enum AbilityType {
"Herbalism.Skills.GTe.Other.Off"),
SKULL_SPLITTER(
Config.getInstance().getAbilityCooldownSkullSplitter(),
Config.getInstance().getAbilityMaxTicksSkullSplitter(),
"Axes.Skills.SS.On",
"Axes.Skills.SS.Off",
"Axes.Skills.SS.Other.On",
@ -57,8 +47,6 @@ public enum AbilityType {
"Axes.Skills.SS.Other.Off"),
TREE_FELLER(
Config.getInstance().getAbilityCooldownTreeFeller(),
Config.getInstance().getAbilityMaxTicksTreeFeller(),
"Woodcutting.Skills.TreeFeller.On",
"Woodcutting.Skills.TreeFeller.Off",
"Woodcutting.Skills.TreeFeller.Other.On",
@ -66,8 +54,6 @@ public enum AbilityType {
"Woodcutting.Skills.TreeFeller.Other.Off"),
SERRATED_STRIKES(
Config.getInstance().getAbilityCooldownSerratedStrikes(),
Config.getInstance().getAbilityMaxTicksSerratedStrikes(),
"Swords.Skills.SS.On",
"Swords.Skills.SS.Off",
"Swords.Skills.SS.Other.On",
@ -75,8 +61,6 @@ public enum AbilityType {
"Swords.Skills.SS.Other.Off"),
BLAST_MINING(
Config.getInstance().getAbilityCooldownBlastMining(),
Config.getInstance().getAbilityMaxTicksBlastMining(),
null,
null,
"Mining.Blast.Other.On",
@ -84,25 +68,19 @@ public enum AbilityType {
null),
LEAF_BLOWER(
0,
0,
null,
null,
null,
null,
null);
private int cooldown;
private int maxTicks;
private String abilityOn;
private String abilityOff;
private String abilityPlayer;
private String abilityRefresh;
private String abilityPlayerOff;
private AbilityType(int cooldown, int maxTicks, String abilityOn, String abilityOff, String abilityPlayer, String abilityRefresh, String abilityPlayerOff) {
this.cooldown = cooldown;
this.maxTicks = maxTicks;
private AbilityType(String abilityOn, String abilityOff, String abilityPlayer, String abilityRefresh, String abilityPlayerOff) {
this.abilityOn = abilityOn;
this.abilityOff = abilityOff;
this.abilityPlayer = abilityPlayer;
@ -111,7 +89,11 @@ public enum AbilityType {
}
public int getCooldown() {
return this.cooldown;
return Config.getInstance().getCooldown(this);
}
public int getMaxTicks() {
return Config.getInstance().getMaxTicks(this);
}
public String getAbilityOn() {
@ -134,10 +116,6 @@ public enum AbilityType {
return LocaleLoader.getString(this.abilityRefresh);
}
public int getMaxTicks() {
return this.maxTicks;
}
@Override
public String toString() {
String baseString = name();

View File

@ -31,17 +31,14 @@ import com.gmail.nossr50.mods.ModChecks;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.skills.acrobatics.Acrobatics;
import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager;
import com.gmail.nossr50.skills.archery.Archery;
import com.gmail.nossr50.skills.archery.ArcheryManager;
import com.gmail.nossr50.skills.axes.AxeManager;
import com.gmail.nossr50.skills.axes.Axes;
import com.gmail.nossr50.skills.runnables.BleedTimer;
import com.gmail.nossr50.skills.runnables.CombatXpGiver;
import com.gmail.nossr50.skills.swords.Swords;
import com.gmail.nossr50.skills.swords.SwordsManager;
import com.gmail.nossr50.skills.taming.Taming;
import com.gmail.nossr50.skills.taming.TamingManager;
import com.gmail.nossr50.skills.unarmed.Unarmed;
import com.gmail.nossr50.skills.unarmed.UnarmedManager;
import com.gmail.nossr50.util.ItemChecks;
import com.gmail.nossr50.util.Misc;
@ -79,11 +76,11 @@ public final class CombatTools {
if (ItemChecks.isSword(heldItem) && damageCause == DamageCause.ENTITY_ATTACK) {
if (targetIsPlayer || targetIsTamedPet) {
if (!Swords.pvpEnabled) {
if (!SkillType.SWORDS.getPVPEnabled()) {
return;
}
}
else if (!Swords.pveEnabled) {
else if (!SkillType.SWORDS.getPVEEnabled()) {
return;
}
@ -110,11 +107,11 @@ public final class CombatTools {
}
else if (ItemChecks.isAxe(heldItem) && damageCause == DamageCause.ENTITY_ATTACK) {
if (targetIsPlayer || targetIsTamedPet) {
if (!Axes.pvpEnabled) {
if (!SkillType.AXES.getPVPEnabled()) {
return;
}
}
else if (!Axes.pveEnabled) {
else if (!SkillType.AXES.getPVEEnabled()) {
return;
}
@ -148,11 +145,11 @@ public final class CombatTools {
}
else if (heldItemType == Material.AIR && damageCause == DamageCause.ENTITY_ATTACK) {
if (targetIsPlayer || targetIsTamedPet) {
if (!configInstance.getUnarmedPVP()) {
if (!SkillType.UNARMED.getPVPEnabled()) {
return;
}
}
else if (!configInstance.getUnarmedPVE()) {
else if (!SkillType.UNARMED.getPVEEnabled()) {
return;
}
@ -202,11 +199,11 @@ public final class CombatTools {
}
if (targetIsPlayer || targetIsTamedPet) {
if (!Taming.pvpEnabled) {
if (!SkillType.TAMING.getPVPEnabled()) {
return;
}
}
else if (!Taming.pveEnabled) {
else if (!SkillType.TAMING.getPVEEnabled()) {
return;
}
@ -242,11 +239,11 @@ public final class CombatTools {
}
if (targetIsPlayer || targetIsTamedPet) {
if (!Archery.pvpEnabled) {
if (!SkillType.ARCHERY.getPVPEnabled()) {
return;
}
}
else if (!Archery.pveEnabled) {
else if (!SkillType.ARCHERY.getPVEEnabled()) {
return;
}
@ -267,23 +264,23 @@ public final class CombatTools {
ItemStack heldItem = player.getItemInHand();
if (damager instanceof Player) {
if (Swords.pvpEnabled && ItemChecks.isSword(heldItem) && Permissions.counterAttack(player)) {
if (SkillType.SWORDS.getPVPEnabled() && ItemChecks.isSword(heldItem) && Permissions.counterAttack(player)) {
SwordsManager swordsManager = new SwordsManager(Users.getPlayer(player));
swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage());
}
if (Acrobatics.pvpEnabled && Permissions.dodge(player)) {
if (SkillType.ACROBATICS.getPVPEnabled() && Permissions.dodge(player)) {
AcrobaticsManager acrobaticsManager = new AcrobaticsManager(Users.getPlayer(player));
acrobaticsManager.dodgeCheck(event);
}
}
else {
if (Swords.pveEnabled && damager instanceof LivingEntity && ItemChecks.isSword(heldItem) && Permissions.counterAttack(player)) {
if (SkillType.SWORDS.getPVEEnabled() && damager instanceof LivingEntity && ItemChecks.isSword(heldItem) && Permissions.counterAttack(player)) {
SwordsManager swordsManager = new SwordsManager(Users.getPlayer(player));
swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage());
}
if (Acrobatics.pveEnabled && !(damager instanceof LightningStrike && Acrobatics.dodgeLightningDisabled) && Permissions.dodge(player)) {
if (SkillType.ACROBATICS.getPVEEnabled() && !(damager instanceof LightningStrike && Acrobatics.dodgeLightningDisabled) && Permissions.dodge(player)) {
AcrobaticsManager acrobaticsManager = new AcrobaticsManager(Users.getPlayer(player));
acrobaticsManager.dodgeCheck(event);
}
@ -309,7 +306,7 @@ public final class CombatTools {
archeryManager.skillShot(event);
if (target instanceof Player) {
if (Unarmed.pvpEnabled && ((Player) target).getItemInHand().getType() == Material.AIR && Permissions.arrowDeflect((Player) target)) {
if (SkillType.UNARMED.getPVPEnabled() && ((Player) target).getItemInHand().getType() == Material.AIR && Permissions.arrowDeflect((Player) target)) {
UnarmedManager unarmedManager = new UnarmedManager(Users.getPlayer((Player) target));
unarmedManager.deflectCheck(event);
}
@ -478,50 +475,26 @@ public final class CombatTools {
break;
case BLAZE:
baseXP = configInstance.getBlazeXP();
break;
case CAVE_SPIDER:
baseXP = configInstance.getCaveSpiderXP();
break;
case CREEPER:
baseXP = configInstance.getCreeperXP();
break;
case ENDER_DRAGON:
baseXP = configInstance.getEnderDragonXP();
break;
case ENDERMAN:
baseXP = configInstance.getEndermanXP();
break;
case GHAST:
baseXP = configInstance.getGhastXP();
break;
case GIANT:
baseXP = configInstance.getGiantXP();
break;
case MAGMA_CUBE:
baseXP = configInstance.getMagmaCubeXP();
break;
case IRON_GOLEM:
if (!((IronGolem) target).isPlayerCreated()) {
baseXP = configInstance.getIronGolemXP();
}
break;
case PIG_ZOMBIE:
baseXP = configInstance.getPigZombieXP();
case SILVERFISH:
case SLIME:
case SPIDER:
case WITCH:
case WITHER:
case ZOMBIE:
baseXP = Config.getInstance().getCombatXP(type);
break;
case SILVERFISH:
baseXP = configInstance.getSilverfishXP();
// Temporary workaround for custom entities
case UNKNOWN:
baseXP = 1.0;
break;
case SKELETON:
@ -530,41 +503,21 @@ public final class CombatTools {
baseXP = configInstance.getWitherSkeletonXP();
break;
default:
baseXP = configInstance.getSkeletonXP();
baseXP = Config.getInstance().getCombatXP(type);
break;
}
break;
case SLIME:
baseXP = configInstance.getSlimeXP();
break;
case SPIDER:
baseXP = configInstance.getSpiderXP();
break;
case WITCH:
baseXP = configInstance.getWitchXP();
break;
case WITHER:
baseXP = configInstance.getWitherXP();
break;
case ZOMBIE:
baseXP = configInstance.getZombieXP();
break;
// Temporary workaround for custom entities
case UNKNOWN:
baseXP = 1.0;
case IRON_GOLEM:
if (!((IronGolem) target).isPlayerCreated()) {
baseXP = Config.getInstance().getCombatXP(type);
}
break;
default:
if (ModChecks.isCustomEntity(target)) {
baseXP = ModChecks.getCustomEntity(target).getXpMultiplier();
}
break;
}
}

View File

@ -6,41 +6,31 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.StringUtils;
public enum SkillType {
ACROBATICS(Config.getInstance().getLevelCapAcrobatics(), Config.getInstance().getFormulaMultiplierAcrobatics()),
ARCHERY(Config.getInstance().getLevelCapArchery(), Config.getInstance().getFormulaMultiplierArchery()),
AXES(AbilityType.SKULL_SPLITTER, Config.getInstance().getLevelCapAxes(), ToolType.AXE, Config.getInstance().getFormulaMultiplierAxes()),
EXCAVATION(AbilityType.GIGA_DRILL_BREAKER, Config.getInstance().getLevelCapExcavation(), ToolType.SHOVEL, Config.getInstance().getFormulaMultiplierExcavation()),
FISHING(Config.getInstance().getLevelCapFishing(), Config.getInstance().getFormulaMultiplierFishing()),
HERBALISM(AbilityType.GREEN_TERRA, Config.getInstance().getLevelCapHerbalism(), ToolType.HOE, Config.getInstance().getFormulaMultiplierHerbalism()),
MINING(AbilityType.SUPER_BREAKER, Config.getInstance().getLevelCapMining(), ToolType.PICKAXE, Config.getInstance().getFormulaMultiplierMining()),
REPAIR(Config.getInstance().getLevelCapRepair(), Config.getInstance().getFormulaMultiplierRepair()),
SMELTING(Config.getInstance().getLevelCapSmelting(), 0),
SWORDS(AbilityType.SERRATED_STRIKES, Config.getInstance().getLevelCapSwords(), ToolType.SWORD, Config.getInstance().getFormulaMultiplierSwords()),
TAMING(Config.getInstance().getLevelCapTaming(), Config.getInstance().getFormulaMultiplierTaming()),
UNARMED(AbilityType.BERSERK, Config.getInstance().getLevelCapUnarmed(), ToolType.FISTS, Config.getInstance().getFormulaMultiplierUnarmed()),
WOODCUTTING(AbilityType.TREE_FELLER, Config.getInstance().getLevelCapWoodcutting(), ToolType.AXE, Config.getInstance().getFormulaMultiplierWoodcutting());
ACROBATICS,
ARCHERY,
AXES(AbilityType.SKULL_SPLITTER, ToolType.AXE),
EXCAVATION(AbilityType.GIGA_DRILL_BREAKER, ToolType.SHOVEL),
FISHING,
HERBALISM(AbilityType.GREEN_TERRA, ToolType.HOE),
MINING(AbilityType.SUPER_BREAKER, ToolType.PICKAXE),
REPAIR,
SMELTING,
SWORDS(AbilityType.SERRATED_STRIKES, ToolType.SWORD),
TAMING,
UNARMED(AbilityType.BERSERK, ToolType.FISTS),
WOODCUTTING(AbilityType.TREE_FELLER, ToolType.AXE);
private AbilityType ability;
private int maxLevel;
private ToolType tool;
private double xpModifier;
private SkillType() {
this.ability = null;
this.maxLevel = 0;
this.tool = null;
this.xpModifier = 0;
}
private SkillType(AbilityType ability, int maxLevel, ToolType tool, double xpModifier) {
private SkillType(AbilityType ability, ToolType tool) {
this.ability = ability;
this.maxLevel = maxLevel;
this.tool = tool;
this.xpModifier = xpModifier;
}
private SkillType(int maxLevel, double xpModifier) {
this(null, maxLevel, null, xpModifier);
}
public AbilityType getAbility() {
@ -53,11 +43,19 @@ public enum SkillType {
* @return the max level of this skill
*/
public int getMaxLevel() {
if (maxLevel > 0) {
return maxLevel;
}
return Config.getInstance().getLevelCap(this);
}
return Integer.MAX_VALUE;
public boolean getPVPEnabled() {
return Config.getInstance().getPVPEnabled(this);
}
public boolean getPVEEnabled() {
return Config.getInstance().getPVEEnabled(this);
}
public boolean getDoubleDropsDisabled() {
return Config.getInstance().getDoubleDropsDisabled(this);
}
public ToolType getTool() {
@ -65,7 +63,7 @@ public enum SkillType {
}
public double getXpModifier() {
return xpModifier;
return Config.getInstance().getForumulaMultiplier(this);
}
public static SkillType getSkill(String skillName) {

View File

@ -1,7 +1,6 @@
package com.gmail.nossr50.skills.woodcutting;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.SkillCommand;
import com.gmail.nossr50.skills.utilities.SkillType;
@ -16,6 +15,7 @@ public class WoodcuttingCommand extends SkillCommand {
private boolean canTreeFell;
private boolean canLeafBlow;
private boolean canDoubleDrop;
private boolean doubleDropsDisabled;
public WoodcuttingCommand() {
super(SkillType.WOODCUTTING);
@ -40,11 +40,12 @@ public class WoodcuttingCommand extends SkillCommand {
canTreeFell = Permissions.treeFeller(player);
canDoubleDrop = Permissions.doubleDrops(player, skill);
canLeafBlow = Permissions.leafBlower(player);
doubleDropsDisabled = skill.getDoubleDropsDisabled();
}
@Override
protected boolean effectsHeaderPermissions() {
return (canDoubleDrop && !Config.getInstance().woodcuttingDoubleDropsDisabled()) || canLeafBlow || canTreeFell;
return (canDoubleDrop && !doubleDropsDisabled) || canLeafBlow || canTreeFell;
}
@Override
@ -59,14 +60,14 @@ public class WoodcuttingCommand extends SkillCommand {
player.sendMessage(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Woodcutting.Effect.2"), LocaleLoader.getString("Woodcutting.Effect.3")));
}
if (canDoubleDrop && !Config.getInstance().woodcuttingDoubleDropsDisabled()) {
if (canDoubleDrop && !doubleDropsDisabled) {
player.sendMessage(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Woodcutting.Effect.4"), LocaleLoader.getString("Woodcutting.Effect.5")));
}
}
@Override
protected boolean statsHeaderPermissions() {
return (canDoubleDrop && !Config.getInstance().woodcuttingDoubleDropsDisabled()) || canLeafBlow || canTreeFell;
return (canDoubleDrop && !doubleDropsDisabled) || canLeafBlow || canTreeFell;
}
@Override
@ -82,7 +83,7 @@ public class WoodcuttingCommand extends SkillCommand {
}
}
if (canDoubleDrop && !Config.getInstance().woodcuttingDoubleDropsDisabled()) {
if (canDoubleDrop && !doubleDropsDisabled) {
if (isLucky) {
player.sendMessage(LocaleLoader.getString("Woodcutting.Ability.Chance.DDrop", doubleDropChance) + LocaleLoader.getString("Perks.lucky.bonus", doubleDropChanceLucky));
}

View File

@ -1,6 +1,7 @@
package com.gmail.nossr50.util;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
public class StringUtils {
@ -22,16 +23,27 @@ public class StringUtils {
* Gets a nicely formatted string version of an item name from a given item ID.
*
* @param itemID The ID of the item to convert to string.
* @return the nicely formatting string
* @return the nicely formatted string
*/
public static String getPrettyItemString(int itemID) {
String baseString = Material.getMaterial(itemID).toString();
return createPrettyEnumString(Material.getMaterial(itemID).toString());
}
public static String getPrettyItemString(Material material) {
return createPrettyEnumString(material.toString());
}
public static String getPrettyEntityTypeString(EntityType entity) {
return createPrettyEnumString(entity.toString());
}
private static String createPrettyEnumString(String baseString) {
String[] substrings = baseString.split("_");
String prettyString = "";
int size = 1;
for (String s : substrings) {
prettyString = prettyString.concat(getCapitalized(s));
for (String string : substrings) {
prettyString = prettyString.concat(getCapitalized(string));
if (size < substrings.length) {
prettyString = prettyString.concat(" ");

View File

@ -101,23 +101,23 @@ Abilities:
Activation:
Only_Activate_When_Sneaking: false
Cooldowns:
Berserk: 240
Blast_Mining: 60
Giga_Drill_Breaker: 240
Berserk: 240
Green_Terra: 240
Skull_Splitter: 240
Serrated_Strikes: 240
Tree_Feller: 240
Skull_Splitter: 240
Super_Breaker: 240
Tree_Feller: 240
Max_Seconds:
Berserk: 0
Blast_Mining: 0
Giga_Drill_Breaker: 0
Berserk: 0
Green_Terra: 0
Skull_Splitter: 0
Serrated_Strikes: 0
Tree_Feller: 0
Skull_Splitter: 0
Super_Breaker: 0
Tree_Feller: 0
Limits:
Tree_Feller_Threshold: 500
Tools:
@ -191,36 +191,36 @@ Skills:
###
Double_Drops:
Herbalism:
Brown_Mushrooms: true
Cacti: true
Melons: true
Nether_Warts: true
Pumpkins: true
Red_Mushrooms: true
Red_Roses: true
Sugar_Cane: true
Vines: true
Water_Lilies: true
Wheat: true
Yellow_Flowers: true
Cocoa: true
Brown_Mushroom: true
Cactus: true
Carrot: true
Cocoa: true
Crops: true
Melon_Block: true
Nether_Warts: true
Potato: true
Pumpkin: true
Red_Mushroom: true
Red_Rose: true
Sugar_Cane_Block: true
Vine: true
Water_Lily: true
Yellow_Flower: true
Mining:
Coal: true
Diamond: true
End_Stone: true
Coal_Ore: true
Diamond_Ore: true
Emerald_Ore: true
Ender_Stone: true
Glowstone: true
Gold: true
Iron: true
Lapis: true
Moss_Stone: true
Gold_Ore: true
Iron_Ore: true
Lapis_Ore: true
Mossy_Cobblestone: true
Netherrack: true
Obsidian: true
Redstone: true
Redstone_Ore: true
Sandstone: true
Stone: true
Emerald: true
Woodcutting:
Oak: true
Birch: true
@ -263,7 +263,7 @@ Experience:
Gravel: 40
Mycel: 40
Sand: 40
SoulSand: 40
Soul_Sand: 40
Woodcutting:
Oak: 70
Spruce: 80
@ -272,42 +272,44 @@ Experience:
Huge_Mushroom_Red: 70
Huge_Mushroom_Brown: 70
Herbalism:
Sugar_Cane: 30
Brown_Mushroom: 150
Cactus: 30
Flowers: 100
Pumpkin: 20
Mushrooms: 150
Wheat: 50
Melon: 20
Nether_Wart: 50
Lily_Pads: 100
Vines: 10
Cocoa: 30
Carrot: 50
Cocoa: 30
Crops: 50
Melon_Block: 20
Nether_Warts: 50
Potato: 50
Pumpkin: 20
Red_Mushroom: 150
Red_Rose: 100
Sugar_Cane_Block: 30
Vine: 10
Water_Lily: 100
Yellow_Flower: 100
Mining:
Sandstone: 30
Coal_Ore: 100
Diamond_Ore: 750
Emerald_Ore: 1000
Ender_Stone: 150
Glowstone: 30
Lapis: 400
Obsidian: 150
Stone: 30
Gold_Ore: 350
Iron_Ore: 250
Lapis_Ore: 400
Mossy_Cobblestone: 30
Netherrack: 30
Gold: 350
Redstone: 150
Coal: 100
Diamond: 750
Iron: 250
End_Stone: 150
Moss_Stone: 30
Emerald: 1000
Obsidian: 150
Redstone_Ore: 150
Sandstone: 30
Stone: 30
Smelting:
Coal: 10
Redstone: 15
Iron: 25
Gold: 35
Lapis: 40
Diamond: 75
Emerald: 100
Coal_Ore: 10
Diamond_Ore: 75
Emerald_Ore: 100
Gold_Ore: 35
Iron_Ore: 25
Lapis_Ore: 40
Redstone_Ore: 15
Taming:
Animal_Taming:
Wolf: 250
@ -318,7 +320,10 @@ Experience:
Creeper: 4.0
Skeleton: 3.0
Spider: 2.0
Giant: 4.0
Zombie: 2.0
Slime: 2.0
Ghast: 3.0
Pig_Zombie: 3.0
Enderman: 1.0
Cave_Spider: 3.0
@ -326,13 +331,10 @@ Experience:
Blaze: 3.0
Magma_Cube: 2.0
Ender_Dragon: 8.0
Slime: 2.0
Ghast: 3.0
Iron_Golem: 2.0
Giant: 4.0
Wither: 7.0
Wither_Skeleton: 4.0
Witch: 4.0
Iron_Golem: 2.0
Wither_Skeleton: 4.0;
#
# Settings for commands
###