mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Remove hardcore and vampirism commands
This commit is contained in:
parent
667b9a2226
commit
076d7a7f87
@ -1,4 +1,5 @@
|
||||
Version 2.1.182
|
||||
Removed hardcore and vampirism commands, these commands are dangerous, just modify the config file if you want to use hardcore / vampirism
|
||||
Fixed several errors in de locale (Thanks TheBusyBiscuit & w1tcherrr)
|
||||
Fixed a bug where double smelt never succeeded if the furnace was empty
|
||||
Added some safety so that mcMMO automatic save interval is never more frequent than 1 minute
|
||||
|
@ -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)));
|
||||
// }
|
||||
//}
|
@ -12,8 +12,6 @@ import com.gmail.nossr50.commands.experience.AddlevelsCommand;
|
||||
import com.gmail.nossr50.commands.experience.AddxpCommand;
|
||||
import com.gmail.nossr50.commands.experience.MmoeditCommand;
|
||||
import com.gmail.nossr50.commands.experience.SkillresetCommand;
|
||||
import com.gmail.nossr50.commands.hardcore.HardcoreCommand;
|
||||
import com.gmail.nossr50.commands.hardcore.VampirismCommand;
|
||||
import com.gmail.nossr50.commands.party.PartyCommand;
|
||||
import com.gmail.nossr50.commands.party.teleport.PtpCommand;
|
||||
import com.gmail.nossr50.commands.player.*;
|
||||
@ -363,25 +361,25 @@ public final class CommandRegistrationManager {
|
||||
command.setExecutor(new PtpCommand());
|
||||
}
|
||||
|
||||
private static void registerHardcoreCommand() {
|
||||
PluginCommand command = mcMMO.p.getCommand("hardcore");
|
||||
command.setDescription(LocaleLoader.getString("Commands.Description.hardcore"));
|
||||
command.setPermission("mcmmo.commands.hardcore;mcmmo.commands.hardcore.toggle;mcmmo.commands.hardcore.modify");
|
||||
command.setPermissionMessage(permissionsMessage);
|
||||
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "hardcore", "[on|off]"));
|
||||
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "hardcore", "<" + LocaleLoader.getString("Commands.Usage.Rate") + ">"));
|
||||
command.setExecutor(new HardcoreCommand());
|
||||
}
|
||||
|
||||
private static void registerVampirismCommand() {
|
||||
PluginCommand command = mcMMO.p.getCommand("vampirism");
|
||||
command.setDescription(LocaleLoader.getString("Commands.Description.vampirism"));
|
||||
command.setPermission("mcmmo.commands.vampirism;mcmmo.commands.vampirism.toggle;mcmmo.commands.vampirism.modify");
|
||||
command.setPermissionMessage(permissionsMessage);
|
||||
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "vampirism", "[on|off]"));
|
||||
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "vampirism", "<" + LocaleLoader.getString("Commands.Usage.Rate") + ">"));
|
||||
command.setExecutor(new VampirismCommand());
|
||||
}
|
||||
// private static void registerHardcoreCommand() {
|
||||
// PluginCommand command = mcMMO.p.getCommand("hardcore");
|
||||
// command.setDescription(LocaleLoader.getString("Commands.Description.hardcore"));
|
||||
// command.setPermission("mcmmo.commands.hardcore;mcmmo.commands.hardcore.toggle;mcmmo.commands.hardcore.modify");
|
||||
// command.setPermissionMessage(permissionsMessage);
|
||||
// command.setUsage(LocaleLoader.getString("Commands.Usage.1", "hardcore", "[on|off]"));
|
||||
// command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "hardcore", "<" + LocaleLoader.getString("Commands.Usage.Rate") + ">"));
|
||||
// command.setExecutor(new HardcoreCommand());
|
||||
// }
|
||||
//
|
||||
// private static void registerVampirismCommand() {
|
||||
// PluginCommand command = mcMMO.p.getCommand("vampirism");
|
||||
// command.setDescription(LocaleLoader.getString("Commands.Description.vampirism"));
|
||||
// command.setPermission("mcmmo.commands.vampirism;mcmmo.commands.vampirism.toggle;mcmmo.commands.vampirism.modify");
|
||||
// command.setPermissionMessage(permissionsMessage);
|
||||
// command.setUsage(LocaleLoader.getString("Commands.Usage.1", "vampirism", "[on|off]"));
|
||||
// command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "vampirism", "<" + LocaleLoader.getString("Commands.Usage.Rate") + ">"));
|
||||
// command.setExecutor(new VampirismCommand());
|
||||
// }
|
||||
|
||||
private static void registerMcnotifyCommand() {
|
||||
PluginCommand command = mcMMO.p.getCommand("mcnotify");
|
||||
@ -473,8 +471,8 @@ public final class CommandRegistrationManager {
|
||||
registerSkillresetCommand();
|
||||
|
||||
// Hardcore Commands
|
||||
registerHardcoreCommand();
|
||||
registerVampirismCommand();
|
||||
// registerHardcoreCommand();
|
||||
// registerVampirismCommand();
|
||||
|
||||
// Party Commands
|
||||
registerPartyCommand();
|
||||
|
@ -156,14 +156,14 @@ commands:
|
||||
mcpurge:
|
||||
description: Purge users with 0 powerlevel and/or who haven't connected in several months from the server DB.
|
||||
permission: mcmmo.commands.mcpurge
|
||||
hardcore:
|
||||
aliases: [mchardcore]
|
||||
description: Modify the mcMMO hardcore percentage or toggle hardcore mode on/off
|
||||
permission: mcmmo.commands.hardcore
|
||||
vampirism:
|
||||
aliases: [mcvampirism]
|
||||
description: Modify the mcMMO vampirism percentage or toggle vampirism mode on/off
|
||||
permission: mcmmo.commands.vampirism
|
||||
# hardcore:
|
||||
# aliases: [mchardcore]
|
||||
# description: Modify the mcMMO hardcore percentage or toggle hardcore mode on/off
|
||||
# permission: mcmmo.commands.hardcore
|
||||
# vampirism:
|
||||
# aliases: [mcvampirism]
|
||||
# description: Modify the mcMMO vampirism percentage or toggle vampirism mode on/off
|
||||
# permission: mcmmo.commands.vampirism
|
||||
mcnotify:
|
||||
aliases: [notify]
|
||||
description: Toggle mcMMO abilities chat display notifications on/off
|
||||
@ -833,7 +833,7 @@ permissions:
|
||||
mcmmo.commands.addxp: true
|
||||
mcmmo.commands.addxp.others: true
|
||||
mcmmo.commands.defaults: true
|
||||
mcmmo.commands.hardcore.all: true
|
||||
# mcmmo.commands.hardcore.all: true
|
||||
mcmmo.commands.inspect.far: true
|
||||
mcmmo.commands.inspect.hidden: true
|
||||
mcmmo.commands.mcability.others: true
|
||||
@ -854,7 +854,7 @@ permissions:
|
||||
mcmmo.commands.ptp.world.all: true
|
||||
mcmmo.commands.reloadlocale: true
|
||||
mcmmo.commands.skillreset.all: true
|
||||
mcmmo.commands.vampirism.all: true
|
||||
# mcmmo.commands.vampirism.all: true
|
||||
mcmmo.commands.xprate.all: true
|
||||
mcmmo.commands.acrobatics:
|
||||
description: Allows access to the acrobatics command
|
||||
@ -876,23 +876,23 @@ permissions:
|
||||
description: Allows access to the excavation command
|
||||
mcmmo.commands.fishing:
|
||||
description: Allows access to the fishing command
|
||||
mcmmo.commands.hardcore.*:
|
||||
default: false
|
||||
description: Implies access to all mcmmo.commands.hardcore permissions
|
||||
children:
|
||||
mcmmo.commands.hardcore.all: true
|
||||
mcmmo.commands.hardcore.all:
|
||||
description: Implies access to all mcmmo.commands.hardcore permissions
|
||||
children:
|
||||
mcmmo.commands.hardcore: true
|
||||
mcmmo.commands.hardcore.modify: true
|
||||
mcmmo.commands.hardcore.toggle: true
|
||||
mcmmo.commands.hardcore:
|
||||
description: Allows access to the hardcore command
|
||||
mcmmo.commands.hardcore.modify:
|
||||
description: Allows access to the hardcore command to modify the hardcore rate
|
||||
mcmmo.commands.hardcore.toggle:
|
||||
description: Allows access to the hardcore command to toggle hardcore on/off
|
||||
# mcmmo.commands.hardcore.*:
|
||||
# default: false
|
||||
# description: Implies access to all mcmmo.commands.hardcore permissions
|
||||
# children:
|
||||
# mcmmo.commands.hardcore.all: true
|
||||
# mcmmo.commands.hardcore.all:
|
||||
# description: Implies access to all mcmmo.commands.hardcore permissions
|
||||
# children:
|
||||
# mcmmo.commands.hardcore: true
|
||||
# mcmmo.commands.hardcore.modify: true
|
||||
# mcmmo.commands.hardcore.toggle: true
|
||||
# mcmmo.commands.hardcore:
|
||||
# description: Allows access to the hardcore command
|
||||
# mcmmo.commands.hardcore.modify:
|
||||
# description: Allows access to the hardcore command to modify the hardcore rate
|
||||
# mcmmo.commands.hardcore.toggle:
|
||||
# description: Allows access to the hardcore command to toggle hardcore on/off
|
||||
mcmmo.commands.herbalism:
|
||||
description: Allows access to the herbalism command
|
||||
mcmmo.commands.inspect.*:
|
||||
@ -1283,23 +1283,23 @@ permissions:
|
||||
description: Allows access to the taming command
|
||||
mcmmo.commands.unarmed:
|
||||
description: Allows access to the unarmed command
|
||||
mcmmo.commands.vampirism.*:
|
||||
default: false
|
||||
description: Implies access to all mcmmo.commands.vampirism permissions
|
||||
children:
|
||||
mcmmo.commands.vampirism.all: true
|
||||
mcmmo.commands.vampirism.all:
|
||||
description: Implies access to all mcmmo.commands.vampirism permissions
|
||||
children:
|
||||
mcmmo.commands.vampirism: true
|
||||
mcmmo.commands.vampirism.modify: true
|
||||
mcmmo.commands.vampirism.toggle: true
|
||||
mcmmo.commands.vampirism:
|
||||
description: Allows access to the vampirism command
|
||||
mcmmo.commands.vampirism.modify:
|
||||
description: Allows access to the vampirism command to modify the vampirism rate
|
||||
mcmmo.commands.vampirism.toggle:
|
||||
description: Allows access to the vampirism command to toggle vampirism on/off
|
||||
# mcmmo.commands.vampirism.*:
|
||||
# default: false
|
||||
# description: Implies access to all mcmmo.commands.vampirism permissions
|
||||
# children:
|
||||
# mcmmo.commands.vampirism.all: true
|
||||
# mcmmo.commands.vampirism.all:
|
||||
# description: Implies access to all mcmmo.commands.vampirism permissions
|
||||
# children:
|
||||
# mcmmo.commands.vampirism: true
|
||||
# mcmmo.commands.vampirism.modify: true
|
||||
# mcmmo.commands.vampirism.toggle: true
|
||||
# mcmmo.commands.vampirism:
|
||||
# description: Allows access to the vampirism command
|
||||
# mcmmo.commands.vampirism.modify:
|
||||
# description: Allows access to the vampirism command to modify the vampirism rate
|
||||
# mcmmo.commands.vampirism.toggle:
|
||||
# description: Allows access to the vampirism command to toggle vampirism on/off
|
||||
mcmmo.commands.woodcutting:
|
||||
description: Allows access to the woodcutting command
|
||||
mcmmo.commands.xprate.*:
|
||||
|
Loading…
Reference in New Issue
Block a user