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


Java CraftMinecartCommand类代码示例

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


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

示例1: getListener

import org.bukkit.craftbukkit.entity.CraftMinecartCommand; //导入依赖的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.craftbukkit.entity.CraftMinecartCommand; //导入依赖的package包/类
private static net.minecraft.command.ICommandSender getListener(CommandSender sender)
{
    if ( sender instanceof CraftPlayer )
    {
        return new PlayerListener( ( (CraftPlayer) sender ).getHandle() );
    }
    if ( sender instanceof CraftBlockCommandSender )
    {
        CraftBlockCommandSender commandBlock = (CraftBlockCommandSender) sender;
        Block block = commandBlock.getBlock();
        return ( (net.minecraft.tileentity.TileEntityCommandBlock) ( (CraftWorld) block.getWorld() ).getTileEntityAt( block.getX(), block.getY(), block.getZ() ) ).func_145993_a();
    }
    if ( sender instanceof CraftMinecartCommand )
    {
        return ( (net.minecraft.entity.EntityMinecartCommandBlock) ( (CraftMinecartCommand) sender ).getHandle() ).func_145822_e();
    }
    return new ConsoleListener(sender); // Assume console/rcon
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:19,代码来源:VanillaCommandWrapper.java

示例3: getListener

import org.bukkit.craftbukkit.entity.CraftMinecartCommand; //导入依赖的package包/类
private static net.minecraft.command.ICommandSender getListener(CommandSender sender)
{
    if ( sender.getClass().equals(CraftPlayer.class) )
    {
        return new PlayerListener( ( (CraftPlayer) sender ).getHandle() );
    }
    if ( sender.getClass().equals(CraftBlockCommandSender.class) )
    {
        CraftBlockCommandSender commandBlock = (CraftBlockCommandSender) sender;
        Block block = commandBlock.getBlock();
        return ( (net.minecraft.tileentity.TileEntityCommandBlock) ( (CraftWorld) block.getWorld() ).getTileEntityAt( block.getX(), block.getY(), block.getZ() ) ).func_145993_a();
    }
    if ( sender.getClass().equals(CraftMinecartCommand.class) )
    {
        return ( (net.minecraft.entity.EntityMinecartCommandBlock) ( (CraftMinecartCommand) sender ).getHandle() ).func_145822_e();
    }
    return new ConsoleListener(sender); // Assume console/rcon
}
 
开发者ID:Bogdan-G,项目名称:FFoKC,代码行数:19,代码来源:VanillaCommandWrapper.java

示例4: getListener

import org.bukkit.craftbukkit.entity.CraftMinecartCommand; //导入依赖的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

示例5: getListener

import org.bukkit.craftbukkit.entity.CraftMinecartCommand; //导入依赖的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

示例6: getListener

import org.bukkit.craftbukkit.entity.CraftMinecartCommand; //导入依赖的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


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