mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 05:06:45 +01:00
Override toString() for upcoming config changes. Also, this ability is
"Skull Splitter," not "Skull Spliiter"
This commit is contained in:
parent
4284fe1029
commit
17a85c94c6
@ -26,7 +26,7 @@ public final class AbilityAPI {
|
||||
}
|
||||
|
||||
public static boolean skullSplitterEnabled(Player player) {
|
||||
return Users.getPlayer(player).getProfile().getAbilityMode(AbilityType.SKULL_SPLIITER);
|
||||
return Users.getPlayer(player).getProfile().getAbilityMode(AbilityType.SKULL_SPLITTER);
|
||||
}
|
||||
|
||||
public static boolean superBreakerEnabled(Player player) {
|
||||
|
@ -130,7 +130,7 @@ public class PlayerProfile {
|
||||
skillsDATS.put(AbilityType.GREEN_TERRA, Integer.valueOf(cooldownValues.get(3)));
|
||||
skillsDATS.put(AbilityType.GIGA_DRILL_BREAKER, Integer.valueOf(cooldownValues.get(4)));
|
||||
skillsDATS.put(AbilityType.SERRATED_STRIKES, Integer.valueOf(cooldownValues.get(5)));
|
||||
skillsDATS.put(AbilityType.SKULL_SPLIITER, Integer.valueOf(cooldownValues.get(6)));
|
||||
skillsDATS.put(AbilityType.SKULL_SPLITTER, Integer.valueOf(cooldownValues.get(6)));
|
||||
skillsDATS.put(AbilityType.BLAST_MINING, Integer.valueOf(cooldownValues.get(7)));
|
||||
}
|
||||
|
||||
@ -262,7 +262,7 @@ public class PlayerProfile {
|
||||
if (character.length > 30)
|
||||
skillsDATS.put(AbilityType.SERRATED_STRIKES, Integer.valueOf(character[30]));
|
||||
if (character.length > 31)
|
||||
skillsDATS.put(AbilityType.SKULL_SPLIITER, Integer.valueOf(character[31]));
|
||||
skillsDATS.put(AbilityType.SKULL_SPLITTER, Integer.valueOf(character[31]));
|
||||
if (character.length > 32)
|
||||
skillsDATS.put(AbilityType.SUPER_BREAKER, Integer.valueOf(character[32]));
|
||||
if (character.length > 33) {
|
||||
@ -308,7 +308,7 @@ public class PlayerProfile {
|
||||
+ ", herbalism = " + skillsDATS.get(AbilityType.GREEN_TERRA)
|
||||
+ ", excavation = " + skillsDATS.get(AbilityType.GIGA_DRILL_BREAKER)
|
||||
+ ", swords = " + skillsDATS.get(AbilityType.SERRATED_STRIKES)
|
||||
+ ", axes = " + skillsDATS.get(AbilityType.SKULL_SPLIITER)
|
||||
+ ", axes = " + skillsDATS.get(AbilityType.SKULL_SPLITTER)
|
||||
+ ", blast_mining = " + skillsDATS.get(AbilityType.BLAST_MINING)
|
||||
+ " WHERE user_id = " + userId);
|
||||
Database.write("UPDATE " + tablePrefix + "skills SET "
|
||||
@ -391,7 +391,7 @@ public class PlayerProfile {
|
||||
writer.append(skillsDATS.get(AbilityType.TREE_FELLER)).append(":");
|
||||
writer.append(skillsDATS.get(AbilityType.GREEN_TERRA)).append(":");
|
||||
writer.append(skillsDATS.get(AbilityType.SERRATED_STRIKES)).append(":");
|
||||
writer.append(skillsDATS.get(AbilityType.SKULL_SPLIITER)).append(":");
|
||||
writer.append(skillsDATS.get(AbilityType.SKULL_SPLITTER)).append(":");
|
||||
writer.append(skillsDATS.get(AbilityType.SUPER_BREAKER)).append(":");
|
||||
writer.append(hudType.toString()).append(":");
|
||||
writer.append(skills.get(SkillType.FISHING)).append(":");
|
||||
@ -670,7 +670,7 @@ public class PlayerProfile {
|
||||
case GREEN_TERRA:
|
||||
return greenTerraMode;
|
||||
|
||||
case SKULL_SPLIITER:
|
||||
case SKULL_SPLITTER:
|
||||
return skullSplitterMode;
|
||||
|
||||
case TREE_FELLER:
|
||||
@ -708,7 +708,7 @@ public class PlayerProfile {
|
||||
greenTerraMode = bool;
|
||||
break;
|
||||
|
||||
case SKULL_SPLIITER:
|
||||
case SKULL_SPLITTER:
|
||||
skullSplitterMode = bool;
|
||||
break;
|
||||
|
||||
@ -748,7 +748,7 @@ public class PlayerProfile {
|
||||
case GREEN_TERRA:
|
||||
return greenTerraInformed;
|
||||
|
||||
case SKULL_SPLIITER:
|
||||
case SKULL_SPLITTER:
|
||||
return skullSplitterInformed;
|
||||
|
||||
case TREE_FELLER:
|
||||
@ -790,7 +790,7 @@ public class PlayerProfile {
|
||||
greenTerraInformed = bool;
|
||||
break;
|
||||
|
||||
case SKULL_SPLIITER:
|
||||
case SKULL_SPLITTER:
|
||||
skullSplitterInformed = bool;
|
||||
break;
|
||||
|
||||
|
@ -8,6 +8,7 @@ import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.BlockChecks;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
|
||||
public enum AbilityType {
|
||||
BERSERK(
|
||||
@ -46,7 +47,7 @@ public enum AbilityType {
|
||||
"Herbalism.Skills.GTe.Refresh",
|
||||
"Herbalism.Skills.GTe.Other.Off"),
|
||||
|
||||
SKULL_SPLIITER(
|
||||
SKULL_SPLITTER(
|
||||
Config.getInstance().getAbilityCooldownSkullSplitter(),
|
||||
Config.getInstance().getAbilityMaxTicksSkullSplitter(),
|
||||
"Axes.Skills.SS.On",
|
||||
@ -137,6 +138,27 @@ public enum AbilityType {
|
||||
return this.maxTicks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String baseString = name();
|
||||
String[] substrings = baseString.split("_");
|
||||
String formattedString = "";
|
||||
|
||||
int size = 1;
|
||||
|
||||
for (String string : substrings) {
|
||||
formattedString = formattedString.concat(StringUtils.getCapitalized(string));
|
||||
|
||||
if (size < substrings.length) {
|
||||
formattedString = formattedString.concat("_");
|
||||
}
|
||||
|
||||
size++;
|
||||
}
|
||||
|
||||
return formattedString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the permissions for this ability.
|
||||
*
|
||||
@ -164,7 +186,7 @@ public enum AbilityType {
|
||||
case SERRATED_STRIKES:
|
||||
return Permissions.serratedStrikes(player);
|
||||
|
||||
case SKULL_SPLIITER:
|
||||
case SKULL_SPLITTER:
|
||||
return Permissions.skullSplitter(player);
|
||||
|
||||
case SUPER_BREAKER:
|
||||
|
@ -139,7 +139,7 @@ public final class CombatTools {
|
||||
axeManager.impact(event, target);
|
||||
}
|
||||
|
||||
if (!target.isDead() && profile.getAbilityMode(AbilityType.SKULL_SPLIITER) && canSkullSplit) {
|
||||
if (!target.isDead() && profile.getAbilityMode(AbilityType.SKULL_SPLITTER) && canSkullSplit) {
|
||||
axeManager.skullSplitter(target, event.getDamage());
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ import com.gmail.nossr50.util.StringUtils;
|
||||
public enum SkillType {
|
||||
ACROBATICS(Config.getInstance().getLevelCapAcrobatics(), Config.getInstance().getFormulaMultiplierAcrobatics()),
|
||||
ARCHERY(Config.getInstance().getLevelCapArchery(), Config.getInstance().getFormulaMultiplierArchery()),
|
||||
AXES(AbilityType.SKULL_SPLIITER, Config.getInstance().getLevelCapAxes(), ToolType.AXE, Config.getInstance().getFormulaMultiplierAxes()),
|
||||
AXES(AbilityType.SKULL_SPLITTER, Config.getInstance().getLevelCapAxes(), ToolType.AXE, Config.getInstance().getFormulaMultiplierAxes()),
|
||||
EXCAVATION(AbilityType.GIGA_DRILL_BREAKER, Config.getInstance().getLevelCapExcavation(), ToolType.SHOVEL, Config.getInstance().getFormulaMultiplierExcavation()),
|
||||
FISHING(Config.getInstance().getLevelCapFishing(), Config.getInstance().getFormulaMultiplierFishing()),
|
||||
HERBALISM(AbilityType.GREEN_TERRA, Config.getInstance().getLevelCapHerbalism(), ToolType.HOE, Config.getInstance().getFormulaMultiplierHerbalism()),
|
||||
|
Loading…
Reference in New Issue
Block a user