mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 19:54:44 +02:00
Remove hardcore and vampirism commands
This commit is contained in:
@ -1,64 +1,64 @@
|
||||
package com.gmail.nossr50.commands.hardcore;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class HardcoreCommand extends HardcoreModeCommand {
|
||||
@Override
|
||||
protected boolean checkTogglePermissions(CommandSender sender) {
|
||||
return Permissions.hardcoreToggle(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkModifyPermissions(CommandSender sender) {
|
||||
return Permissions.hardcoreModify(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkEnabled(PrimarySkillType skill) {
|
||||
if (skill == null) {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
|
||||
if (!primarySkillType.getHardcoreStatLossEnabled()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return skill.getHardcoreStatLossEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void enable(PrimarySkillType skill) {
|
||||
toggle(true, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disable(PrimarySkillType skill) {
|
||||
toggle(false, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void modify(CommandSender sender, double newPercentage) {
|
||||
Config.getInstance().setHardcoreDeathStatPenaltyPercentage(newPercentage);
|
||||
sender.sendMessage(LocaleLoader.getString("Hardcore.DeathStatLoss.PercentageChanged", percent.format(newPercentage / 100.0D)));
|
||||
}
|
||||
|
||||
private void toggle(boolean enable, PrimarySkillType skill) {
|
||||
if (skill == null) {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
|
||||
primarySkillType.setHardcoreStatLossEnabled(enable);
|
||||
}
|
||||
}
|
||||
else {
|
||||
skill.setHardcoreStatLossEnabled(enable);
|
||||
}
|
||||
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.DeathStatLoss.Name"), (skill == null ? "all skills" : skill.getName())));
|
||||
}
|
||||
}
|
||||
//package com.gmail.nossr50.commands.hardcore;
|
||||
//
|
||||
//import com.gmail.nossr50.config.Config;
|
||||
//import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
//import com.gmail.nossr50.locale.LocaleLoader;
|
||||
//import com.gmail.nossr50.mcMMO;
|
||||
//import com.gmail.nossr50.util.Permissions;
|
||||
//import org.bukkit.command.CommandSender;
|
||||
//
|
||||
//public class HardcoreCommand extends HardcoreModeCommand {
|
||||
// @Override
|
||||
// protected boolean checkTogglePermissions(CommandSender sender) {
|
||||
// return Permissions.hardcoreToggle(sender);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected boolean checkModifyPermissions(CommandSender sender) {
|
||||
// return Permissions.hardcoreModify(sender);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected boolean checkEnabled(PrimarySkillType skill) {
|
||||
// if (skill == null) {
|
||||
// for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
|
||||
// if (!primarySkillType.getHardcoreStatLossEnabled()) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// return skill.getHardcoreStatLossEnabled();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void enable(PrimarySkillType skill) {
|
||||
// toggle(true, skill);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void disable(PrimarySkillType skill) {
|
||||
// toggle(false, skill);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void modify(CommandSender sender, double newPercentage) {
|
||||
// Config.getInstance().setHardcoreDeathStatPenaltyPercentage(newPercentage);
|
||||
// sender.sendMessage(LocaleLoader.getString("Hardcore.DeathStatLoss.PercentageChanged", percent.format(newPercentage / 100.0D)));
|
||||
// }
|
||||
//
|
||||
// private void toggle(boolean enable, PrimarySkillType skill) {
|
||||
// if (skill == null) {
|
||||
// for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
|
||||
// primarySkillType.setHardcoreStatLossEnabled(enable);
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// skill.setHardcoreStatLossEnabled(enable);
|
||||
// }
|
||||
//
|
||||
// mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.DeathStatLoss.Name"), (skill == null ? "all skills" : skill.getName())));
|
||||
// }
|
||||
//}
|
@ -1,64 +1,64 @@
|
||||
package com.gmail.nossr50.commands.hardcore;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class VampirismCommand extends HardcoreModeCommand {
|
||||
@Override
|
||||
protected boolean checkTogglePermissions(CommandSender sender) {
|
||||
return Permissions.vampirismToggle(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkModifyPermissions(CommandSender sender) {
|
||||
return Permissions.vampirismModify(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkEnabled(PrimarySkillType skill) {
|
||||
if (skill == null) {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
|
||||
if (!primarySkillType.getHardcoreVampirismEnabled()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return skill.getHardcoreVampirismEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void enable(PrimarySkillType skill) {
|
||||
toggle(true, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disable(PrimarySkillType skill) {
|
||||
toggle(false, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void modify(CommandSender sender, double newPercentage) {
|
||||
Config.getInstance().setHardcoreVampirismStatLeechPercentage(newPercentage);
|
||||
sender.sendMessage(LocaleLoader.getString("Hardcore.Vampirism.PercentageChanged", percent.format(newPercentage / 100.0D)));
|
||||
}
|
||||
|
||||
private void toggle(boolean enable, PrimarySkillType skill) {
|
||||
if (skill == null) {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
|
||||
primarySkillType.setHardcoreVampirismEnabled(enable);
|
||||
}
|
||||
}
|
||||
else {
|
||||
skill.setHardcoreVampirismEnabled(enable);
|
||||
}
|
||||
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.Vampirism.Name"), (skill == null ? "all skills" : skill)));
|
||||
}
|
||||
}
|
||||
//package com.gmail.nossr50.commands.hardcore;
|
||||
//
|
||||
//import com.gmail.nossr50.config.Config;
|
||||
//import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
//import com.gmail.nossr50.locale.LocaleLoader;
|
||||
//import com.gmail.nossr50.mcMMO;
|
||||
//import com.gmail.nossr50.util.Permissions;
|
||||
//import org.bukkit.command.CommandSender;
|
||||
//
|
||||
//public class VampirismCommand extends HardcoreModeCommand {
|
||||
// @Override
|
||||
// protected boolean checkTogglePermissions(CommandSender sender) {
|
||||
// return Permissions.vampirismToggle(sender);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected boolean checkModifyPermissions(CommandSender sender) {
|
||||
// return Permissions.vampirismModify(sender);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected boolean checkEnabled(PrimarySkillType skill) {
|
||||
// if (skill == null) {
|
||||
// for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
|
||||
// if (!primarySkillType.getHardcoreVampirismEnabled()) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// return skill.getHardcoreVampirismEnabled();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void enable(PrimarySkillType skill) {
|
||||
// toggle(true, skill);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void disable(PrimarySkillType skill) {
|
||||
// toggle(false, skill);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void modify(CommandSender sender, double newPercentage) {
|
||||
// Config.getInstance().setHardcoreVampirismStatLeechPercentage(newPercentage);
|
||||
// sender.sendMessage(LocaleLoader.getString("Hardcore.Vampirism.PercentageChanged", percent.format(newPercentage / 100.0D)));
|
||||
// }
|
||||
//
|
||||
// private void toggle(boolean enable, PrimarySkillType skill) {
|
||||
// if (skill == null) {
|
||||
// for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
|
||||
// primarySkillType.setHardcoreVampirismEnabled(enable);
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// skill.setHardcoreVampirismEnabled(enable);
|
||||
// }
|
||||
//
|
||||
// mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.Vampirism.Name"), (skill == null ? "all skills" : skill)));
|
||||
// }
|
||||
//}
|
Reference in New Issue
Block a user