mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-03 21:15:28 +02:00
Updating various classes for the new SkillTools class
This commit is contained in:
@@ -35,9 +35,9 @@ public final class CommandRegistrationManager {
|
||||
}
|
||||
|
||||
private void registerSkillCommands() {
|
||||
for (PrimarySkillType skill : PrimarySkillType.values()) {
|
||||
String commandName = skill.toString().toLowerCase();
|
||||
String localizedName = skill.getLocalizedSkillName().toLowerCase();
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
|
||||
String commandName = primarySkillType.toString().toLowerCase();
|
||||
String localizedName = pluginRef.getSkillTools().getLocalizedSkillName(primarySkillType).toLowerCase();
|
||||
|
||||
PluginCommand command;
|
||||
|
||||
@@ -48,7 +48,7 @@ public final class CommandRegistrationManager {
|
||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", localizedName));
|
||||
command.setUsage(command.getUsage() + "\n" + pluginRef.getLocaleManager().getString("Commands.Usage.2", localizedName, "?", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Page") + "]"));
|
||||
|
||||
switch (skill) {
|
||||
switch (primarySkillType) {
|
||||
case ACROBATICS:
|
||||
command.setExecutor(new AcrobaticsCommand(pluginRef));
|
||||
break;
|
||||
|
@@ -97,14 +97,14 @@ public class ScoreboardStrings {
|
||||
Collections.shuffle(colors, Misc.getRandom());
|
||||
|
||||
int i = 0;
|
||||
for (PrimarySkillType type : PrimarySkillType.values()) {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
|
||||
// Include child skills
|
||||
skillLabelBuilder.put(type, getShortenedName(colors.get(i) + type.getLocalizedSkillName(), false));
|
||||
skillLabelBuilder.put(primarySkillType, getShortenedName(colors.get(i) + pluginRef.getSkillTools().getLocalizedSkillName(primarySkillType), false));
|
||||
|
||||
if (type.getSuperAbility() != null) {
|
||||
abilityLabelBuilder.put(type.getSuperAbility(), getShortenedName(colors.get(i) + type.getSuperAbility().getName()));
|
||||
if (pluginRef.getSkillTools().getSuperAbility(primarySkillType) != null) {
|
||||
abilityLabelBuilder.put(pluginRef.getSkillTools().getSuperAbility(primarySkillType), getShortenedName(colors.get(i) + pluginRef.getSkillTools().getSuperAbility(primarySkillType).getName()));
|
||||
|
||||
if (type == PrimarySkillType.MINING) {
|
||||
if (primarySkillType == PrimarySkillType.MINING) {
|
||||
abilityLabelBuilder.put(SuperAbilityType.BLAST_MINING, getShortenedName(colors.get(i) + SuperAbilityType.BLAST_MINING.getName()));
|
||||
}
|
||||
}
|
||||
@@ -119,14 +119,14 @@ public class ScoreboardStrings {
|
||||
* Stylizes the targetBoard using our normal color scheme
|
||||
*/
|
||||
else {
|
||||
for (PrimarySkillType type : PrimarySkillType.values()) {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
|
||||
// Include child skills
|
||||
skillLabelBuilder.put(type, getShortenedName(ChatColor.GREEN + type.getLocalizedSkillName()));
|
||||
skillLabelBuilder.put(primarySkillType, getShortenedName(ChatColor.GREEN + pluginRef.getSkillTools().getLocalizedSkillName(primarySkillType)));
|
||||
|
||||
if (type.getSuperAbility() != null) {
|
||||
abilityLabelBuilder.put(type.getSuperAbility(), formatAbility(type.getSuperAbility().getName()));
|
||||
if (pluginRef.getSkillTools().getSuperAbility(primarySkillType) != null) {
|
||||
abilityLabelBuilder.put(pluginRef.getSkillTools().getSuperAbility(primarySkillType), formatAbility(pluginRef.getSkillTools().getSuperAbility(primarySkillType).getName()));
|
||||
|
||||
if (type == PrimarySkillType.MINING) {
|
||||
if (primarySkillType == PrimarySkillType.MINING) {
|
||||
abilityLabelBuilder.put(SuperAbilityType.BLAST_MINING, formatAbility(SuperAbilityType.BLAST_MINING.getName()));
|
||||
}
|
||||
}
|
||||
|
@@ -636,10 +636,13 @@ public class SkillTools {
|
||||
}
|
||||
|
||||
public SuperAbilityType getSuperAbility(PrimarySkillType primarySkillType) {
|
||||
if(mainActivatedAbilityChildMap.get(primarySkillType) == null)
|
||||
return null;
|
||||
|
||||
return mainActivatedAbilityChildMap.get(primarySkillType);
|
||||
}
|
||||
|
||||
public boolean isSuperAbilityUnlocked(Player player, PrimarySkillType primarySkillType) {
|
||||
public boolean isSuperAbilityUnlocked(PrimarySkillType primarySkillType, Player player) {
|
||||
return RankUtils.getRank(player, getSuperAbility(primarySkillType).getSubSkillTypeDefinition()) >= 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user