mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
Static Abuse Removal - Command package done for now
This commit is contained in:
parent
a9207b6f38
commit
67afdd7efb
@ -7,10 +7,8 @@ import org.bukkit.command.CommandSender;
|
||||
|
||||
public class AbilityToggleCommand extends ToggleCommand {
|
||||
|
||||
private mcMMO pluginRef;
|
||||
|
||||
public AbilityToggleCommand(mcMMO pluginRef) {
|
||||
this.pluginRef = pluginRef;
|
||||
super(pluginRef);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,10 +7,8 @@ import org.bukkit.command.CommandSender;
|
||||
|
||||
public class GodModeCommand extends ToggleCommand {
|
||||
|
||||
private mcMMO pluginRef;
|
||||
|
||||
public GodModeCommand(mcMMO pluginRef) {
|
||||
this.pluginRef = pluginRef;
|
||||
super(pluginRef);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,10 +7,8 @@ import org.bukkit.command.CommandSender;
|
||||
|
||||
public class RefreshCooldownsCommand extends ToggleCommand {
|
||||
|
||||
private mcMMO pluginRef;
|
||||
|
||||
public RefreshCooldownsCommand(mcMMO pluginRef) {
|
||||
this.pluginRef = pluginRef;
|
||||
super(pluginRef);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,11 +12,11 @@ import org.bukkit.command.TabExecutor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MHDCommand implements TabExecutor {
|
||||
public class ResetUserHealthBarSettingsCommand implements TabExecutor {
|
||||
|
||||
private mcMMO pluginRef;
|
||||
|
||||
public MHDCommand(mcMMO pluginRef) {
|
||||
public ResetUserHealthBarSettingsCommand(mcMMO pluginRef) {
|
||||
this.pluginRef = pluginRef;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
@ -12,6 +13,13 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ToggleCommand implements TabExecutor {
|
||||
|
||||
protected mcMMO pluginRef;
|
||||
|
||||
public ToggleCommand(mcMMO pluginRef) {
|
||||
this.pluginRef = pluginRef;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
@ -45,9 +53,10 @@ public abstract class ToggleCommand implements TabExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (pluginRef.getCommandTools().isOffline(sender, mcMMOPlayer.getPlayer())) {
|
||||
//TODO: Does it matter if they are offline?
|
||||
/*if (pluginRef.getCommandTools().isOffline(sender, mcMMOPlayer.getPlayer())) {
|
||||
return true;
|
||||
}
|
||||
}*/
|
||||
|
||||
applyCommandAction(mcMMOPlayer);
|
||||
sendSuccessMessage(sender, playerName);
|
||||
|
@ -18,9 +18,9 @@ import java.util.List;
|
||||
|
||||
public abstract class ChatCommand implements TabExecutor {
|
||||
private ChatMode chatMode;
|
||||
public mcMMO pluginRef;
|
||||
protected mcMMO pluginRef;
|
||||
|
||||
public ChatCommand(ChatMode chatMode, mcMMO pluginRef) {
|
||||
ChatCommand(ChatMode chatMode, mcMMO pluginRef) {
|
||||
this.chatMode = chatMode;
|
||||
this.pluginRef = pluginRef;
|
||||
}
|
||||
|
@ -8,10 +8,8 @@ import org.bukkit.command.CommandSender;
|
||||
|
||||
public class ChatSpyCommand extends ToggleCommand {
|
||||
|
||||
private mcMMO pluginRef;
|
||||
|
||||
public ChatSpyCommand(mcMMO pluginRef) {
|
||||
this.pluginRef = pluginRef;
|
||||
super(pluginRef);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,7 +40,7 @@ public abstract class SkillCommand implements TabExecutor {
|
||||
this.pluginRef = pluginRef;
|
||||
this.skill = skill;
|
||||
skillName = skill.getName();
|
||||
skillGuideCommand = new SkillGuideCommand(skill);
|
||||
skillGuideCommand = new SkillGuideCommand(skill, pluginRef);
|
||||
}
|
||||
|
||||
public static String[] addItemToFirstPositionOfArray(String itemToAdd, String... existingArray) {
|
||||
|
@ -388,7 +388,7 @@ public final class CommandRegistrationManager {
|
||||
command.setPermission("mcmmo.commands.mhd");
|
||||
command.setPermissionMessage(permissionsMessage);
|
||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mhd"));
|
||||
command.setExecutor(new MHDCommand());
|
||||
command.setExecutor(new ResetUserHealthBarSettingsCommand());
|
||||
}
|
||||
|
||||
private void registerMcscoreboardCommand() {
|
||||
|
Loading…
Reference in New Issue
Block a user