mirror of
https://github.com/songoda/UltimateModeration.git
synced 2024-11-22 18:26:10 +01:00
Added Enderchests.
This commit is contained in:
parent
03ebe22352
commit
856803764e
@ -30,12 +30,14 @@ public class CommandManager implements CommandExecutor {
|
||||
instance.getCommand("ToggleChat").setExecutor(this);
|
||||
instance.getCommand("RandomPlayer").setExecutor(this);
|
||||
instance.getCommand("Vanish").setExecutor(this);
|
||||
instance.getCommand("ViewEnderChest").setExecutor(this);
|
||||
|
||||
AbstractCommand commandUltimateModeration = addCommand(new CommandUltimateModeration());
|
||||
addCommand(new CommandClearChat());
|
||||
addCommand(new CommandToggleChat());
|
||||
addCommand(new CommandRandomPlayer());
|
||||
addCommand(new CommandVanish());
|
||||
addCommand(new CommandViewEnderChest());
|
||||
|
||||
addCommand(new CommandSettings(commandUltimateModeration));
|
||||
addCommand(new CommandReload(commandUltimateModeration));
|
||||
|
@ -0,0 +1,59 @@
|
||||
package com.songoda.ultimatemoderation.command.commands;
|
||||
|
||||
import com.songoda.ultimatemoderation.UltimateModeration;
|
||||
import com.songoda.ultimatemoderation.command.AbstractCommand;
|
||||
import com.songoda.ultimatemoderation.utils.Methods;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class CommandViewEnderChest extends AbstractCommand {
|
||||
|
||||
public CommandViewEnderChest() {
|
||||
super(true, true,"ViewEnderChest");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ReturnType runCommand(UltimateModeration instance, CommandSender sender, String... args) {
|
||||
|
||||
if (args.length != 1)
|
||||
return ReturnType.SYNTAX_ERROR;
|
||||
|
||||
Player player = Bukkit.getPlayer(args[0]);
|
||||
|
||||
if (player == null) {
|
||||
sender.sendMessage(instance.getReferences().getPrefix() + "That player does not exist or is not online.");
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
((Player)sender).openInventory(player.getEnderChest());
|
||||
return ReturnType.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> onTab(UltimateModeration instance, CommandSender sender, String... args) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean isForced(String[] args) {
|
||||
return args.length != 0 && args[0].equals("force");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
return "um.viewenderchest";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/ViewEnderChest <player>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Allows you to see inside of a players enderchest.\n";
|
||||
}
|
||||
}
|
@ -29,4 +29,9 @@ commands:
|
||||
description: Vanish
|
||||
default: false
|
||||
aliases: [v]
|
||||
usage: /v
|
||||
usage: /v
|
||||
ViewEnderChest:
|
||||
description: ViewEnderChest
|
||||
default: false
|
||||
aliases: [vec]
|
||||
usage: /vec
|
Loading…
Reference in New Issue
Block a user