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


Java BlockDirectional.getDirection方法代码示例

本文整理汇总了Java中net.minecraft.block.BlockDirectional.getDirection方法的典型用法代码示例。如果您正苦于以下问题:Java BlockDirectional.getDirection方法的具体用法?Java BlockDirectional.getDirection怎么用?Java BlockDirectional.getDirection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.block.BlockDirectional的用法示例。


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

示例1: getBedDirection

import net.minecraft.block.BlockDirectional; //导入方法依赖的package包/类
@Override
public int getBedDirection(IBlockAccess world, int x, int y, int z)
{
    TileEntity tileEntity = world.getTileEntity(x, y, z);
    if (tileEntity instanceof TileEntityMulti)
    {
        BlockVec3 mainBlockPosition = ((TileEntityMulti) tileEntity).mainBlockPosition;

     if (mainBlockPosition != null)
     {
         return mainBlockPosition.getBlock(world).getBedDirection(world, mainBlockPosition.x, mainBlockPosition.y, mainBlockPosition.z);
     }
    }

    return BlockDirectional.getDirection(world.getBlockMetadata(x, y, z));
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:17,代码来源:BlockMulti.java

示例2: getBedDirection

import net.minecraft.block.BlockDirectional; //导入方法依赖的package包/类
@Override
public int getBedDirection(IBlockAccess world, int x, int y, int z)
{
    TileEntity tileEntity = world.getTileEntity(x, y, z);
    BlockVec3 mainBlockPosition = ((TileEntityTelepadFake) tileEntity).mainBlockPosition;

    if (mainBlockPosition != null)
    {
        return mainBlockPosition.getBlock(world).getBedDirection(world, mainBlockPosition.x, mainBlockPosition.y, mainBlockPosition.z);
    }

    return BlockDirectional.getDirection(world.getBlockMetadata(x, y, z));
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:BlockTelepadFake.java

示例3: renderWorldBlock

import net.minecraft.block.BlockDirectional; //导入方法依赖的package包/类
@Override
public boolean renderWorldBlock( IBlockAccess world, int i, int j, int k, Block block, int modelID, RenderBlocks renderblocks )
{
    if( modelID == QCraft.Blocks.quantumLogic.blockRenderID )
    {
        int metadata = world.getBlockMetadata( i, j, k );
        int direction = BlockDirectional.getDirection( metadata );
        int subType = ( (BlockQuantumLogic) block ).getSubType( metadata );

        // Draw Base
        switch( direction )
        {
            case 0:
                renderblocks.uvRotateTop = 0;
                break;
            case 1:
                renderblocks.uvRotateTop = 1;
                break;
            case 2:
                renderblocks.uvRotateTop = 3;
                break;
            case 3:
                renderblocks.uvRotateTop = 2;
                break;
        }
        renderblocks.setRenderBoundsFromBlock( block );
        renderblocks.renderStandardBlock( block, i, j, k );
        renderblocks.uvRotateTop = 0;

        return true;
    }
    return false;
}
 
开发者ID:TeacherGaming,项目名称:qcraft-mod,代码行数:34,代码来源:QCraftProxyClient.java

示例4: func_149977_a

import net.minecraft.block.BlockDirectional; //导入方法依赖的package包/类
public static ChunkCoordinates func_149977_a(World world, int x, int y, int z, int whatever)
{
    int meta = world.getBlockMetadata(x, y, z);
    int dir = BlockDirectional.getDirection(meta);

    for (int k1 = 0; k1 <= 1; ++k1)
    {
        int l1 = x - footBlockToHeadBlockMap[dir][0] * k1 - 1;
        int i2 = z - footBlockToHeadBlockMap[dir][1] * k1 - 1;
        int j2 = l1 + 2;
        int k2 = i2 + 2;

        for (int l2 = l1; l2 <= j2; ++l2)
        {
            for (int i3 = i2; i3 <= k2; ++i3)
            {
                if (World.doesBlockHaveSolidTopSurface(world, l2, y - 1, i3) && !world.getBlock(l2, y, i3).getMaterial().isOpaque() && !world.getBlock(l2, y + 1, i3).getMaterial().isOpaque())
                {
                    if (whatever <= 0)
                    {
                        return new ChunkCoordinates(l2, y, i3);
                    }

                    --whatever;
                }
            }
        }
    }

    return null;
}
 
开发者ID:Darkona,项目名称:AdventureBackpack2,代码行数:32,代码来源:BlockSleepingBag.java

示例5: getNearestEmptyChunkCoordinates

import net.minecraft.block.BlockDirectional; //导入方法依赖的package包/类
/**
 * Gets the nearest empty chunk coordinates for the player to wake up from a bed into.
 */
public static ChunkCoordinates getNearestEmptyChunkCoordinates(World par0World, int par1, int par2, int par3, int par4)
{
    int i1 = par0World.getBlockMetadata(par1, par2, par3);
    int j1 = BlockDirectional.getDirection(i1);

    for (int k1 = 0; k1 <= 1; ++k1)
    {
        int l1 = par1 - footBlockToHeadBlockMap[j1][0] * k1 - 1;
        int i2 = par3 - footBlockToHeadBlockMap[j1][1] * k1 - 1;
        int j2 = l1 + 2;
        int k2 = i2 + 2;

        for (int l2 = l1; l2 <= j2; ++l2)
        {
            for (int i3 = i2; i3 <= k2; ++i3)
            {
                if (par0World.doesBlockHaveSolidTopSurface(l2, par2 - 1, i3) && par0World.isAirBlock(l2, par2, i3) && par0World.isAirBlock(l2, par2 + 1, i3))
                {
                    if (par4 <= 0)
                    {
                        return new ChunkCoordinates(l2, par2, i3);
                    }

                    --par4;
                }
            }
        }
    }

    return null;
}
 
开发者ID:Stormister,项目名称:Rediscovered-Mod-1.6.4,代码行数:35,代码来源:BlockDreamBed.java

示例6: canBlockStay

import net.minecraft.block.BlockDirectional; //导入方法依赖的package包/类
/**
 * Can this block stay at this position. Similar to canPlaceBlockAt except
 * gets checked often with plants.
 */
@Override
public boolean canBlockStay(World par1World, int par2, int par3, int par4) {
	final int l = BlockDirectional.getDirection(par1World.getBlockMetadata(par2, par3, par4));
	par2 += Direction.offsetX[l];
	par4 += Direction.offsetZ[l];
	final Block i1 = par1World.getBlock(par2, par3, par4);
	return i1 == NyxBlocks.infestLog;
}
 
开发者ID:TheDaemoness,项目名称:IceAndShadow2,代码行数:13,代码来源:NyxBlockSilkBerryPod.java


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