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


Java EnumFacing.SOUTH属性代码示例

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


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

示例1: collisionRayTrace

/**
 * Ray traces through the blocks collision from start vector to end vector
 * returning a ray trace hit.
 */
public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) {
	EnumFacing enumfacing = (EnumFacing) worldIn.getBlockState(pos).getValue(FACING);
	float f = 0.15F;

	if (enumfacing == EnumFacing.EAST) {
		this.setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f);
	} else if (enumfacing == EnumFacing.WEST) {
		this.setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f);
	} else if (enumfacing == EnumFacing.SOUTH) {
		this.setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F);
	} else if (enumfacing == EnumFacing.NORTH) {
		this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F);
	} else {
		f = 0.1F;
		this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f);
	}

	return super.collisionRayTrace(worldIn, pos, start, end);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:23,代码来源:BlockTorch.java

示例2: setDefaultFacing

private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) {
    if (!worldIn.isRemote) {
        IBlockState northState = worldIn.getBlockState(pos.north());
        IBlockState southState = worldIn.getBlockState(pos.south());
        IBlockState westState = worldIn.getBlockState(pos.west());
        IBlockState eastState = worldIn.getBlockState(pos.east());
        EnumFacing enumfacing = state.getValue(FACING);

        if (enumfacing == EnumFacing.NORTH && northState.isFullBlock() && !southState.isFullBlock())
            enumfacing = EnumFacing.SOUTH;
        else if (enumfacing == EnumFacing.SOUTH && southState.isFullBlock() && !northState.isFullBlock())
            enumfacing = EnumFacing.NORTH;
        else if (enumfacing == EnumFacing.WEST && westState.isFullBlock() && !eastState.isFullBlock())
            enumfacing = EnumFacing.EAST;
        else if (enumfacing == EnumFacing.EAST && eastState.isFullBlock() && !westState.isFullBlock())
            enumfacing = EnumFacing.WEST;

        worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
    }
}
 
开发者ID:LasmGratel,项目名称:FoodCraft-Reloaded,代码行数:20,代码来源:BlockMachine.java

示例3: 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:F1r3w477,项目名称:CustomWorldGen,代码行数:26,代码来源:BlockTripWire.java

示例4: checkLightSide

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

示例5: Piece

protected Piece(int p_i45590_1_, EnumFacing p_i45590_2_, StructureOceanMonumentPieces.RoomDefinition p_i45590_3_, int p_i45590_4_, int p_i45590_5_, int p_i45590_6_)
{
    super(p_i45590_1_);
    this.setCoordBaseMode(p_i45590_2_);
    this.roomDefinition = p_i45590_3_;
    int i = p_i45590_3_.index;
    int j = i % 5;
    int k = i / 5 % 5;
    int l = i / 25;

    if (p_i45590_2_ != EnumFacing.NORTH && p_i45590_2_ != EnumFacing.SOUTH)
    {
        this.boundingBox = new StructureBoundingBox(0, 0, 0, p_i45590_6_ * 8 - 1, p_i45590_5_ * 4 - 1, p_i45590_4_ * 8 - 1);
    }
    else
    {
        this.boundingBox = new StructureBoundingBox(0, 0, 0, p_i45590_4_ * 8 - 1, p_i45590_5_ * 4 - 1, p_i45590_6_ * 8 - 1);
    }

    switch (p_i45590_2_)
    {
        case NORTH:
            this.boundingBox.offset(j * 8, l * 4, -(k + p_i45590_6_) * 8 + 1);
            break;
        case SOUTH:
            this.boundingBox.offset(j * 8, l * 4, k * 8);
            break;
        case WEST:
            this.boundingBox.offset(-(k + p_i45590_6_) * 8 + 1, l * 4, j * 8);
            break;
        default:
            this.boundingBox.offset(k * 8, l * 4, j * 8);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:34,代码来源:StructureOceanMonumentPieces.java

示例6: 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

示例7: Piece

protected Piece(int p_i45590_1_, EnumFacing p_i45590_2_, StructureOceanMonumentPieces.RoomDefinition p_i45590_3_, int p_i45590_4_, int p_i45590_5_, int p_i45590_6_)
{
    super(p_i45590_1_);
    this.setCoordBaseMode(p_i45590_2_);
    this.roomDefinition = p_i45590_3_;
    int i = p_i45590_3_.index;
    int j = i % 5;
    int k = i / 5 % 5;
    int l = i / 25;

    if (p_i45590_2_ != EnumFacing.NORTH && p_i45590_2_ != EnumFacing.SOUTH)
    {
        this.boundingBox = new StructureBoundingBox(0, 0, 0, p_i45590_6_ * 8 - 1, p_i45590_5_ * 4 - 1, p_i45590_4_ * 8 - 1);
    }
    else
    {
        this.boundingBox = new StructureBoundingBox(0, 0, 0, p_i45590_4_ * 8 - 1, p_i45590_5_ * 4 - 1, p_i45590_6_ * 8 - 1);
    }

    switch (p_i45590_2_)
    {
        case NORTH:
            this.boundingBox.offset(j * 8, l * 4, -(k + p_i45590_6_) * 8 + 1);
            break;

        case SOUTH:
            this.boundingBox.offset(j * 8, l * 4, k * 8);
            break;

        case WEST:
            this.boundingBox.offset(-(k + p_i45590_6_) * 8 + 1, l * 4, j * 8);
            break;

        default:
            this.boundingBox.offset(k * 8, l * 4, j * 8);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:37,代码来源:StructureOceanMonumentPieces.java

示例8: 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

示例9: Corridor

public Corridor(int p_i45581_1_, Random p_i45581_2_, StructureBoundingBox p_i45581_3_, EnumFacing p_i45581_4_)
{
    super(p_i45581_1_);
    this.setCoordBaseMode(p_i45581_4_);
    this.boundingBox = p_i45581_3_;
    this.steps = p_i45581_4_ != EnumFacing.NORTH && p_i45581_4_ != EnumFacing.SOUTH ? p_i45581_3_.getXSize() : p_i45581_3_.getZSize();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:7,代码来源:StructureStrongholdPieces.java

示例10: Corridor

public Corridor(int p_i45581_1_, Random p_i45581_2_, StructureBoundingBox p_i45581_3_, EnumFacing p_i45581_4_)
{
    super(p_i45581_1_);
    this.coordBaseMode = p_i45581_4_;
    this.boundingBox = p_i45581_3_;
    this.field_74993_a = p_i45581_4_ != EnumFacing.NORTH && p_i45581_4_ != EnumFacing.SOUTH ? p_i45581_3_.getXSize() : p_i45581_3_.getZSize();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:7,代码来源:StructureStrongholdPieces.java

示例11: collisionRayTrace

/**
 * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit.
 */
public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end)
{
    EnumFacing enumfacing = (EnumFacing)worldIn.getBlockState(pos).getValue(FACING);
    float f = 0.15F;

    if (enumfacing == EnumFacing.EAST)
    {
        this.setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f);
    }
    else if (enumfacing == EnumFacing.WEST)
    {
        this.setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f);
    }
    else if (enumfacing == EnumFacing.SOUTH)
    {
        this.setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F);
    }
    else if (enumfacing == EnumFacing.NORTH)
    {
        this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F);
    }
    else
    {
        f = 0.1F;
        this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f);
    }

    return super.collisionRayTrace(worldIn, pos, start, end);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:32,代码来源:BlockTorch.java

示例12: notifyNeighborsOfStateExcept

public void notifyNeighborsOfStateExcept(BlockPos pos, Block blockType, EnumFacing skipSide)
{
    if (skipSide != EnumFacing.WEST)
    {
        this.notifyBlockOfStateChange(pos.west(), blockType);
    }

    if (skipSide != EnumFacing.EAST)
    {
        this.notifyBlockOfStateChange(pos.east(), blockType);
    }

    if (skipSide != EnumFacing.DOWN)
    {
        this.notifyBlockOfStateChange(pos.down(), blockType);
    }

    if (skipSide != EnumFacing.UP)
    {
        this.notifyBlockOfStateChange(pos.up(), blockType);
    }

    if (skipSide != EnumFacing.NORTH)
    {
        this.notifyBlockOfStateChange(pos.north(), blockType);
    }

    if (skipSide != EnumFacing.SOUTH)
    {
        this.notifyBlockOfStateChange(pos.south(), blockType);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:32,代码来源:World.java

示例13: addBlockHitEffects

/**
 * Adds block hit particles for the specified block
 */
public void addBlockHitEffects(BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = this.worldObj.getBlockState(pos);

    if (iblockstate.getRenderType() != EnumBlockRenderType.INVISIBLE)
    {
        int i = pos.getX();
        int j = pos.getY();
        int k = pos.getZ();
        float f = 0.1F;
        AxisAlignedBB axisalignedbb = iblockstate.getBoundingBox(this.worldObj, pos);
        double d0 = (double)i + this.rand.nextDouble() * (axisalignedbb.maxX - axisalignedbb.minX - 0.20000000298023224D) + 0.10000000149011612D + axisalignedbb.minX;
        double d1 = (double)j + this.rand.nextDouble() * (axisalignedbb.maxY - axisalignedbb.minY - 0.20000000298023224D) + 0.10000000149011612D + axisalignedbb.minY;
        double d2 = (double)k + this.rand.nextDouble() * (axisalignedbb.maxZ - axisalignedbb.minZ - 0.20000000298023224D) + 0.10000000149011612D + axisalignedbb.minZ;

        if (side == EnumFacing.DOWN)
        {
            d1 = (double)j + axisalignedbb.minY - 0.10000000149011612D;
        }

        if (side == EnumFacing.UP)
        {
            d1 = (double)j + axisalignedbb.maxY + 0.10000000149011612D;
        }

        if (side == EnumFacing.NORTH)
        {
            d2 = (double)k + axisalignedbb.minZ - 0.10000000149011612D;
        }

        if (side == EnumFacing.SOUTH)
        {
            d2 = (double)k + axisalignedbb.maxZ + 0.10000000149011612D;
        }

        if (side == EnumFacing.WEST)
        {
            d0 = (double)i + axisalignedbb.minX - 0.10000000149011612D;
        }

        if (side == EnumFacing.EAST)
        {
            d0 = (double)i + axisalignedbb.maxX + 0.10000000149011612D;
        }

        this.addEffect((new ParticleDigging(this.worldObj, d0, d1, d2, 0.0D, 0.0D, 0.0D, iblockstate)).setBlockPos(pos).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:51,代码来源:ParticleManager.java

示例14: setBounds

public void setBounds(IBlockState state)
{
    if (state.getBlock() == this)
    {
        boolean flag = state.getValue(HALF) == BlockTrapDoor.DoorHalf.TOP;
        Boolean obool = (Boolean)state.getValue(OPEN);
        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
        float f = 0.1875F;

        if (flag)
        {
            this.setBlockBounds(0.0F, 0.8125F, 0.0F, 1.0F, 1.0F, 1.0F);
        }
        else
        {
            this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.1875F, 1.0F);
        }

        if (obool.booleanValue())
        {
            if (enumfacing == EnumFacing.NORTH)
            {
                this.setBlockBounds(0.0F, 0.0F, 0.8125F, 1.0F, 1.0F, 1.0F);
            }

            if (enumfacing == EnumFacing.SOUTH)
            {
                this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.1875F);
            }

            if (enumfacing == EnumFacing.WEST)
            {
                this.setBlockBounds(0.8125F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
            }

            if (enumfacing == EnumFacing.EAST)
            {
                this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.1875F, 1.0F, 1.0F);
            }
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:42,代码来源:BlockTrapDoor.java

示例15: addBlockHitEffects

/**
 * Adds block hit particles for the specified block
 */
public void addBlockHitEffects(BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = this.worldObj.getBlockState(pos);
    Block block = iblockstate.getBlock();

    if (block.getRenderType() != -1)
    {
        int i = pos.getX();
        int j = pos.getY();
        int k = pos.getZ();
        float f = 0.1F;
        double d0 = (double)i + this.rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinX();
        double d1 = (double)j + this.rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinY();
        double d2 = (double)k + this.rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinZ();

        if (side == EnumFacing.DOWN)
        {
            d1 = (double)j + block.getBlockBoundsMinY() - (double)f;
        }

        if (side == EnumFacing.UP)
        {
            d1 = (double)j + block.getBlockBoundsMaxY() + (double)f;
        }

        if (side == EnumFacing.NORTH)
        {
            d2 = (double)k + block.getBlockBoundsMinZ() - (double)f;
        }

        if (side == EnumFacing.SOUTH)
        {
            d2 = (double)k + block.getBlockBoundsMaxZ() + (double)f;
        }

        if (side == EnumFacing.WEST)
        {
            d0 = (double)i + block.getBlockBoundsMinX() - (double)f;
        }

        if (side == EnumFacing.EAST)
        {
            d0 = (double)i + block.getBlockBoundsMaxX() + (double)f;
        }

        this.addEffect((new EntityDiggingFX(this.worldObj, d0, d1, d2, 0.0D, 0.0D, 0.0D, iblockstate)).func_174846_a(pos).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:51,代码来源:EffectRenderer.java


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