From b84a03082e5e660e90aede05bc2f37c3624bb35e Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 2 Apr 2012 13:45:33 -0400 Subject: [PATCH] Added ability to cap overall power level. --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/config/LoadProperties.java | 4 +++- src/main/java/com/gmail/nossr50/skills/Skills.java | 2 +- src/main/resources/config.yml | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 3f94fcbc2..8a08c720d 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -10,6 +10,7 @@ Key: Version 1.3.05-dev + Added bonus damage to Archery, every 50 levels you gain 10% bonus damage + Added ExperienceAPI and PartyAPI classes for developer use + + Added ability to cap overall power level = Fixed errors when Spout would disable itself after start-up = Fixed XP bar not updating when XP was gained = Fixed bug with repairing wooden tools diff --git a/src/main/java/com/gmail/nossr50/config/LoadProperties.java b/src/main/java/com/gmail/nossr50/config/LoadProperties.java index 88e7540f9..3419822b8 100644 --- a/src/main/java/com/gmail/nossr50/config/LoadProperties.java +++ b/src/main/java/com/gmail/nossr50/config/LoadProperties.java @@ -106,7 +106,8 @@ public class LoadProperties extends ConfigLoader{ /* Level Caps */ public static int levelCapAcrobatics, levelCapArchery, levelCapAxes, levelCapExcavation, levelCapFishing, levelCapHerbalism, levelCapMining, levelCapRepair, - levelCapSwords, levelCapTaming, levelCapUnarmed, levelCapWoodcutting; + levelCapSwords, levelCapTaming, levelCapUnarmed, levelCapWoodcutting, + powerLevelCap; /* * XP SETTINGS @@ -328,6 +329,7 @@ public class LoadProperties extends ConfigLoader{ statsTracking = config.getBoolean("General.Stats_Tracking", true); eventCallback = config.getBoolean("General.Event_Callback", true); perLevelTools = config.getBoolean("General.Per_Level_Tools", false); + powerLevelCap = config.getInt("General.Power_Level_Cap", 0); enableCobbleToMossy = config.getBoolean("Skills.Herbalism.Green_Thumb.Cobble_To_Mossy", true); enableSmoothToMossy = config.getBoolean("Skills.Herbalism.Green_Thumb.SmoothBrick_To_MossyBrick", true); diff --git a/src/main/java/com/gmail/nossr50/skills/Skills.java b/src/main/java/com/gmail/nossr50/skills/Skills.java index 278d7bf86..fefb7dd3a 100644 --- a/src/main/java/com/gmail/nossr50/skills/Skills.java +++ b/src/main/java/com/gmail/nossr50/skills/Skills.java @@ -195,7 +195,7 @@ public class Skills { if (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) { while (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) { - if (skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) { + if ((skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) && (LoadProperties.powerLevelCap >= PP.getPowerLevel() + 1)) { skillups++; PP.addLevels(skillType, 1); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index f9363e299..c19b07922 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -17,6 +17,7 @@ General: #Allow mcMMO to inform other plugins of damage being dealt Event_Callback: true Per_Level_Tools: false + Power_Level_Cap: 0 # # Settings for using a mySQL database