These fit better in SkillTools. Plus, we had already duplicated one of

them.
This commit is contained in:
GJ 2013-02-18 10:26:19 -05:00
parent d0d9527d39
commit 1da1bb7218
4 changed files with 5 additions and 7 deletions

View File

@ -12,7 +12,6 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.utilities.SkillTools; import com.gmail.nossr50.skills.utilities.SkillTools;
import com.gmail.nossr50.skills.utilities.SkillType; import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
@ -124,7 +123,7 @@ public abstract class SkillCommand implements CommandExecutor {
protected String[] calculateLengthDisplayValues() { protected String[] calculateLengthDisplayValues() {
int maxLength = skill.getAbility().getMaxTicks(); int maxLength = skill.getAbility().getMaxTicks();
int length = 2 + (int) (skillValue / Misc.abilityLengthIncreaseLevel); int length = 2 + (int) (skillValue / SkillTools.abilityLengthIncreaseLevel);
int enduranceLength = 0; int enduranceLength = 0;
if (player.hasPermission("mcmmo.perks.activationtime.twelveseconds")) { if (player.hasPermission("mcmmo.perks.activationtime.twelveseconds")) {

View File

@ -33,8 +33,9 @@ import com.gmail.nossr50.util.Users;
public class SkillTools { public class SkillTools {
static AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
public static int abilityLengthIncreaseLevel = advancedConfig.getAbilityLength();
public static boolean abilitiesEnabled = Config.getInstance().getAbilitiesEnabled(); public static boolean abilitiesEnabled = Config.getInstance().getAbilitiesEnabled();
public static int toolDurabilityLoss = Config.getInstance().getAbilityToolDamage();
public static int abilityLengthIncreaseLevel = AdvancedConfig.getInstance().getAbilityLength();
public static final int LUCKY_SKILL_ACTIVATION_CHANCE = 75; public static final int LUCKY_SKILL_ACTIVATION_CHANCE = 75;
public static final int NORMAL_SKILL_ACTIVATION_CHANCE = 100; public static final int NORMAL_SKILL_ACTIVATION_CHANCE = 100;

View File

@ -17,6 +17,7 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mods.ModChecks; import com.gmail.nossr50.mods.ModChecks;
import com.gmail.nossr50.mods.datatypes.CustomBlock; import com.gmail.nossr50.mods.datatypes.CustomBlock;
import com.gmail.nossr50.skills.utilities.CombatTools; import com.gmail.nossr50.skills.utilities.CombatTools;
import com.gmail.nossr50.skills.utilities.SkillTools;
import com.gmail.nossr50.skills.utilities.SkillType; import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.skills.woodcutting.Woodcutting.ExperienceGainMethod; import com.gmail.nossr50.skills.woodcutting.Woodcutting.ExperienceGainMethod;
import com.gmail.nossr50.util.BlockChecks; import com.gmail.nossr50.util.BlockChecks;
@ -142,7 +143,7 @@ public final class TreeFeller {
for (Block block : treeFellerBlocks) { for (Block block : treeFellerBlocks) {
if (BlockChecks.isLog(block) && Misc.getRandom().nextInt(unbreakingLevel + 1) == 0) { if (BlockChecks.isLog(block) && Misc.getRandom().nextInt(unbreakingLevel + 1) == 0) {
durabilityLoss += Misc.toolDurabilityLoss; durabilityLoss += SkillTools.toolDurabilityLoss;
} }
} }

View File

@ -12,7 +12,6 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent; import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
import com.gmail.nossr50.events.fake.FakeBlockDamageEvent; import com.gmail.nossr50.events.fake.FakeBlockDamageEvent;
@ -22,8 +21,6 @@ import com.gmail.nossr50.mods.ModChecks;
public final class Misc { public final class Misc {
private static Random random = new Random(); private static Random random = new Random();
public static int toolDurabilityLoss = Config.getInstance().getAbilityToolDamage();
public static int abilityLengthIncreaseLevel = AdvancedConfig.getInstance().getAbilityLength();
public static boolean isSpawnerXPEnabled = Config.getInstance().getExperienceGainsMobspawnersEnabled(); public static boolean isSpawnerXPEnabled = Config.getInstance().getExperienceGainsMobspawnersEnabled();
public static final int PLAYER_RESPAWN_COOLDOWN_SECONDS = 5; public static final int PLAYER_RESPAWN_COOLDOWN_SECONDS = 5;
public static final int TIME_CONVERSION_FACTOR = 1000; public static final int TIME_CONVERSION_FACTOR = 1000;