本文整理汇总了Java中org.bukkit.command.PluginCommand.setPermissionMessage方法的典型用法代码示例。如果您正苦于以下问题:Java PluginCommand.setPermissionMessage方法的具体用法?Java PluginCommand.setPermissionMessage怎么用?Java PluginCommand.setPermissionMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.command.PluginCommand
的用法示例。
在下文中一共展示了PluginCommand.setPermissionMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupBukkitCommand
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
private PluginCommand setupBukkitCommand() {
try {
final Constructor<PluginCommand> c = PluginCommand.class.getDeclaredConstructor(String.class, Plugin.class);
c.setAccessible(true);
final PluginCommand bukkitCommand = c.newInstance(name, Skript.getInstance());
bukkitCommand.setAliases(aliases);
bukkitCommand.setDescription(description);
bukkitCommand.setLabel(label);
bukkitCommand.setPermission(permission);
bukkitCommand.setPermissionMessage(permissionMessage);
bukkitCommand.setUsage(usage);
bukkitCommand.setExecutor(this);
return bukkitCommand;
} catch (final Exception e) {
Skript.outdatedError(e);
throw new EmptyStacktraceException();
}
}
示例2: createNewBukkitCommand
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
/**
* Creates a new Bukkit command.
*
* @param nukkitCommand
* The Nukkit command.
* @return The plugin command.
* @throws ClassCastException
* If the nukkitCommand is not provided by a Bukkit plugin.
*/
private PluginCommand createNewBukkitCommand(cn.nukkit.command.PluginCommand<?> nukkitCommand) {
Plugin bukkitPlugin = PokkitPlugin.toBukkit(nukkitCommand.getPlugin());
try {
Constructor<PluginCommand> constructor = PluginCommand.class.getDeclaredConstructor(String.class,
Plugin.class);
constructor.setAccessible(true);
PluginCommand bukkitCommand = constructor.newInstance(nukkitCommand.getName(), bukkitPlugin);
bukkitCommand.setAliases(Arrays.asList(nukkitCommand.getAliases()));
bukkitCommand.setDescription(nukkitCommand.getDescription());
bukkitCommand.setLabel(nukkitCommand.getLabel());
bukkitCommand.setPermission(nukkitCommand.getPermission());
bukkitCommand.setPermissionMessage(nukkitCommand.getPermissionMessage());
bukkitCommand.setUsage(nukkitCommand.getUsage());
return bukkitCommand;
} catch (ReflectiveOperationException e) {
throw new RuntimeException(e);
}
}
示例3: addExecutor
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
@SneakyThrows
public static void addExecutor(Plugin plugin, Command command) {
Field f = SimplePluginManager.class.getDeclaredField("commandMap");
f.setAccessible(true);
CommandMap map = (CommandMap) f.get(plugin.getServer().getPluginManager());
Constructor<PluginCommand> init = PluginCommand.class.getDeclaredConstructor(String.class, Plugin.class);
init.setAccessible(true);
PluginCommand inject = init.newInstance(command.getName(), plugin);
inject.setExecutor((who, __, label, input) -> command.execute(who, label, input));
inject.setAliases(command.getAliases());
inject.setDescription(command.getDescription());
inject.setLabel(command.getLabel());
inject.setName(command.getName());
inject.setPermission(command.getPermission());
inject.setPermissionMessage(command.getPermissionMessage());
inject.setUsage(command.getUsage());
map.register(plugin.getName().toLowerCase(), inject);
}
示例4: register
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
public static void register(String prefix, Plugin plugin, InjectableCommand... commands) {
for (InjectableCommand command : commands) {
if (command.getName() == null || command.getExecutor() == null) {
Bukkit.getServer().getLogger().severe("Could not register command " + command.getName() + " for plugin " + plugin.getName() + ": CommandName or CommandExecutor cannot be null");
continue;
}
if (command.getName().contains(":")) {
Bukkit.getServer().getLogger().severe("Could not register command " + command.getName() + " for plugin " + plugin.getName() + ": CommandName cannot contain \":\"");
continue;
}
PluginCommand _command = getPluginCommand(command.getName(), plugin);
_command.setExecutor(command.getExecutor());
if (command.getDescription() != null) {
_command.setDescription(command.getDescription());
}
if (!(command.getAliases() == null || command.getAliases().isEmpty())) {
_command.setAliases(command.getAliases());
}
if (command.getPermission() != null) {
_command.setPermission(command.getPermission());
}
if (command.getPermissionMessage() != null) {
_command.setPermissionMessage(command.getPermissionMessage());
}
if (command.getTabCompleter() != null) {
_command.setTabCompleter(command.getTabCompleter());
}
getCommandMap().register(prefix, _command);
}
}
示例5: registerHardcoreCommand
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
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());
}
示例6: registerPartyChatCommand
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
private static void registerPartyChatCommand() {
PluginCommand command = mcMMO.p.getCommand("partychat");
command.setDescription(LocaleLoader.getString("Commands.Description.partychat"));
command.setPermission("mcmmo.chat.partychat;mcmmo.commands.party");
command.setPermissionMessage(permissionsMessage);
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "partychat"));
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "partychat", "<on|off>"));
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "partychat", "<" + LocaleLoader.getString("Commands.Usage.Message") + ">"));
command.setExecutor(new PartyChatCommand());
}
示例7: registerAddxpCommand
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
private static void registerAddxpCommand() {
PluginCommand command = mcMMO.p.getCommand("addxp");
command.setDescription(LocaleLoader.getString("Commands.Description.addxp"));
command.setPermission("mcmmo.commands.addxp;mcmmo.commands.addxp.others");
command.setPermissionMessage(permissionsMessage);
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());
}
示例8: registerAdminChatCommand
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
private static void registerAdminChatCommand() {
PluginCommand command = mcMMO.p.getCommand("adminchat");
command.setDescription(LocaleLoader.getString("Commands.Description.adminchat"));
command.setPermission("mcmmo.chat.adminchat");
command.setPermissionMessage(permissionsMessage);
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "adminchat"));
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "adminchat", "<on|off>"));
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "adminchat", "<" + LocaleLoader.getString("Commands.Usage.Message") + ">"));
command.setExecutor(new AdminChatCommand());
}
示例9: registerMobhealthCommand
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
private static void registerMobhealthCommand() {
PluginCommand command = mcMMO.p.getCommand("mobhealth");
command.setDescription("Change the style of the mob healthbar"); //TODO: Localize
command.setPermission("mcmmo.commands.mobhealth");
command.setPermissionMessage(permissionsMessage);
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "mobhealth", "<DISABLED | HEARTS | BAR>"));
command.setExecutor(new MobhealthCommand());
}
示例10: registerMmoeditCommand
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
private static void registerMmoeditCommand() {
PluginCommand command = mcMMO.p.getCommand("mmoedit");
command.setDescription(LocaleLoader.getString("Commands.Description.mmoedit"));
command.setPermission("mcmmo.commands.mmoedit;mcmmo.commands.mmoedit.others");
command.setPermissionMessage(permissionsMessage);
command.setUsage(LocaleLoader.getString("Commands.Usage.3", "mmoedit", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]", "<" + LocaleLoader.getString("Commands.Usage.Skill") + ">", "<" + LocaleLoader.getString("Commands.Usage.Level") + ">"));
command.setExecutor(new MmoeditCommand());
}
示例11: registerSkillresetCommand
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
private static void registerSkillresetCommand() {
PluginCommand command = mcMMO.p.getCommand("skillreset");
command.setDescription(LocaleLoader.getString("Commands.Description.skillreset"));
command.setPermission("mcmmo.commands.skillreset;mcmmo.commands.skillreset.others"); // Only need the main ones, not the individual skill ones
command.setPermissionMessage(permissionsMessage);
command.setUsage(LocaleLoader.getString("Commands.Usage.2", "skillreset", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]", "<" + LocaleLoader.getString("Commands.Usage.Skill") + ">"));
command.setExecutor(new SkillresetCommand());
}
示例12: registerPartyCommand
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
private static void registerPartyCommand() {
PluginCommand command = mcMMO.p.getCommand("party");
command.setDescription(LocaleLoader.getString("Commands.Description.party"));
command.setPermission("mcmmo.commands.party;mcmmo.commands.party.accept;mcmmo.commands.party.create;mcmmo.commands.party.disband;" +
"mcmmo.commands.party.xpshare;mcmmo.commands.party.invite;mcmmo.commands.party.itemshare;mcmmo.commands.party.join;" +
"mcmmo.commands.party.kick;mcmmo.commands.party.lock;mcmmo.commands.party.owner;mcmmo.commands.party.password;" +
"mcmmo.commands.party.quit;mcmmo.commands.party.rename;mcmmo.commands.party.unlock");
command.setPermissionMessage(permissionsMessage);
command.setExecutor(new PartyCommand());
}
示例13: registerInspectCommand
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
private static void registerInspectCommand() {
PluginCommand command = mcMMO.p.getCommand("inspect");
command.setDescription(LocaleLoader.getString("Commands.Description.inspect"));
command.setPermission("mcmmo.commands.inspect;mcmmo.commands.inspect.far;mcmmo.commands.inspect.offline");
command.setPermissionMessage(permissionsMessage);
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "inspect", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">"));
command.setExecutor(new InspectCommand());
}
示例14: registerMccooldownCommand
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
private static void registerMccooldownCommand() {
PluginCommand command = mcMMO.p.getCommand("mccooldown");
command.setDescription(LocaleLoader.getString("Commands.Description.mccooldown"));
command.setPermission("mcmmo.commands.mccooldown");
command.setPermissionMessage(permissionsMessage);
command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mccooldowns"));
command.setExecutor(new MccooldownCommand());
}
示例15: registerMcabilityCommand
import org.bukkit.command.PluginCommand; //导入方法依赖的package包/类
private static void registerMcabilityCommand() {
PluginCommand command = mcMMO.p.getCommand("mcability");
command.setDescription(LocaleLoader.getString("Commands.Description.mcability"));
command.setPermission("mcmmo.commands.mcability;mcmmo.commands.mcability.others");
command.setPermissionMessage(permissionsMessage);
command.setUsage(LocaleLoader.getString("Commands.Usage.1", "mcability", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]"));
command.setExecutor(new McabilityCommand());
}