本文整理汇总了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;
}
示例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
}
示例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
}
示例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;
}
示例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");
}
示例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");
}