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


Java EnumFacing.EAST属性代码示例

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


在下文中一共展示了EnumFacing.EAST属性的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: addComponentParts

public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
    if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
    {
        return false;
    }
    else
    {
        this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 4, true, randomIn, StructureStrongholdPieces.STRONGHOLD_STONES);
        this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.entryDoor, 1, 1, 0);
        EnumFacing enumfacing = this.getCoordBaseMode();

        if (enumfacing != EnumFacing.NORTH && enumfacing != EnumFacing.EAST)
        {
            this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 3, 3, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false);
        }
        else
        {
            this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 4, 3, 3, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false);
        }

        return true;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:24,代码来源:StructureStrongholdPieces.java

示例3: addComponentParts

public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
    if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
    {
        return false;
    }
    else
    {
        this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 4, true, randomIn, StructureStrongholdPieces.strongholdStones);
        this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0);

        if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST)
        {
            this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 3, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
        }
        else
        {
            this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 4, 3, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
        }

        return true;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:23,代码来源:StructureStrongholdPieces.java

示例4: addComponentParts

public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
    if (this.field_143015_k < 0)
    {
        this.field_143015_k = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn);

        if (this.field_143015_k < 0)
        {
            return true;
        }

        this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0);
    }

    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 2, 3, 1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 0, 0, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 1, 0, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 2, 0, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.wool.getStateFromMeta(EnumDyeColor.WHITE.getDyeDamage()), 1, 3, 0, structureBoundingBoxIn);
    boolean flag = this.coordBaseMode == EnumFacing.EAST || this.coordBaseMode == EnumFacing.NORTH;
    this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), flag ? 2 : 0, 3, 0, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode), 1, 3, 1, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), flag ? 0 : 2, 3, 0, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 1, 3, -1, structureBoundingBoxIn);
    return true;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:26,代码来源:StructureVillagePieces.java

示例5: addComponentParts

/**
 * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes
 * Mineshafts at the end, it adds Fences...
 */
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
    if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
    {
        return false;
    }
    else
    {
        this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 4, true, randomIn, StructureStrongholdPieces.STRONGHOLD_STONES);
        this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.entryDoor, 1, 1, 0);
        EnumFacing enumfacing = this.getCoordBaseMode();

        if (enumfacing != EnumFacing.NORTH && enumfacing != EnumFacing.EAST)
        {
            this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 4, 3, 3, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false);
        }
        else
        {
            this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 3, 3, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false);
        }

        return true;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:StructureStrongholdPieces.java

示例6: renderParticle

public void renderParticle(BufferBuilder buffer, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
  {
//super.renderParticle(buffer, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
//System.out.println("rot: "+rotationX+" "+rotationZ+" "+rotationYZ+" "+rotationXY+" "+rotationXZ);
EnumFacing face=this.block.sideHit;
if(face == EnumFacing.UP)
	super.renderParticle(buffer, entityIn, partialTicks, 1, 0, 0, 0, 1);
else if(face == EnumFacing.DOWN)
	super.renderParticle(buffer, entityIn, partialTicks, 1, 0, 0, 0, -1);
else if(face == EnumFacing.NORTH)
	super.renderParticle(buffer, entityIn, partialTicks, 1, 1, 0, 0, 0);
else if(face == EnumFacing.SOUTH)
	super.renderParticle(buffer, entityIn, partialTicks, -1, 1, 0, 0, 0);
else if(face == EnumFacing.EAST)
	super.renderParticle(buffer, entityIn, partialTicks, 0, 1, 1, 0, 0);
else if(face == EnumFacing.WEST)
	super.renderParticle(buffer, entityIn, partialTicks, 0, 1, -1, 0, 0);
  }
 
开发者ID:rafradek,项目名称:Mods,代码行数:18,代码来源:ParticleBulletHole.java

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

示例8: getFacing

protected static EnumFacing getFacing(int meta)
{
    switch (meta & 3)
    {
        case 0:
            return EnumFacing.NORTH;

        case 1:
            return EnumFacing.SOUTH;

        case 2:
            return EnumFacing.WEST;

        case 3:
        default:
            return EnumFacing.EAST;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:BlockTrapDoor.java

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

示例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: 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()).isFullBlock();
        boolean flag1 = worldIn.getBlockState(pos.south()).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()).isFullBlock();
            boolean flag3 = worldIn.getBlockState(pos.east()).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:sudofox,项目名称:Backmemed,代码行数:34,代码来源:BlockDispenser.java

示例12: buildComponent

/**
 * Initiates construction of the Structure Component picked, at the current Location of StructGen
 */
public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
{
    EnumFacing enumfacing = this.getCoordBaseMode();

    if (enumfacing != EnumFacing.NORTH && enumfacing != EnumFacing.EAST)
    {
        this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
    }
    else
    {
        this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:StructureStrongholdPieces.java

示例13: getBoundingBox

@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
	if (state.getValue(FACING) == EnumFacing.NORTH || state.getValue(FACING) == EnumFacing.SOUTH) {
		return new AxisAlignedBB(0, 0, (5F / 16F), 1, 1, (11F / 16F));
	} else if (state.getValue(FACING) == EnumFacing.EAST || state.getValue(FACING) == EnumFacing.WEST) {
		return new AxisAlignedBB((5F / 16F), 0, 0, (11F / 16F), 1, 1);
	} else {
		return FULL_BLOCK_AABB;
	}
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:10,代码来源:BlockShelf.java

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

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


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