mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Child Skill commands work again (UGLY tho)
This commit is contained in:
parent
a21b4585c5
commit
51ab8d4b25
@ -2,6 +2,7 @@ package com.gmail.nossr50.commands.skills;
|
|||||||
|
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import com.gmail.nossr50.datatypes.skills.PrimarySkill;
|
import com.gmail.nossr50.datatypes.skills.PrimarySkill;
|
||||||
|
|
||||||
@ -10,6 +11,7 @@ import com.gmail.nossr50.config.Config;
|
|||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.skills.child.FamilyTree;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.TextComponentFactory;
|
import com.gmail.nossr50.util.TextComponentFactory;
|
||||||
import com.gmail.nossr50.util.StringUtils;
|
import com.gmail.nossr50.util.StringUtils;
|
||||||
@ -119,15 +121,15 @@ public abstract class SkillCommand implements TabExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void sendSkillCommandHeader(Player player, McMMOPlayer mcMMOPlayer, int skillValue) {
|
private void sendSkillCommandHeader(Player player, McMMOPlayer mcMMOPlayer, int skillValue) {
|
||||||
|
|
||||||
if(!skill.isChildSkill())
|
|
||||||
{
|
|
||||||
ChatColor hd1 = ChatColor.DARK_AQUA;
|
ChatColor hd1 = ChatColor.DARK_AQUA;
|
||||||
ChatColor c1 = ChatColor.GOLD;
|
ChatColor c1 = ChatColor.GOLD;
|
||||||
ChatColor c2 = ChatColor.RED;
|
ChatColor c2 = ChatColor.RED;
|
||||||
|
|
||||||
player.sendMessage(hd1+"[]=====[]"+c1+" "+skillName+" "+hd1+"[]=====[]");
|
|
||||||
|
|
||||||
|
player.sendMessage(LocaleLoader.getString("Skills.Overhaul.Header", skillName));
|
||||||
|
|
||||||
|
if(!skill.isChildSkill())
|
||||||
|
{
|
||||||
//XP GAIN METHOD
|
//XP GAIN METHOD
|
||||||
player.sendMessage(LocaleLoader.getString("Commands.XPGain.Overhaul", LocaleLoader.getString("Commands.XPGain." + StringUtils.getCapitalized(skill.toString()))));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain.Overhaul", LocaleLoader.getString("Commands.XPGain." + StringUtils.getCapitalized(skill.toString()))));
|
||||||
|
|
||||||
@ -135,23 +137,19 @@ public abstract class SkillCommand implements TabExecutor {
|
|||||||
player.sendMessage(LocaleLoader.getString("Effects.Level.Overhaul", skillValue, mcMMOPlayer.getSkillXpLevel(skill), mcMMOPlayer.getXpToLevel(skill)));
|
player.sendMessage(LocaleLoader.getString("Effects.Level.Overhaul", skillValue, mcMMOPlayer.getSkillXpLevel(skill), mcMMOPlayer.getXpToLevel(skill)));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ChatColor hd1 = ChatColor.DARK_AQUA;
|
|
||||||
ChatColor c1 = ChatColor.GOLD;
|
|
||||||
ChatColor c2 = ChatColor.DARK_PURPLE;
|
|
||||||
//Header
|
|
||||||
player.sendMessage(hd1+"[]=====[]"+c1+" mcMMO "+c2+"Overhaul"+c1+" Era "+hd1+"[]=====[]");
|
|
||||||
//Link Header
|
|
||||||
TextComponentFactory.sendPlayerUrlHeader(player);
|
|
||||||
player.sendMessage(hd1+"[]=====[]"+c1+" "+skillName+" "+hd1+"[]=====[]");
|
|
||||||
|
|
||||||
//XP GAIN METHOD
|
//XP GAIN METHOD
|
||||||
player.sendMessage(LocaleLoader.getString("Commands.XPGain", LocaleLoader.getString("Commands.XPGain." + StringUtils.getCapitalized(skill.toString()))));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain.Overhaul", LocaleLoader.getString("Commands.XPGain.Child")));
|
||||||
|
|
||||||
//LEVEL
|
//LEVEL
|
||||||
player.sendMessage(LocaleLoader.getString("Effects.Level", skillValue, mcMMOPlayer.getSkillXpLevel(skill), mcMMOPlayer.getXpToLevel(skill)));
|
player.sendMessage(LocaleLoader.getString("Effects.Child.Overhaul", skillValue, skillValue));
|
||||||
|
|
||||||
|
Set<PrimarySkill> parents = FamilyTree.getParents(skill);
|
||||||
|
|
||||||
|
//TODO: Add JSON here
|
||||||
|
for (PrimarySkill parent : parents) {
|
||||||
|
player.sendMessage(parent.getName() + " - " + LocaleLoader.getString("Effects.Level.Overhaul", mcMMOPlayer.getSkillLevel(parent), mcMMOPlayer.getSkillXpLevel(parent), mcMMOPlayer.getXpToLevel(parent)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (!skill.isChildSkill()) {
|
if (!skill.isChildSkill()) {
|
||||||
player.sendMessage(LocaleLoader.getString("Skills.Header", skillName));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", skillName));
|
||||||
|
@ -124,7 +124,7 @@ public class SmeltingCommand extends SkillCommand {
|
|||||||
protected List<TextComponent> getTextComponents(Player player) {
|
protected List<TextComponent> getTextComponents(Player player) {
|
||||||
List<TextComponent> textComponents = new ArrayList<>();
|
List<TextComponent> textComponents = new ArrayList<>();
|
||||||
|
|
||||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkill.SWORDS);
|
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkill.SMELTING);
|
||||||
|
|
||||||
return textComponents;
|
return textComponents;
|
||||||
}
|
}
|
||||||
|
@ -292,8 +292,8 @@ Repair.Arcane.Rank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/{1}
|
|||||||
Salvage.Pretty.Name=Salvage
|
Salvage.Pretty.Name=Salvage
|
||||||
Salvage.SubSkill.AdvancedSalvage.Name=Advanced Salvage
|
Salvage.SubSkill.AdvancedSalvage.Name=Advanced Salvage
|
||||||
Salvage.SubSkill.AdvancedSalvage.Description=Salvage damaged items
|
Salvage.SubSkill.AdvancedSalvage.Description=Salvage damaged items
|
||||||
Salvage.SubSkill.ArcaneSalvaging.Name=Arcane Salvaging
|
Salvage.SubSkill.ArcaneSalvage.Name=Arcane Salvaging
|
||||||
Salvage.SubSkill.ArcaneSalvaging.Description=Extract enchantments from items
|
Salvage.SubSkill.ArcaneSalvage.Description=Extract enchantments from items
|
||||||
Salvage.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (ADVANCED SALVAGE)
|
Salvage.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (ADVANCED SALVAGE)
|
||||||
Salvage.Ability.Bonus.0=Advanced Salvage
|
Salvage.Ability.Bonus.0=Advanced Salvage
|
||||||
Salvage.Ability.Bonus.1=Max yield {0} item destroyed
|
Salvage.Ability.Bonus.1=Max yield {0} item destroyed
|
||||||
@ -747,6 +747,7 @@ XPRate.Event= [[GOLD]]mcMMO is currently in an XP rate event! XP rate is {0}x!
|
|||||||
Effects.Effects=EFFECTS
|
Effects.Effects=EFFECTS
|
||||||
Effects.SubSkills.Overhaul=Sub-Skills
|
Effects.SubSkills.Overhaul=Sub-Skills
|
||||||
Effects.Child=[[DARK_GRAY]]LVL: [[GREEN]]{0}
|
Effects.Child=[[DARK_GRAY]]LVL: [[GREEN]]{0}
|
||||||
|
Effects.Child.Overhaul=[[DARK_GRAY]]LVL: [[GREEN]]{0}
|
||||||
Effects.Level=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]])
|
Effects.Level=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]])
|
||||||
Effects.Level.Overhaul=[[RED]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]])
|
Effects.Level.Overhaul=[[RED]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]])
|
||||||
Effects.Parent = [[GOLD]]{0} -
|
Effects.Parent = [[GOLD]]{0} -
|
||||||
|
Loading…
Reference in New Issue
Block a user