Java 类org.bukkit.command.RemoteConsoleCommandSender 实例源码

项目:Uranium    文件:VanillaCommandWrapper.java   
private net.minecraft.command.ICommandSender getListener(CommandSender sender) {
    if (sender instanceof Player) {
        return ((CraftPlayer) sender).getHandle();
    }
    if (sender instanceof BlockCommandSender) {
        return ((CraftBlockCommandSender) sender).getTileEntity();
    }
    if (sender instanceof CommandMinecart) {
        return ((net.minecraft.entity.EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).func_145822_e();
    }
    if (sender instanceof RemoteConsoleCommandSender) {
        return net.minecraft.network.rcon.RConConsoleSource.instance;
    }
    if (sender instanceof ConsoleCommandSender) {
        return ((CraftServer) sender.getServer()).getServer();
    }
    return null;
}
项目:ThermosRebased    文件:VanillaCommandWrapper.java   
private net.minecraft.command.ICommandSender getListener(CommandSender sender) {
    if (sender instanceof Player) {
        return ((CraftPlayer) sender).getHandle();
    }
    if (sender instanceof BlockCommandSender) {
        return ((CraftBlockCommandSender) sender).getTileEntity();
    }
    if (sender instanceof CommandMinecart) {
        return ((net.minecraft.entity.EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).func_145822_e();
    }
    if (sender instanceof RemoteConsoleCommandSender) {
        return net.minecraft.network.rcon.RConConsoleSource.instance;
    }
    if (sender instanceof ConsoleCommandSender) {
        return ((CraftServer) sender.getServer()).getServer();
    }
    return null;
}
项目:Thermos    文件:VanillaCommandWrapper.java   
private net.minecraft.command.ICommandSender getListener(CommandSender sender) {
    if (sender instanceof Player) {
        return ((CraftPlayer) sender).getHandle();
    }
    if (sender instanceof BlockCommandSender) {
        return ((CraftBlockCommandSender) sender).getTileEntity();
    }
    if (sender instanceof CommandMinecart) {
        return ((net.minecraft.entity.EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).func_145822_e();
    }
    if (sender instanceof RemoteConsoleCommandSender) {
        return net.minecraft.network.rcon.RConConsoleSource.instance;
    }
    if (sender instanceof ConsoleCommandSender) {
        return ((CraftServer) sender.getServer()).getServer();
    }
    return null;
}
项目:KCauldron    文件:VanillaCommandWrapper.java   
private net.minecraft.command.ICommandSender getListener(CommandSender sender) {
    if (sender instanceof Player) {
        return ((CraftPlayer) sender).getHandle();
    }
    if (sender instanceof BlockCommandSender) {
        return ((CraftBlockCommandSender) sender).getTileEntity();
    }
    if (sender instanceof CommandMinecart) {
        return ((net.minecraft.entity.EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).func_145822_e();
    }
    if (sender instanceof RemoteConsoleCommandSender) {
        return net.minecraft.network.rcon.RConConsoleSource.instance;
    }
    if (sender instanceof ConsoleCommandSender) {
        return ((CraftServer) sender.getServer()).getServer();
    }
    return null;
}
项目:CauldronGit    文件:VanillaCommandWrapper.java   
private net.minecraft.command.ICommandSender getListener(CommandSender sender) {
    if (sender instanceof Player) {
        return ((CraftPlayer) sender).getHandle();
    }
    if (sender instanceof BlockCommandSender) {
        return ((CraftBlockCommandSender) sender).getTileEntity();
    }
    if (sender instanceof CommandMinecart) {
        return ((net.minecraft.entity.EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).func_145822_e();
    }
    if (sender instanceof RemoteConsoleCommandSender) {
        return net.minecraft.network.rcon.RConConsoleSource.instance;
    }
    if (sender instanceof ConsoleCommandSender) {
        return ((CraftServer) sender.getServer()).getServer();
    }
    return null;
}
项目:Cauldron-Old    文件:VanillaCommandWrapper.java   
private net.minecraft.command.ICommandSender getListener(CommandSender sender) {
    if (sender instanceof Player) {
        return ((CraftPlayer) sender).getHandle();
    }
    if (sender instanceof BlockCommandSender) {
        return ((CraftBlockCommandSender) sender).getTileEntity();
    }
    if (sender instanceof CommandMinecart) {
        return ((net.minecraft.entity.EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).func_145822_e();
    }
    if (sender instanceof RemoteConsoleCommandSender) {
        return net.minecraft.network.rcon.RConConsoleSource.instance;
    }
    if (sender instanceof ConsoleCommandSender) {
        return ((CraftServer) sender.getServer()).getServer();
    }
    return null;
}
项目:Cauldron-Reloaded    文件:VanillaCommandWrapper.java   
private net.minecraft.command.ICommandSender getListener(CommandSender sender) {
    if (sender instanceof Player) {
        return ((CraftPlayer) sender).getHandle();
    }
    if (sender instanceof BlockCommandSender) {
        return ((CraftBlockCommandSender) sender).getTileEntity();
    }
    if (sender instanceof CommandMinecart) {
        return ((net.minecraft.entity.EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).func_145822_e();
    }
    if (sender instanceof RemoteConsoleCommandSender) {
        return net.minecraft.network.rcon.RConConsoleSource.instance;
    }
    if (sender instanceof ConsoleCommandSender) {
        return ((CraftServer) sender.getServer()).getServer();
    }
    return null;
}
项目:FFoKC    文件:VanillaCommandWrapper.java   
private net.minecraft.command.ICommandSender getListener(CommandSender sender) {
    if (sender instanceof Player) {
        return ((CraftPlayer) sender).getHandle();
    }
    if (sender instanceof BlockCommandSender) {
        return ((CraftBlockCommandSender) sender).getTileEntity();
    }
    if (sender instanceof CommandMinecart) {
        return ((net.minecraft.entity.EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).func_145822_e();
    }
    if (sender instanceof RemoteConsoleCommandSender) {
        return net.minecraft.network.rcon.RConConsoleSource.instance;
    }
    if (sender instanceof ConsoleCommandSender) {
        return ((CraftServer) sender.getServer()).getServer();
    }
    return null;
}
项目:CraftBukkit    文件:VanillaCommandWrapper.java   
private ICommandListener getListener(CommandSender sender) {
    if (sender instanceof Player) {
        return ((CraftPlayer) sender).getHandle();
    }
    if (sender instanceof BlockCommandSender) {
        return ((CraftBlockCommandSender) sender).getTileEntity();
    }
    if (sender instanceof CommandMinecart) {
        return ((EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).getCommandBlock();
    }
    if (sender instanceof RemoteConsoleCommandSender) {
        return RemoteControlCommandListener.instance;
    }
    if (sender instanceof ConsoleCommandSender) {
        return ((CraftServer) sender.getServer()).getServer();
    }
    return null;
}
项目:Craftbukkit    文件:VanillaCommandWrapper.java   
private ICommandListener getListener(CommandSender sender) {
    if (sender instanceof Player) {
        return ((CraftPlayer) sender).getHandle();
    }
    if (sender instanceof BlockCommandSender) {
        return ((CraftBlockCommandSender) sender).getTileEntity();
    }
    if (sender instanceof CommandMinecart) {
        return ((EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).getCommandBlock();
    }
    if (sender instanceof RemoteConsoleCommandSender) {
        return RemoteControlCommandListener.getInstance();
    }
    if (sender instanceof ConsoleCommandSender) {
        return ((CraftServer) sender.getServer()).getServer();
    }
    if (sender instanceof ProxiedCommandSender) {
        return ((ProxiedNativeCommandSender) sender).getHandle();
    }
    throw new IllegalArgumentException("Cannot make " + sender + " a vanilla command listener");
}
项目:AdvancedCommands    文件:ReflectionHelper.java   
public static Object toNMSIComandSender(CommandSender s) {
    try {
        if (s instanceof Entity) {
            return getEntityByUUID(((Entity) s).getUniqueId());
        } else if (s instanceof ConsoleCommandSender) {
            return getServer();
        } else if (s instanceof RemoteConsoleCommandSender) {
            return getRemoteControlCommandListener();
        } else if (s instanceof ProxiedCommandSender) {
            return getProxiedCommandSender((ProxiedCommandSender) s);
        } else if (s instanceof BlockCommandSender) {
            return getCommandBlockLogic(((BlockCommandSender) s).getBlock());
        } else if (s instanceof CommandMinecart) {
            return getCommandBlockLogic((CommandMinecart) s);
        }
        return null;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
项目:pluginframework    文件:BukkitLocaleProvider.java   
@Override
public Locale localeForCommandSender(CommandSender sender)
{
    if(sender instanceof BlockCommandSender)
        return commandBlockLocale;

    if(sender instanceof ConsoleCommandSender)
        return consoleLocale;

    if(sender instanceof RemoteConsoleCommandSender)
        return remoteConsoleLocale;

    if(sender instanceof Player)
        return LocaleUtils.toLocale(fetcher.getLocaleForPlayer((Player) sender));

    return Locale.ENGLISH;
}
项目:Tweakkit-Server    文件:VanillaCommandWrapper.java   
private ICommandListener getListener(CommandSender sender) {
    if (sender instanceof Player) {
        return ((CraftPlayer) sender).getHandle();
    }
    if (sender instanceof BlockCommandSender) {
        return ((CraftBlockCommandSender) sender).getTileEntity();
    }
    if (sender instanceof CommandMinecart) {
        return ((EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).getCommandBlock();
    }
    if (sender instanceof RemoteConsoleCommandSender) {
        return RemoteControlCommandListener.instance;
    }
    if (sender instanceof ConsoleCommandSender) {
        return ((CraftServer) sender.getServer()).getServer();
    }
    return null;
}
项目:Cauldron    文件:VanillaCommandWrapper.java   
private net.minecraft.command.ICommandSender getListener(CommandSender sender) {
    if (sender instanceof Player) {
        return ((CraftPlayer) sender).getHandle();
    }
    if (sender instanceof BlockCommandSender) {
        return ((CraftBlockCommandSender) sender).getTileEntity();
    }
    if (sender instanceof CommandMinecart) {
        return ((net.minecraft.entity.EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).func_145822_e();
    }
    if (sender instanceof RemoteConsoleCommandSender) {
        return net.minecraft.network.rcon.RConConsoleSource.instance;
    }
    if (sender instanceof ConsoleCommandSender) {
        return ((CraftServer) sender.getServer()).getServer();
    }
    return null;
}
项目:multicraft-api    文件:MCCommand.java   
private MCCommandSender parseSender(CommandSender s, MCSubcommand mcsc){
    if (mcsc.commandSender().equals(MCCommandSender.GENERIC) || mcsc.commandSender().equals(null)){
        return MCCommandSender.GENERIC;
    }
    else if (s instanceof ConsoleCommandSender){
        return MCCommandSender.CONSOLE;
    }
    else if (s instanceof Player){
        return MCCommandSender.PLAYER;
    }
    else if (s instanceof RemoteConsoleCommandSender){
        return MCCommandSender.REMOTE;
    }
    else if (s instanceof BlockCommandSender){
        return MCCommandSender.COMMANDBLOCK;
    }else{
        return MCCommandSender.GENERIC;
    }
}
项目:SpigotSource    文件:VanillaCommandWrapper.java   
private ICommandListener getListener(CommandSender sender) {
    if (sender instanceof Player) {
        return ((CraftPlayer) sender).getHandle();
    }
    if (sender instanceof BlockCommandSender) {
        return ((CraftBlockCommandSender) sender).getTileEntity();
    }
    if (sender instanceof CommandMinecart) {
        return ((EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).getCommandBlock();
    }
    if (sender instanceof RemoteConsoleCommandSender) {
        return ((DedicatedServer)MinecraftServer.getServer()).remoteControlCommandListener;
    }
    if (sender instanceof ConsoleCommandSender) {
        return ((CraftServer) sender.getServer()).getServer();
    }
    if (sender instanceof ProxiedCommandSender) {
        return ((ProxiedNativeCommandSender) sender).getHandle();
    }
    throw new IllegalArgumentException("Cannot make " + sender + " a vanilla command listener");
}
项目:LuckPerms    文件:BukkitSenderFactory.java   
@Override
protected void sendMessage(CommandSender sender, String s) {
    // we can safely send async for players and the console
    if (sender instanceof Player || sender instanceof ConsoleCommandSender || sender instanceof RemoteConsoleCommandSender) {
        sender.sendMessage(s);
        return;
    }

    // otherwise, send the message sync
    getPlugin().getScheduler().doSync(new SyncMessengerAgent(sender, s));
}
项目:AdvancedCommands    文件:CommandVarTable.java   
@Override
protected void doExecute(CommandSender sender, String[] args) {
    if ((sender instanceof Player)||(sender instanceof ConsoleCommandSender)||(sender instanceof RemoteConsoleCommandSender)){
        if (args.length != 1) {
            throw new IllegalArgumentException("Wrong arguments length");
        }

        switch (args[0]) {
        case "save":
            saveVarTable(sender);
            break;
        case "load":
            if (plugin.getVarTable().isDirty()) {
                sender.sendMessage(ChatColor.RED.toString() + ChatColor.ITALIC.toString() + ChatColor.BOLD.toString() + "Warning:");
                sender.sendMessage(ChatColor.RED.toString() + ChatColor.ITALIC.toString()+ "The var table is modify, and not saved!");
                sender.sendMessage(ChatColor.RED.toString() + ChatColor.ITALIC.toString()+ "If you want to continue, use '/varTable load!'.");
            } else {
                loadVarTable(sender);
            }
            break;
        case "load!":
            loadVarTable(sender);
            break;
        default:
            throw new IllegalArgumentException(String.format("Unknown argument %s", args[0]));
        }
    }else{
        throw new IllegalAccessError("Only a op/console can execute this command");
    }
}
项目:PlotSquared    文件:BukkitCommand.java   
@Override
public boolean onCommand(CommandSender commandSender, Command command, String commandLabel, String[] args) {
    if (commandSender instanceof Player) {
        return MainCommand.onCommand(BukkitUtil.getPlayer((Player) commandSender), args);
    }
    if (commandSender instanceof ConsoleCommandSender || commandSender instanceof ProxiedCommandSender
            || commandSender instanceof RemoteConsoleCommandSender) {
        return MainCommand.onCommand(ConsolePlayer.getConsole(), args);
    }
    return false;
}
项目:Cauldron    文件:TimingsCommand.java   
@Override
public synchronized void start() {
    if (sender instanceof RemoteConsoleCommandSender) {
        run();
    } else {
        super.start();
    }
}
项目:Spigot-API    文件:TimingsCommand.java   
@Override
public synchronized void start() {
    if (sender instanceof RemoteConsoleCommandSender) {
        run();
    } else {
        super.start();
    }
}
项目:NBTEditor    文件:MyCommand.java   
public boolean isValidSender(CommandSender sender) {
    switch (this) {
    case PLAYER_ONLY:
        return (sender instanceof Player);
    case NO_PLAYER:
        return (sender instanceof ConsoleCommandSender || sender instanceof RemoteConsoleCommandSender || sender instanceof BlockCommandSender);
    case CONSOLE_ONLY:
        return (sender instanceof ConsoleCommandSender || sender instanceof RemoteConsoleCommandSender);
    case BLOCK_ONLY:
        return (sender instanceof BlockCommandSender);
    case DEFAULT:
        return true;
    }
    return false;
}
项目:Bukkit-Instances    文件:AbstractCommand.java   
public List<String> execute(Instances instances, CommandSender sender, String[] args) {
    switch (SenderType.getSenderType(sender)) {
        case BLOCK:
            return execute(instances, (BlockCommandSender) sender, args);
        case CONSOLE:
            return execute(instances, (ConsoleCommandSender) sender, args);
        case PLAYER:
            return execute(instances, (Player) sender, args);
        case RCONSOLE:
            return execute(instances, (RemoteConsoleCommandSender) sender, args);
    }
    return null;
}
项目:BKgLib    文件:BKgCommand.java   
public boolean isValidSender(CommandSender sender) {
    switch (this) {
    case PLAYER_ONLY:
        return (sender instanceof Player);
    case NO_PLAYER:
        return (sender instanceof ConsoleCommandSender || sender instanceof RemoteConsoleCommandSender || sender instanceof BlockCommandSender);
    case CONSOLE_ONLY:
        return (sender instanceof ConsoleCommandSender || sender instanceof RemoteConsoleCommandSender);
    case BLOCK_ONLY:
        return (sender instanceof BlockCommandSender);
    case DEFAULT:
        return true;
    }
    return false;
}
项目:RoyalEconomy    文件:CommandBase.java   
private boolean iARemoteConsoleCommandSender(final RemoteConsoleCommandSender rccs, final String node) {
    return true;
}
项目:BetterRCon    文件:RconCommandPreprocessEvent.java   
public RconCommandPreprocessEvent(RemoteConsoleCommandSender sender, String message)
{
    mSender = sender;
    mMessage = message;
}
项目:BetterRCon    文件:RconCommandPreprocessEvent.java   
public RemoteConsoleCommandSender getSender()
{
    return mSender;
}
项目:Bukkit-Instances    文件:AbstractCommand.java   
public List<String> execute(Instances instances, RemoteConsoleCommandSender sender, String[] args) {
    return null;
}
项目:RoyalEconomy    文件:CommandBase.java   
/**
 * Returns if something has the specified permission node. That something can be one of the following:
 * <ul>
 * <li>Player</li>
 * <li>OfflinePlayer</li>
 * <li>CommandSender</li>
 * <li>RemoteConsoleCommandSender</li>
 * <li>BlockCommandSender</li>
 * </ul>
 * Anything else will throw an IllegalArgumentException.
 *
 * @param o    Thing to check for permissions
 * @param node Node to check for
 * @return true or false
 * @throws IllegalArgumentException If invalid type if passed for <code>o</code>.
 */
protected boolean isAuthorized(final Object o, final String node) {
    if (o instanceof RemoteConsoleCommandSender)
        return this.iARemoteConsoleCommandSender((RemoteConsoleCommandSender) o, node);
    else if (o instanceof Player) return this.iAPlayer((Player) o, node);
    else if (o instanceof OfflinePlayer) return this.iAOfflinePlayer((OfflinePlayer) o, node);
    else if (o instanceof BlockCommandSender) return this.iABlockCommandSender((BlockCommandSender) o, node);
    else if (o instanceof CommandSender) return this.iACommandSender((CommandSender) o, node);
    else throw new IllegalArgumentException("Object was not a valid authorizable!");
}