本文整理汇总了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;
}
示例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;
}
示例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");
}
示例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);
}
}
示例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;
}
示例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;
}
}
示例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");
}
示例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));
}
示例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");
}
}
示例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;
}
示例11: start
import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
@Override
public synchronized void start() {
if (sender instanceof RemoteConsoleCommandSender) {
run();
} else {
super.start();
}
}
示例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;
}
示例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;
}
示例14: iARemoteConsoleCommandSender
import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
private boolean iARemoteConsoleCommandSender(final RemoteConsoleCommandSender rccs, final String node) {
return true;
}
示例15: RconCommandPreprocessEvent
import org.bukkit.command.RemoteConsoleCommandSender; //导入依赖的package包/类
public RconCommandPreprocessEvent(RemoteConsoleCommandSender sender, String message)
{
mSender = sender;
mMessage = message;
}