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


Java Direction.rotateOpposite方法代码示例

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


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

示例1: func_150174_f

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public static boolean func_150174_f(IBlockAccess p_150174_0_, int p_150174_1_, int p_150174_2_, int p_150174_3_, int p_150174_4_)
{
    Block var5 = p_150174_0_.getBlock(p_150174_1_, p_150174_2_, p_150174_3_);

    if (var5 == Blocks.redstone_wire)
    {
        return true;
    }
    else if (!Blocks.unpowered_repeater.func_149907_e(var5))
    {
        return var5.canProvidePower() && p_150174_4_ != -1;
    }
    else
    {
        int var6 = p_150174_0_.getBlockMetadata(p_150174_1_, p_150174_2_, p_150174_3_);
        return p_150174_4_ == (var6 & 3) || p_150174_4_ == Direction.rotateOpposite[var6 & 3];
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:19,代码来源:BlockRedstoneWire.java

示例2: func_150139_a

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public static boolean func_150139_a(IBlockAccess p_150139_0_, int p_150139_1_, int p_150139_2_, int p_150139_3_, int p_150139_4_, int p_150139_5_)
{
    int var6 = p_150139_1_ + Direction.offsetX[p_150139_5_];
    int var8 = p_150139_3_ + Direction.offsetZ[p_150139_5_];
    Block var9 = p_150139_0_.getBlock(var6, p_150139_2_, var8);
    boolean var10 = (p_150139_4_ & 2) == 2;
    int var11;

    if (var9 == Blocks.tripwire_hook)
    {
        var11 = p_150139_0_.getBlockMetadata(var6, p_150139_2_, var8);
        int var13 = var11 & 3;
        return var13 == Direction.rotateOpposite[p_150139_5_];
    }
    else if (var9 == Blocks.tripwire)
    {
        var11 = p_150139_0_.getBlockMetadata(var6, p_150139_2_, var8);
        boolean var12 = (var11 & 2) == 2;
        return var10 == var12;
    }
    else
    {
        return false;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:26,代码来源:BlockTripWire.java

示例3: isPowerProviderOrWire

import net.minecraft.util.Direction; //导入方法依赖的package包/类
/**
 * Returns true if redstone wire can connect to the specified block. Params: World, X, Y, Z, side (not a normal
 * notch-side, this can be 0, 1, 2, 3 or -1)
 */
public static boolean isPowerProviderOrWire(IBlockAccess p_150174_0_, int p_150174_1_, int p_150174_2_, int p_150174_3_, int p_150174_4_)
{
    Block block = p_150174_0_.getBlock(p_150174_1_, p_150174_2_, p_150174_3_);

    if (block == Blocks.redstone_wire)
    {
        return true;
    }
    else if (!Blocks.unpowered_repeater.func_149907_e(block))
    {
        return block.canConnectRedstone(p_150174_0_, p_150174_1_, p_150174_2_, p_150174_3_, p_150174_4_);
    }
    else
    {
        int i1 = p_150174_0_.getBlockMetadata(p_150174_1_, p_150174_2_, p_150174_3_);
        return p_150174_4_ == (i1 & 3) || p_150174_4_ == Direction.rotateOpposite[i1 & 3];
    }
}
 
开发者ID:static7s,项目名称:RTM,代码行数:23,代码来源:BlockRedstoneWireBlockWIP.java

示例4: isPowerProviderOrWire

import net.minecraft.util.Direction; //导入方法依赖的package包/类
/**
 * Returns true if redstone wire can connect to the specified block. Params: World, X, Y, Z, side (not a normal
 * notch-side, this can be 0, 1, 2, 3 or -1)
 */
public static boolean isPowerProviderOrWire(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
	Block block = par1IBlockAccess.getBlock(par2, par3, par4);

    if (block == Blocks.redstone_wire)
    {
        return true;
    }
    else if (!Blocks.unpowered_repeater.func_149907_e(block))
    {
        return block.canConnectRedstone(par1IBlockAccess, par2, par3, par4, par5);
    }
    else
    {
        int i1 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
        return par5 == (i1 & 3) || par5 == Direction.rotateOpposite[i1 & 3];
    }
}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:23,代码来源:BlockEMPedWire.java

示例5: isBlockStateValid

import net.minecraft.util.Direction; //导入方法依赖的package包/类
private boolean isBlockStateValid (World world, int x, int y, int z) {
    int meta = world.getBlockMetadata(x, y, z);
    int mask = meta;

    if (meta > 0) {
        for (int i = 0; i <= 3; i++) {
            int bit = 1 << i;
            int opSide = Direction.directionToFacing[Direction.rotateOpposite[i]];
            if ((meta & bit) != 0 && !canPlaceOnBlock(world, x + Direction.offsetX[i], y, z + Direction.offsetZ[i], opSide)
                && (world.getBlock(x, y + 1, z) != this || (world.getBlockMetadata(x, y + 1, z) & bit) == 0))
                mask &= ~bit;
        }
    }

    if (mask == 0)
        return false;

    if (mask != meta)
        world.setBlockMetadataWithNotify(x, y, z, mask, 2);

    return true;
}
 
开发者ID:jaquadro,项目名称:GardenCollection,代码行数:23,代码来源:BlockIvy.java

示例6: isPowerProviderOrWire

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public static boolean isPowerProviderOrWire(IBlockAccess p_150174_0_, int p_150174_1_, int p_150174_2_, int p_150174_3_, int p_150174_4_)
{
    Block block = p_150174_0_.getBlock(p_150174_1_, p_150174_2_, p_150174_3_);

    if (block == Blocks.redstone_wire)
    {
        return true;
    }
    else if (!Blocks.unpowered_repeater.func_149907_e(block))
    {
        return block.canConnectRedstone(p_150174_0_, p_150174_1_, p_150174_2_, p_150174_3_, p_150174_4_);
    }
    else
    {
        int i1 = p_150174_0_.getBlockMetadata(p_150174_1_, p_150174_2_, p_150174_3_);
        return p_150174_4_ == (i1 & 3) || p_150174_4_ == Direction.rotateOpposite[i1 & 3];
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:19,代码来源:BlockRedstoneWire.java

示例7: func_150139_a

import net.minecraft.util.Direction; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static boolean func_150139_a(IBlockAccess p_150139_0_, int p_150139_1_, int p_150139_2_, int p_150139_3_, int p_150139_4_, int p_150139_5_)
{
    int j1 = p_150139_1_ + Direction.offsetX[p_150139_5_];
    int k1 = p_150139_3_ + Direction.offsetZ[p_150139_5_];
    Block block = p_150139_0_.getBlock(j1, p_150139_2_, k1);
    boolean flag = (p_150139_4_ & 2) == 2;
    int l1;

    if (block == Blocks.tripwire_hook)
    {
        l1 = p_150139_0_.getBlockMetadata(j1, p_150139_2_, k1);
        int i2 = l1 & 3;
        return i2 == Direction.rotateOpposite[p_150139_5_];
    }
    else if (block == Blocks.tripwire)
    {
        l1 = p_150139_0_.getBlockMetadata(j1, p_150139_2_, k1);
        boolean flag1 = (l1 & 2) == 2;
        return flag == flag1;
    }
    else
    {
        return false;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:27,代码来源:BlockTripWire.java

示例8: isPowerProviderOrWire

import net.minecraft.util.Direction; //导入方法依赖的package包/类
/**
 * Returns true if redstone wire can connect to the specified block. Params: World, X, Y, Z, side (not a normal
 * notch-side, this can be 0, 1, 2, 3 or -1)
 */
public static boolean isPowerProviderOrWire(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4)
{
    int i1 = par0IBlockAccess.getBlockId(par1, par2, par3);

    if (i1 == Block.redstoneWire.blockID)
    {
        return true;
    }
    else if (i1 == 0)
    {
        return false;
    }
    else if (!Block.redstoneRepeaterIdle.func_94487_f(i1))
    {
        return (Block.blocksList[i1] != null && Block.blocksList[i1].canConnectRedstone(par0IBlockAccess, par1, par2, par3, par4));
    }
    else
    {
        int j1 = par0IBlockAccess.getBlockMetadata(par1, par2, par3);
        return par4 == (j1 & 3) || par4 == Direction.rotateOpposite[j1 & 3];
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:27,代码来源:BlockRedstoneWire.java

示例9: func_72148_a

import net.minecraft.util.Direction; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static boolean func_72148_a(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4, int par5)
{
    int j1 = par1 + Direction.offsetX[par5];
    int k1 = par3 + Direction.offsetZ[par5];
    int l1 = par0IBlockAccess.getBlockId(j1, par2, k1);
    boolean flag = (par4 & 2) == 2;
    int i2;

    if (l1 == Block.tripWireSource.blockID)
    {
        i2 = par0IBlockAccess.getBlockMetadata(j1, par2, k1);
        int j2 = i2 & 3;
        return j2 == Direction.rotateOpposite[par5];
    }
    else if (l1 == Block.tripWire.blockID)
    {
        i2 = par0IBlockAccess.getBlockMetadata(j1, par2, k1);
        boolean flag1 = (i2 & 2) == 2;
        return flag == flag1;
    }
    else
    {
        return false;
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:27,代码来源:BlockTripWire.java

示例10: func_72148_a

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public static boolean func_72148_a(IBlockAccess world, int x, int y, int z, int l, int i) {
	int j1 = x + Direction.offsetX[i];
       int k1 = z + Direction.offsetZ[i];
       Block l1 = world.getBlock(j1, y, k1);
       boolean flag = (l & 2) == 2;
       
       int i2;

       if (l1 == BlockLaserBeamSource.instance)
       {
       	i2 = world.getBlockMetadata(j1, y, k1);
           int j2 = i2 & 3;
           return j2 == Direction.rotateOpposite[i];
           //return true;
       }
       else if (l1 == BlockLaserBeam.instance)
       {
           i2 = world.getBlockMetadata(j1, y, k1);
           boolean flag1 = (i2 & 2) == 2;
           return flag == flag1;
       }
       else
       {
           return false;
       }
}
 
开发者ID:Draco18s,项目名称:Artifacts,代码行数:27,代码来源:BlockLaserBeam.java

示例11: canConnectRedstone

import net.minecraft.util.Direction; //导入方法依赖的package包/类
@Override
public boolean canConnectRedstone( IBlockAccess world, int x, int y, int z, int side )
{
    int metadata = world.getBlockMetadata( x, y, z );
    int direction = Direction.rotateOpposite[ getDirection( metadata ) ];
    return ( side == direction );
}
 
开发者ID:TeacherGaming,项目名称:qcraft-mod,代码行数:8,代码来源:BlockQuantumLogic.java

示例12: func_150138_a

import net.minecraft.util.Direction; //导入方法依赖的package包/类
private void func_150138_a(World p_150138_1_, int p_150138_2_, int p_150138_3_, int p_150138_4_, int p_150138_5_)
{
    int var6 = 0;

    while (var6 < 2)
    {
        int var7 = 1;

        while (true)
        {
            if (var7 < 42)
            {
                int var8 = p_150138_2_ + Direction.offsetX[var6] * var7;
                int var9 = p_150138_4_ + Direction.offsetZ[var6] * var7;
                Block var10 = p_150138_1_.getBlock(var8, p_150138_3_, var9);

                if (var10 == Blocks.tripwire_hook)
                {
                    int var11 = p_150138_1_.getBlockMetadata(var8, p_150138_3_, var9) & 3;

                    if (var11 == Direction.rotateOpposite[var6])
                    {
                        Blocks.tripwire_hook.func_150136_a(p_150138_1_, var8, p_150138_3_, var9, false, p_150138_1_.getBlockMetadata(var8, p_150138_3_, var9), true, var7, p_150138_5_);
                    }
                }
                else if (var10 == Blocks.tripwire)
                {
                    ++var7;
                    continue;
                }
            }

            ++var6;
            break;
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:38,代码来源:BlockTripWire.java

示例13: onBlockPlaced

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
{
    if (p_149660_5_ == 1 || p_149660_5_ == 0)
    {
        p_149660_5_ = 2;
    }

    return Direction.rotateOpposite[Direction.facingToDirection[p_149660_5_]];
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:10,代码来源:BlockCocoa.java

示例14: func_150138_a

import net.minecraft.util.Direction; //导入方法依赖的package包/类
private void func_150138_a(World p_150138_1_, int p_150138_2_, int p_150138_3_, int p_150138_4_, int p_150138_5_)
{
    int i1 = 0;

    while (i1 < 2)
    {
        int j1 = 1;

        while (true)
        {
            if (j1 < 42)
            {
                int k1 = p_150138_2_ + Direction.offsetX[i1] * j1;
                int l1 = p_150138_4_ + Direction.offsetZ[i1] * j1;
                Block block = p_150138_1_.getBlock(k1, p_150138_3_, l1);

                if (block == Blocks.tripwire_hook)
                {
                    int i2 = p_150138_1_.getBlockMetadata(k1, p_150138_3_, l1) & 3;

                    if (i2 == Direction.rotateOpposite[i1])
                    {
                        Blocks.tripwire_hook.func_150136_a(p_150138_1_, k1, p_150138_3_, l1, false, p_150138_1_.getBlockMetadata(k1, p_150138_3_, l1), true, j1, p_150138_5_);
                    }
                }
                else if (block == Blocks.tripwire)
                {
                    ++j1;
                    continue;
                }
            }

            ++i1;
            break;
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:38,代码来源:BlockTripWire.java

示例15: func_72149_e

import net.minecraft.util.Direction; //导入方法依赖的package包/类
private void func_72149_e(World par1World, int par2, int par3, int par4, int par5)
{
    int i1 = 0;

    while (i1 < 2)
    {
        int j1 = 1;

        while (true)
        {
            if (j1 < 42)
            {
                int k1 = par2 + Direction.offsetX[i1] * j1;
                int l1 = par4 + Direction.offsetZ[i1] * j1;
                int i2 = par1World.getBlockId(k1, par3, l1);

                if (i2 == Block.tripWireSource.blockID)
                {
                    int j2 = par1World.getBlockMetadata(k1, par3, l1) & 3;

                    if (j2 == Direction.rotateOpposite[i1])
                    {
                        Block.tripWireSource.func_72143_a(par1World, k1, par3, l1, i2, par1World.getBlockMetadata(k1, par3, l1), true, j1, par5);
                    }
                }
                else if (i2 == Block.tripWire.blockID)
                {
                    ++j1;
                    continue;
                }
            }

            ++i1;
            break;
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:38,代码来源:BlockTripWire.java


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