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


Java EnumFacing.WEST属性代码示例

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


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

示例1: getDirectionFacing

/**
 * Returns the ForgeDirection of the facing of the entity given.
 *
 * @param entity
 * @param includeUpAndDown false when UP/DOWN should not be included.
 * @return
 */
public static EnumFacing getDirectionFacing(EntityLivingBase entity, boolean includeUpAndDown) {
    double yaw = entity.rotationYaw;
    while (yaw < 0)
        yaw += 360;
    yaw = yaw % 360;
    if (includeUpAndDown) {
        if (entity.rotationPitch > 45) return EnumFacing.DOWN;
        else if (entity.rotationPitch < -45) return EnumFacing.UP;
    }
    if (yaw < 45) return EnumFacing.SOUTH;
    else if (yaw < 135) return EnumFacing.WEST;
    else if (yaw < 225) return EnumFacing.NORTH;
    else if (yaw < 315) return EnumFacing.EAST;

    else return EnumFacing.SOUTH;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:23,代码来源:PneumaticCraftUtils.java

示例2: notifyHook

private void notifyHook(World worldIn, BlockPos pos, IBlockState state)
{
    for (EnumFacing enumfacing : new EnumFacing[] {EnumFacing.SOUTH, EnumFacing.WEST})
    {
        for (int i = 1; i < 42; ++i)
        {
            BlockPos blockpos = pos.offset(enumfacing, i);
            IBlockState iblockstate = worldIn.getBlockState(blockpos);

            if (iblockstate.getBlock() == Blocks.TRIPWIRE_HOOK)
            {
                if (iblockstate.getValue(BlockTripWireHook.FACING) == enumfacing.getOpposite())
                {
                    Blocks.TRIPWIRE_HOOK.calculateState(worldIn, blockpos, iblockstate, false, true, i, state);
                }

                break;
            }

            if (iblockstate.getBlock() != Blocks.TRIPWIRE)
            {
                break;
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:BlockTripWire.java

示例3: shouldSideBeRendered

public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
    pos = pos.offset(side);
    EnumFacing.Axis enumfacing$axis = null;

    if (blockState.getBlock() == this)
    {
        enumfacing$axis = (EnumFacing.Axis)blockState.getValue(AXIS);

        if (enumfacing$axis == null)
        {
            return false;
        }

        if (enumfacing$axis == EnumFacing.Axis.Z && side != EnumFacing.EAST && side != EnumFacing.WEST)
        {
            return false;
        }

        if (enumfacing$axis == EnumFacing.Axis.X && side != EnumFacing.SOUTH && side != EnumFacing.NORTH)
        {
            return false;
        }
    }

    boolean flag = blockAccess.getBlockState(pos.west()).getBlock() == this && blockAccess.getBlockState(pos.west(2)).getBlock() != this;
    boolean flag1 = blockAccess.getBlockState(pos.east()).getBlock() == this && blockAccess.getBlockState(pos.east(2)).getBlock() != this;
    boolean flag2 = blockAccess.getBlockState(pos.north()).getBlock() == this && blockAccess.getBlockState(pos.north(2)).getBlock() != this;
    boolean flag3 = blockAccess.getBlockState(pos.south()).getBlock() == this && blockAccess.getBlockState(pos.south(2)).getBlock() != this;
    boolean flag4 = flag || flag1 || enumfacing$axis == EnumFacing.Axis.X;
    boolean flag5 = flag2 || flag3 || enumfacing$axis == EnumFacing.Axis.Z;
    return flag4 && side == EnumFacing.WEST ? true : (flag4 && side == EnumFacing.EAST ? true : (flag5 && side == EnumFacing.NORTH ? true : flag5 && side == EnumFacing.SOUTH));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:33,代码来源:BlockPortal.java

示例4: isConnectedTo

@Override
public boolean isConnectedTo(EnumFacing side) {
    switch (getRotation()) {
        case UP:
        case DOWN:
            return side == EnumFacing.UP || side == EnumFacing.DOWN;
        case NORTH:
        case SOUTH:
            return side == EnumFacing.NORTH || side == EnumFacing.SOUTH;
        case EAST:
        case WEST:
            return side == EnumFacing.EAST || side == EnumFacing.WEST;
    }
    return false;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:15,代码来源:TileEntityPressureChamberValve.java

示例5: buildComponent

public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
{
    int i = 1;
    EnumFacing enumfacing = this.getCoordBaseMode();

    if (enumfacing == EnumFacing.WEST || enumfacing == EnumFacing.NORTH)
    {
        i = 5;
    }

    this.getNextComponentX((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 0, i, rand.nextInt(8) > 0);
    this.getNextComponentZ((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 0, i, rand.nextInt(8) > 0);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:StructureNetherBridgePieces.java

示例6: setDefaultFacing

private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isRemote)
    {
        Block block = worldIn.getBlockState(pos.north()).getBlock();
        Block block1 = worldIn.getBlockState(pos.south()).getBlock();
        Block block2 = worldIn.getBlockState(pos.west()).getBlock();
        Block block3 = worldIn.getBlockState(pos.east()).getBlock();
        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);

        if (enumfacing == EnumFacing.NORTH && block.isFullBlock() && !block1.isFullBlock())
        {
            enumfacing = EnumFacing.SOUTH;
        }
        else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock() && !block.isFullBlock())
        {
            enumfacing = EnumFacing.NORTH;
        }
        else if (enumfacing == EnumFacing.WEST && block2.isFullBlock() && !block3.isFullBlock())
        {
            enumfacing = EnumFacing.EAST;
        }
        else if (enumfacing == EnumFacing.EAST && block3.isFullBlock() && !block2.isFullBlock())
        {
            enumfacing = EnumFacing.WEST;
        }

        worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:30,代码来源:BlockFurnace.java

示例7: setDefaultDirection

private void setDefaultDirection(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isRemote)
    {
        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
        boolean flag = worldIn.getBlockState(pos.north()).getBlock().isFullBlock();
        boolean flag1 = worldIn.getBlockState(pos.south()).getBlock().isFullBlock();

        if (enumfacing == EnumFacing.NORTH && flag && !flag1)
        {
            enumfacing = EnumFacing.SOUTH;
        }
        else if (enumfacing == EnumFacing.SOUTH && flag1 && !flag)
        {
            enumfacing = EnumFacing.NORTH;
        }
        else
        {
            boolean flag2 = worldIn.getBlockState(pos.west()).getBlock().isFullBlock();
            boolean flag3 = worldIn.getBlockState(pos.east()).getBlock().isFullBlock();

            if (enumfacing == EnumFacing.WEST && flag2 && !flag3)
            {
                enumfacing = EnumFacing.EAST;
            }
            else if (enumfacing == EnumFacing.EAST && flag3 && !flag2)
            {
                enumfacing = EnumFacing.WEST;
            }
        }

        worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing).withProperty(TRIGGERED, Boolean.valueOf(false)), 2);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:34,代码来源:BlockDispenser.java

示例8: Size

public Size(World worldIn, BlockPos p_i45694_2_, EnumFacing.Axis p_i45694_3_)
{
    this.world = worldIn;
    this.axis = p_i45694_3_;

    if (p_i45694_3_ == EnumFacing.Axis.X)
    {
        this.field_150863_d = EnumFacing.EAST;
        this.field_150866_c = EnumFacing.WEST;
    }
    else
    {
        this.field_150863_d = EnumFacing.NORTH;
        this.field_150866_c = EnumFacing.SOUTH;
    }

    for (BlockPos blockpos = p_i45694_2_; p_i45694_2_.getY() > blockpos.getY() - 21 && p_i45694_2_.getY() > 0 && this.func_150857_a(worldIn.getBlockState(p_i45694_2_.down()).getBlock()); p_i45694_2_ = p_i45694_2_.down())
    {
        ;
    }

    int i = this.func_180120_a(p_i45694_2_, this.field_150863_d) - 1;

    if (i >= 0)
    {
        this.field_150861_f = p_i45694_2_.offset(this.field_150863_d, i);
        this.field_150868_h = this.func_180120_a(this.field_150861_f, this.field_150866_c);

        if (this.field_150868_h < 2 || this.field_150868_h > 21)
        {
            this.field_150861_f = null;
            this.field_150868_h = 0;
        }
    }

    if (this.field_150861_f != null)
    {
        this.field_150862_g = this.func_150858_a();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:BlockPortal.java

示例9: setDefaultFacing

private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isRemote)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos.north());
        IBlockState iblockstate1 = worldIn.getBlockState(pos.south());
        IBlockState iblockstate2 = worldIn.getBlockState(pos.west());
        IBlockState iblockstate3 = worldIn.getBlockState(pos.east());
        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);

        if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock())
        {
            enumfacing = EnumFacing.SOUTH;
        }
        else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock())
        {
            enumfacing = EnumFacing.NORTH;
        }
        else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock())
        {
            enumfacing = EnumFacing.EAST;
        }
        else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock())
        {
            enumfacing = EnumFacing.WEST;
        }

        worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:BlockFurnace.java

示例10: setLightmap

private void setLightmap(EntityPainting painting, float p_77008_2_, float p_77008_3_)
{
    int i = MathHelper.floor_double(painting.posX);
    int j = MathHelper.floor_double(painting.posY + (double)(p_77008_3_ / 16.0F));
    int k = MathHelper.floor_double(painting.posZ);
    EnumFacing enumfacing = painting.facingDirection;

    if (enumfacing == EnumFacing.NORTH)
    {
        i = MathHelper.floor_double(painting.posX + (double)(p_77008_2_ / 16.0F));
    }

    if (enumfacing == EnumFacing.WEST)
    {
        k = MathHelper.floor_double(painting.posZ - (double)(p_77008_2_ / 16.0F));
    }

    if (enumfacing == EnumFacing.SOUTH)
    {
        i = MathHelper.floor_double(painting.posX - (double)(p_77008_2_ / 16.0F));
    }

    if (enumfacing == EnumFacing.EAST)
    {
        k = MathHelper.floor_double(painting.posZ + (double)(p_77008_2_ / 16.0F));
    }

    int l = this.renderManager.worldObj.getCombinedLight(new BlockPos(i, j, k), 0);
    int i1 = l % 65536;
    int j1 = l / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)i1, (float)j1);
    GlStateManager.color(1.0F, 1.0F, 1.0F);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:33,代码来源:RenderPainting.java

示例11: parseFace

public EnumFacing parseFace(String p_parseFace_1_)
{
    p_parseFace_1_ = p_parseFace_1_.toLowerCase();

    if (!p_parseFace_1_.equals("bottom") && !p_parseFace_1_.equals("down"))
    {
        if (!p_parseFace_1_.equals("top") && !p_parseFace_1_.equals("up"))
        {
            if (p_parseFace_1_.equals("north"))
            {
                return EnumFacing.NORTH;
            }
            else if (p_parseFace_1_.equals("south"))
            {
                return EnumFacing.SOUTH;
            }
            else if (p_parseFace_1_.equals("east"))
            {
                return EnumFacing.EAST;
            }
            else if (p_parseFace_1_.equals("west"))
            {
                return EnumFacing.WEST;
            }
            else
            {
                Config.warn("Unknown face: " + p_parseFace_1_);
                return null;
            }
        }
        else
        {
            return EnumFacing.UP;
        }
    }
    else
    {
        return EnumFacing.DOWN;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:40,代码来源:ConnectedParser.java

示例12: buildComponent

public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
{
    int i = 1;

    if (this.coordBaseMode == EnumFacing.WEST || this.coordBaseMode == EnumFacing.NORTH)
    {
        i = 5;
    }

    this.getNextComponentX((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 0, i, rand.nextInt(8) > 0);
    this.getNextComponentZ((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 0, i, rand.nextInt(8) > 0);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:StructureNetherBridgePieces.java

示例13: getStateFromMeta

/**
 * Convert the given metadata into a BlockState for this Block
 */
public IBlockState getStateFromMeta(int meta)
{
    EnumFacing enumfacing;

    switch (meta & 7)
    {
        case 0:
            enumfacing = EnumFacing.DOWN;
            break;

        case 1:
            enumfacing = EnumFacing.EAST;
            break;

        case 2:
            enumfacing = EnumFacing.WEST;
            break;

        case 3:
            enumfacing = EnumFacing.SOUTH;
            break;

        case 4:
            enumfacing = EnumFacing.NORTH;
            break;

        case 5:
        default:
            enumfacing = EnumFacing.UP;
    }

    return this.getDefaultState().withProperty(FACING, enumfacing).withProperty(POWERED, Boolean.valueOf((meta & 8) > 0));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:36,代码来源:BlockButton.java

示例14: func_180700_a

private void func_180700_a(EnumFacing p_180700_1_)
{
    if (this.isTerrainPopulated)
    {
        if (p_180700_1_ == EnumFacing.EAST)
        {
            for (int i = 0; i < 16; ++i)
            {
                this.func_150811_f(15, i);
            }
        }
        else if (p_180700_1_ == EnumFacing.WEST)
        {
            for (int j = 0; j < 16; ++j)
            {
                this.func_150811_f(0, j);
            }
        }
        else if (p_180700_1_ == EnumFacing.SOUTH)
        {
            for (int k = 0; k < 16; ++k)
            {
                this.func_150811_f(k, 15);
            }
        }
        else if (p_180700_1_ == EnumFacing.NORTH)
        {
            for (int l = 0; l < 16; ++l)
            {
                this.func_150811_f(l, 0);
            }
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:34,代码来源:Chunk.java

示例15: buildComponent

public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
{
    int i = 3;
    int j = 5;
    EnumFacing enumfacing = this.getCoordBaseMode();

    if (enumfacing == EnumFacing.WEST || enumfacing == EnumFacing.NORTH)
    {
        i = 8 - i;
        j = 8 - j;
    }

    this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 5, 1);

    if (this.leftLow)
    {
        this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, i, 1);
    }

    if (this.leftHigh)
    {
        this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, j, 7);
    }

    if (this.rightLow)
    {
        this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, i, 1);
    }

    if (this.rightHigh)
    {
        this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, j, 7);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:34,代码来源:StructureStrongholdPieces.java


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