當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。