mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Move these functions to SkillType.
This commit is contained in:
parent
e1bf55b077
commit
9485869014
@ -51,11 +51,11 @@ public class HardcoreCommand extends HardcoreModeCommand {
|
|||||||
private void toggle(boolean enable) {
|
private void toggle(boolean enable) {
|
||||||
if (skill.equalsIgnoreCase("ALL")) {
|
if (skill.equalsIgnoreCase("ALL")) {
|
||||||
for (SkillType skillType : SkillType.nonChildSkills()) {
|
for (SkillType skillType : SkillType.nonChildSkills()) {
|
||||||
Config.getInstance().setHardcoreStatLossEnabled(skillType, enable);
|
skillType.setHardcoreStatLossEnabled(enable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Config.getInstance().setHardcoreStatLossEnabled(SkillType.getSkill(skill), enable);
|
SkillType.getSkill(skill).setHardcoreStatLossEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.DeathStatLoss.Name"), skill));
|
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.DeathStatLoss.Name"), skill));
|
||||||
|
@ -48,16 +48,16 @@ public class VampirismCommand extends HardcoreModeCommand {
|
|||||||
sender.sendMessage(LocaleLoader.getString("Hardcore.Vampirism.PercentageChanged", percent.format(newPercent / 100D)));
|
sender.sendMessage(LocaleLoader.getString("Hardcore.Vampirism.PercentageChanged", percent.format(newPercent / 100D)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toggle(boolean enabled) {
|
private void toggle(boolean enable) {
|
||||||
if (skill.equalsIgnoreCase("ALL")) {
|
if (skill.equalsIgnoreCase("ALL")) {
|
||||||
for (SkillType skillType : SkillType.nonChildSkills()) {
|
for (SkillType skillType : SkillType.nonChildSkills()) {
|
||||||
Config.getInstance().setHardcoreVampirismEnabled(skillType, enabled);
|
skillType.setHardcoreVampirismEnabled(enable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Config.getInstance().setHardcoreVampirismEnabled(SkillType.getSkill(skill), enabled);
|
SkillType.getSkill(skill).setHardcoreVampirismEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enabled ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.Vampirism.Name"), skill));
|
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.Vampirism.Name"), skill));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -109,10 +109,18 @@ public enum SkillType {
|
|||||||
return Config.getInstance().getHardcoreStatLossEnabled(this);
|
return Config.getInstance().getHardcoreStatLossEnabled(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setHardcoreStatLossEnabled(boolean enable) {
|
||||||
|
Config.getInstance().setHardcoreStatLossEnabled(this, enable);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean getHardcoreVampirismEnabled() {
|
public boolean getHardcoreVampirismEnabled() {
|
||||||
return Config.getInstance().getHardcoreVampirismEnabled(this);
|
return Config.getInstance().getHardcoreVampirismEnabled(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setHardcoreVampirismEnabled(boolean enable) {
|
||||||
|
Config.getInstance().setHardcoreVampirismEnabled(this, enable);
|
||||||
|
}
|
||||||
|
|
||||||
public ToolType getTool() {
|
public ToolType getTool() {
|
||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user