mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2026-06-06 10:16:55 +00:00
Part 1 of upstream merge and format
This commit is contained in:
@@ -23,7 +23,8 @@ public class CommandInfo {
|
||||
|
||||
private final String[] aliases;
|
||||
private final Object registeredWith;
|
||||
private final String usage, desc;
|
||||
private final String usage;
|
||||
private final String desc;
|
||||
private final String[] permissions;
|
||||
|
||||
public CommandInfo(String usage, String desc, String[] aliases, Object registeredWith) {
|
||||
|
||||
@@ -37,7 +37,8 @@ import java.util.Set;
|
||||
public class CommandRegistration {
|
||||
|
||||
static {
|
||||
Bukkit.getServer().getHelpMap().registerHelpTopicFactory(DynamicPluginCommand.class, new DynamicPluginCommandHelpTopic.Factory());
|
||||
Bukkit.getServer().getHelpMap().registerHelpTopicFactory(DynamicPluginCommand.class,
|
||||
new DynamicPluginCommandHelpTopic.Factory());
|
||||
}
|
||||
|
||||
protected final Plugin plugin;
|
||||
@@ -55,7 +56,9 @@ public class CommandRegistration {
|
||||
}
|
||||
|
||||
public Plugin getCommandOwner(String label) {
|
||||
if (serverCommandMap == null) return null;
|
||||
if (serverCommandMap == null) {
|
||||
return null;
|
||||
}
|
||||
Command command = serverCommandMap.getCommand(label);
|
||||
if (command instanceof PluginIdentifiableCommand) {
|
||||
return ((PluginIdentifiableCommand) command).getPlugin();
|
||||
@@ -87,8 +90,8 @@ public class CommandRegistration {
|
||||
|
||||
CommandMap commandMap = ReflectionUtil.getField(plugin.getServer().getPluginManager(), "commandMap");
|
||||
if (commandMap == null) {
|
||||
Bukkit.getServer().getLogger().severe(plugin.getDescription().getName() +
|
||||
": Could not retrieve server CommandMap, using fallback instead!");
|
||||
Bukkit.getServer().getLogger().severe(plugin.getDescription().getName()
|
||||
+ ": Could not retrieve server CommandMap, using fallback instead!");
|
||||
fallbackCommands = commandMap = new SimpleCommandMap(Bukkit.getServer());
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new FallbackRegistrationListener(fallbackCommands), plugin);
|
||||
} else {
|
||||
|
||||
@@ -22,8 +22,6 @@ package com.sk89q.bukkit.util;
|
||||
import com.sk89q.minecraft.util.commands.CommandsManager;
|
||||
import com.sk89q.util.StringUtil;
|
||||
import com.sk89q.wepif.PermissionsResolverManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -31,8 +29,11 @@ import org.bukkit.command.PluginIdentifiableCommand;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* An implementation of a dynamically registered {@link org.bukkit.command.Command} attached to a plugin
|
||||
* An implementation of a dynamically registered {@link org.bukkit.command.Command} attached to a plugin.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class DynamicPluginCommand extends org.bukkit.command.Command implements PluginIdentifiableCommand {
|
||||
@@ -105,7 +106,7 @@ public class DynamicPluginCommand extends org.bukkit.command.Command implements
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} catch (Throwable ignore) {
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
} else if (PermissionsResolverManager.isInitialized() && sender instanceof OfflinePlayer) {
|
||||
for (String permission : permissions) {
|
||||
|
||||
Reference in New Issue
Block a user