mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
child skills can have their xp bars turned on
This commit is contained in:
parent
e6289a0548
commit
239200a3d2
@ -1,3 +1,9 @@
|
|||||||
|
Version 2.1.127
|
||||||
|
Child Skills now have XP bars, they are hidden by default
|
||||||
|
|
||||||
|
NOTES:
|
||||||
|
You can enable the child skill bars with the command /mmoxpbar <skill> show
|
||||||
|
|
||||||
Version 2.1.126
|
Version 2.1.126
|
||||||
mcMMO now relies on NMS for some of its features, if NMS cannot properly be wired up when initializing mcMMO behaviours relying on NMS will either be partially supported or disabled
|
mcMMO now relies on NMS for some of its features, if NMS cannot properly be wired up when initializing mcMMO behaviours relying on NMS will either be partially supported or disabled
|
||||||
mcMMO now has a compatibility mode, any features that require specific versions of Minecraft for full functionality will be disabled if your server is not running a compatible version, mcMMO will still function in compatibility mode, but either the feature will be modified or disabled depending on the version of the server software
|
mcMMO now has a compatibility mode, any features that require specific versions of Minecraft for full functionality will be disabled if your server is not running a compatible version, mcMMO will still function in compatibility mode, but either the feature will be modified or disabled depending on the version of the server software
|
||||||
|
@ -190,17 +190,16 @@ public class McMMOPlayer {
|
|||||||
|
|
||||||
public void updateXPBar(PrimarySkillType primarySkillType, Plugin plugin)
|
public void updateXPBar(PrimarySkillType primarySkillType, Plugin plugin)
|
||||||
{
|
{
|
||||||
//Skill Unlock Notifications
|
|
||||||
|
|
||||||
if(primarySkillType.isChildSkill())
|
|
||||||
return;
|
|
||||||
|
|
||||||
//XP BAR UPDATES
|
//XP BAR UPDATES
|
||||||
experienceBarManager.updateExperienceBar(primarySkillType, plugin);
|
experienceBarManager.updateExperienceBar(primarySkillType, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getProgressInCurrentSkillLevel(PrimarySkillType primarySkillType)
|
public double getProgressInCurrentSkillLevel(PrimarySkillType primarySkillType)
|
||||||
{
|
{
|
||||||
|
if(primarySkillType.isChildSkill()) {
|
||||||
|
return 1.0D;
|
||||||
|
}
|
||||||
|
|
||||||
double currentXP = profile.getSkillXpLevel(primarySkillType);
|
double currentXP = profile.getSkillXpLevel(primarySkillType);
|
||||||
double maxXP = profile.getXpToLevel(primarySkillType);
|
double maxXP = profile.getXpToLevel(primarySkillType);
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ import com.gmail.nossr50.mcMMO;
|
|||||||
import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask;
|
import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask;
|
||||||
import com.gmail.nossr50.skills.child.FamilyTree;
|
import com.gmail.nossr50.skills.child.FamilyTree;
|
||||||
import com.gmail.nossr50.util.player.UserManager;
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
|
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -266,6 +267,10 @@ public class PlayerProfile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getSkillXpLevel(PrimarySkillType skill) {
|
public int getSkillXpLevel(PrimarySkillType skill) {
|
||||||
|
if(skill.isChildSkill()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return (int) Math.floor(getSkillXpLevelRaw(skill));
|
return (int) Math.floor(getSkillXpLevelRaw(skill));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -415,6 +420,10 @@ public class PlayerProfile {
|
|||||||
* @return the total amount of Xp until next level
|
* @return the total amount of Xp until next level
|
||||||
*/
|
*/
|
||||||
public int getXpToLevel(PrimarySkillType primarySkillType) {
|
public int getXpToLevel(PrimarySkillType primarySkillType) {
|
||||||
|
if(primarySkillType.isChildSkill()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int level = (ExperienceConfig.getInstance().getCumulativeCurveEnabled()) ? UserManager.getPlayer(playerName).getPowerLevel() : skills.get(primarySkillType);
|
int level = (ExperienceConfig.getInstance().getCumulativeCurveEnabled()) ? UserManager.getPlayer(playerName).getPowerLevel() : skills.get(primarySkillType);
|
||||||
FormulaType formulaType = ExperienceConfig.getInstance().getFormulaType();
|
FormulaType formulaType = ExperienceConfig.getInstance().getFormulaType();
|
||||||
|
|
||||||
|
@ -117,6 +117,14 @@ public class ExperienceBarManager {
|
|||||||
hideExperienceBar(skillType);
|
hideExperienceBar(skillType);
|
||||||
break;
|
break;
|
||||||
case RESET:
|
case RESET:
|
||||||
|
resetBarSettings();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
informPlayer(settingTarget, skillType);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetBarSettings() {
|
||||||
//Hide all currently permanent bars
|
//Hide all currently permanent bars
|
||||||
for(PrimarySkillType permanent : alwaysVisible) {
|
for(PrimarySkillType permanent : alwaysVisible) {
|
||||||
hideExperienceBar(permanent);
|
hideExperienceBar(permanent);
|
||||||
@ -125,11 +133,9 @@ public class ExperienceBarManager {
|
|||||||
alwaysVisible.clear();
|
alwaysVisible.clear();
|
||||||
disabledBars.clear();
|
disabledBars.clear();
|
||||||
|
|
||||||
break;
|
//Hide child skills by default
|
||||||
}
|
disabledBars.add(PrimarySkillType.SALVAGE);
|
||||||
|
disabledBars.add(PrimarySkillType.SMELTING);
|
||||||
informPlayer(settingTarget, skillType);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void informPlayer(@NotNull ExperienceBarManager.@NotNull XPBarSettingTarget settingTarget, @Nullable PrimarySkillType skillType) {
|
private void informPlayer(@NotNull ExperienceBarManager.@NotNull XPBarSettingTarget settingTarget, @Nullable PrimarySkillType skillType) {
|
||||||
|
Loading…
Reference in New Issue
Block a user