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


Java EnumFacing.NORTH属性代码示例

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


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

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

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

示例3: getFacing

private static EnumFacing getFacing(int p_getFacing_0_)
{
    switch (p_getFacing_0_)
    {
        case 0:
            return EnumFacing.DOWN;

        case 1:
            return EnumFacing.UP;

        case 2:
            return EnumFacing.NORTH;

        case 3:
            return EnumFacing.SOUTH;

        case 4:
            return EnumFacing.WEST;

        case 5:
            return EnumFacing.EAST;

        default:
            return EnumFacing.UP;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:26,代码来源:ConnectedTextures.java

示例4: getTarget

public BlockData getTarget(BlockPos pos) {
    EnumFacing[] orderedFacingValues = new EnumFacing[] {
            EnumFacing.UP,
            EnumFacing.EAST,
            EnumFacing.NORTH,
            EnumFacing.WEST,
            EnumFacing.SOUTH,
            EnumFacing.DOWN
    };

    for (EnumFacing facing : orderedFacingValues) {
        BlockPos alteredPos = pos.add(facing.getOpposite().getDirectionVec());

        if (!mc.theWorld.getBlockState(alteredPos).getBlock().isReplaceable(mc.theWorld, alteredPos) && !(mc.theWorld.getBlockState(alteredPos).getBlock() instanceof BlockLiquid) && !(mc.theWorld.getBlockState(alteredPos).getBlock() instanceof BlockAir)) {
            return new BlockData(alteredPos, facing);
        }
    }

    return null;
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:20,代码来源:Scaffold.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: getStateFromMeta

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

    if (enumfacing.getAxis() == EnumFacing.Axis.Y)
    {
        enumfacing = EnumFacing.NORTH;
    }

    return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:14,代码来源:BlockWallSign.java

示例7: buildComponent

public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
{
    if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST)
    {
        this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
    }
    else
    {
        this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:11,代码来源:StructureStrongholdPieces.java

示例8: 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:SkidJava,项目名称:BaseClient,代码行数:34,代码来源:BlockDispenser.java

示例9: getStateFromMeta

@Override
public IBlockState getStateFromMeta(int meta)
{
	EnumFacing enumfacing = EnumFacing.getHorizontal(meta & 3); //untill third bit ? so facing only

	if (enumfacing.getAxis() == EnumFacing.Axis.Y)
	{
		enumfacing = EnumFacing.NORTH;
	}

	return this.getDefaultState().withProperty(FACING, enumfacing).withProperty(FULL, (meta & 4) > 0); //facing + (saved data after facing = &4
}
 
开发者ID:ArtixAllMighty,项目名称:ExSartagine,代码行数:12,代码来源:BlockSmelter.java

示例10: 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:SkidJava,项目名称:BaseClient,代码行数:40,代码来源:BlockPortal.java

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

示例12: getStateFromMeta

/**
 * Convert the given metadata into a BlockState for this Block
 */
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
  if(meta >= EnumFacing.HORIZONTALS.length) {
    meta = 1;
  }
  EnumFacing face = EnumFacing.values()[meta>>1];
  if(face == EnumFacing.DOWN || face == EnumFacing.UP) {
    face = EnumFacing.NORTH;
  }

  return this.getDefaultState().withProperty(FACING, face);
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:Got-Wood,代码行数:16,代码来源:BlockTreeTap.java

示例13: setBoundBasedOnMeta

private void setBoundBasedOnMeta(int combinedMeta)
{
    float f = 0.1875F;
    this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
    EnumFacing enumfacing = getFacing(combinedMeta);
    boolean flag = isOpen(combinedMeta);
    boolean flag1 = isHingeLeft(combinedMeta);

    if (flag)
    {
        if (enumfacing == EnumFacing.EAST)
        {
            if (!flag1)
            {
                this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
            }
            else
            {
                this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
            }
        }
        else if (enumfacing == EnumFacing.SOUTH)
        {
            if (!flag1)
            {
                this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
            }
            else
            {
                this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
            }
        }
        else if (enumfacing == EnumFacing.WEST)
        {
            if (!flag1)
            {
                this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
            }
            else
            {
                this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
            }
        }
        else if (enumfacing == EnumFacing.NORTH)
        {
            if (!flag1)
            {
                this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
            }
            else
            {
                this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
            }
        }
    }
    else if (enumfacing == EnumFacing.EAST)
    {
        this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
    }
    else if (enumfacing == EnumFacing.SOUTH)
    {
        this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
    }
    else if (enumfacing == EnumFacing.WEST)
    {
        this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    }
    else if (enumfacing == EnumFacing.NORTH)
    {
        this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:72,代码来源:BlockDoor.java

示例14: 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:SkidJava,项目名称:BaseClient,代码行数:51,代码来源:EffectRenderer.java

示例15: getFacingFromVertexData

public static EnumFacing getFacingFromVertexData(int[] faceData)
{
    Vector3f vector3f = new Vector3f(Float.intBitsToFloat(faceData[0]), Float.intBitsToFloat(faceData[1]), Float.intBitsToFloat(faceData[2]));
    Vector3f vector3f1 = new Vector3f(Float.intBitsToFloat(faceData[7]), Float.intBitsToFloat(faceData[8]), Float.intBitsToFloat(faceData[9]));
    Vector3f vector3f2 = new Vector3f(Float.intBitsToFloat(faceData[14]), Float.intBitsToFloat(faceData[15]), Float.intBitsToFloat(faceData[16]));
    Vector3f vector3f3 = new Vector3f();
    Vector3f vector3f4 = new Vector3f();
    Vector3f vector3f5 = new Vector3f();
    Vector3f.sub(vector3f, vector3f1, vector3f3);
    Vector3f.sub(vector3f2, vector3f1, vector3f4);
    Vector3f.cross(vector3f4, vector3f3, vector3f5);
    float f = (float)Math.sqrt((double)(vector3f5.x * vector3f5.x + vector3f5.y * vector3f5.y + vector3f5.z * vector3f5.z));
    vector3f5.x /= f;
    vector3f5.y /= f;
    vector3f5.z /= f;
    EnumFacing enumfacing = null;
    float f1 = 0.0F;

    for (EnumFacing enumfacing1 : EnumFacing.values())
    {
        Vec3i vec3i = enumfacing1.getDirectionVec();
        Vector3f vector3f6 = new Vector3f((float)vec3i.getX(), (float)vec3i.getY(), (float)vec3i.getZ());
        float f2 = Vector3f.dot(vector3f5, vector3f6);

        if (f2 >= 0.0F && f2 > f1)
        {
            f1 = f2;
            enumfacing = enumfacing1;
        }
    }

    if (f1 < 0.719F)
    {
        if (enumfacing != EnumFacing.EAST && enumfacing != EnumFacing.WEST && enumfacing != EnumFacing.NORTH && enumfacing != EnumFacing.SOUTH)
        {
            enumfacing = EnumFacing.UP;
        }
        else
        {
            enumfacing = EnumFacing.NORTH;
        }
    }

    return enumfacing == null ? EnumFacing.UP : enumfacing;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:45,代码来源:FaceBakery.java


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