mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Update command registration for /mcgod
This commit is contained in:
@ -8,6 +8,7 @@ import org.bukkit.command.PluginCommand;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.commands.admin.AddlevelsCommand;
|
||||
import com.gmail.nossr50.commands.admin.AddxpCommand;
|
||||
import com.gmail.nossr50.commands.admin.McgodCommand;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.skills.acrobatics.AcrobaticsCommand;
|
||||
import com.gmail.nossr50.skills.archery.ArcheryCommand;
|
||||
@ -131,4 +132,13 @@ public final class CommandRegistrationHelper {
|
||||
command.setUsage(LocaleLoader.getString("Commands.Usage.3", "addxp", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]", "<" + LocaleLoader.getString("Commands.Usage.Skill") + ">", "<" + LocaleLoader.getString("Commands.Usage.XP") + ">"));
|
||||
command.setExecutor(new AddxpCommand());
|
||||
}
|
||||
|
||||
public static void registerMcgodCommand() {
|
||||
PluginCommand command = mcMMO.p.getCommand("mcgod");
|
||||
command.setDescription(LocaleLoader.getString("Commands.Description.mcgod"));
|
||||
command.setPermission("mcmmo.commands.mcgod");
|
||||
command.setPermissionMessage(permissionsMessage);
|
||||
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "mcgod", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]"));
|
||||
command.setExecutor(new McgodCommand());
|
||||
}
|
||||
}
|
||||
|
@ -23,11 +23,7 @@ public class McgodCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Permissions.mcgodCommand(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
profile = Users.getProfile((Player) sender);
|
||||
profile = Users.getPlayer((Player) sender).getProfile();
|
||||
|
||||
if (profile == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||
@ -43,11 +39,13 @@ public class McgodCommand implements CommandExecutor {
|
||||
|
||||
profile.toggleGodMode();
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (!Permissions.hasPermission(sender, "mcmmo.commands.mcgod.others")) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = Users.getPlayer(args[0]);
|
||||
|
||||
// If the mcMMOPlayer doesn't exist, create a temporary profile and
|
||||
@ -77,6 +75,7 @@ public class McgodCommand implements CommandExecutor {
|
||||
|
||||
profile.toggleGodMode();
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user