当前位置: 首页>>代码示例>>Java>>正文


Java RemoteConsoleCommandSender类代码示例

本文整理汇总了Java中org.bukkit.command.RemoteConsoleCommandSender的典型用法代码示例。如果您正苦于以下问题:Java RemoteConsoleCommandSender类的具体用法?Java RemoteConsoleCommandSender怎么用?Java RemoteConsoleCommandSender使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RemoteConsoleCommandSender类属于org.bukkit.command包,在下文中一共展示了RemoteConsoleCommandSender类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getListener

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
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;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:19,代码来源:VanillaCommandWrapper.java

示例2: getListener

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
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;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:19,代码来源:VanillaCommandWrapper.java

示例3: getListener

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
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");
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:22,代码来源:VanillaCommandWrapper.java

示例4: toNMSIComandSender

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
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);
	}
}
 
开发者ID:yushijinhun,项目名称:AdvancedCommands,代码行数:21,代码来源:ReflectionHelper.java

示例5: localeForCommandSender

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
@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;
}
 
开发者ID:Eluinhost,项目名称:pluginframework,代码行数:18,代码来源:BukkitLocaleProvider.java

示例6: parseSender

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
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;
	}
}
 
开发者ID:jiangzhonghui,项目名称:multicraft-api,代码行数:20,代码来源:MCCommand.java

示例7: getListener

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
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");
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:22,代码来源:VanillaCommandWrapper.java

示例8: sendMessage

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
@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));
}
 
开发者ID:lucko,项目名称:LuckPerms,代码行数:12,代码来源:BukkitSenderFactory.java

示例9: doExecute

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
@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");
	}
}
 
开发者ID:yushijinhun,项目名称:AdvancedCommands,代码行数:31,代码来源:CommandVarTable.java

示例10: onCommand

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
@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;
}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:12,代码来源:BukkitCommand.java

示例11: start

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
@Override
public synchronized void start() {
    if (sender instanceof RemoteConsoleCommandSender) {
        run();
    } else {
        super.start();
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:9,代码来源:TimingsCommand.java

示例12: isValidSender

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
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;
}
 
开发者ID:goncalomb,项目名称:NBTEditor,代码行数:16,代码来源:MyCommand.java

示例13: execute

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
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;
}
 
开发者ID:cybertiger,项目名称:Bukkit-Instances,代码行数:14,代码来源:AbstractCommand.java

示例14: iARemoteConsoleCommandSender

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
private boolean iARemoteConsoleCommandSender(final RemoteConsoleCommandSender rccs, final String node) {
    return true;
}
 
开发者ID:RoyalDev,项目名称:RoyalEconomy,代码行数:4,代码来源:CommandBase.java

示例15: RconCommandPreprocessEvent

import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
public RconCommandPreprocessEvent(RemoteConsoleCommandSender sender, String message)
{
	mSender = sender;
	mMessage = message;
}
 
开发者ID:Schmoller,项目名称:BetterRCon,代码行数:6,代码来源:RconCommandPreprocessEvent.java


注:本文中的org.bukkit.command.RemoteConsoleCommandSender类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。