mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-30 04:34:43 +02:00
Clean up on all of our commands. Abstracted experience commands and
hardcore commands. Moved lots of duplicated code to functions in CommandUtils.java. Split /ptp into individual commands, just like /party. Used ternary logic to simplify some of our /skillname stat displays. Fixed skill guide to not allow for negative pages. Simplified logic for many /skillname data calculations. Use permission checks to prevent calculating data that will never be displayed. Made the skill guide into its own command.
This commit is contained in:
@ -8,6 +8,7 @@ import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.database.DatabaseManager;
|
||||
import com.gmail.nossr50.database.LeaderboardManager;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
|
||||
public class McremoveCommand implements CommandExecutor {
|
||||
@ -25,7 +26,7 @@ public class McremoveCommand implements CommandExecutor {
|
||||
String tablePrefix = Config.getInstance().getMySQLTablePrefix();
|
||||
|
||||
if (DatabaseManager.update("DELETE FROM " + tablePrefix + "users WHERE " + tablePrefix + "users.user = '" + args[0] + "'") != 0) {
|
||||
DatabaseManager.profileCleanup(args[0]);
|
||||
Misc.profileCleanup(args[0]);
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcremove.Success", args[0]));
|
||||
}
|
||||
else {
|
||||
@ -34,7 +35,7 @@ public class McremoveCommand implements CommandExecutor {
|
||||
}
|
||||
else {
|
||||
if (LeaderboardManager.removeFlatFileUser(args[0])) {
|
||||
DatabaseManager.profileCleanup(args[0]);
|
||||
Misc.profileCleanup(args[0]);
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcremove.Success", args[0]));
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user