當前位置: 首頁>>代碼示例>>Java>>正文


Java BlockLog類代碼示例

本文整理匯總了Java中net.minecraft.block.BlockLog的典型用法代碼示例。如果您正苦於以下問題:Java BlockLog類的具體用法?Java BlockLog怎麽用?Java BlockLog使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BlockLog類屬於net.minecraft.block包,在下文中一共展示了BlockLog類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: update

import net.minecraft.block.BlockLog; //導入依賴的package包/類
@Override
public void update() {
	super.update();

	if (!worldObj.isRemote && boundedRect != null && worldObj.getTotalWorldTime() % 20L == 0) {
		if (currentCheckingVec == null)
			currentCheckingVec = new Vector3<Integer>(boundedRect.min.x.intValue(), pos.getY(), boundedRect.min.y.intValue());

		// ProjectZed.logHelper.info("boundedRect", boundedRect, "currentCheckingVec", currentCheckingVec, getCurrentFacing());

		final Block currentBlock = BlockUtils.getBlock(worldObj, currentCheckingVec).getBlock();
		final int currentMeta = BlockUtils.getBlockMetadata(worldObj, currentCheckingVec);

		if (currentBlock instanceof BlockLog || (currentBlock instanceof BlockCrops && currentMeta >= 7)) {
			// chopTree((BlockLog) currentBlock);
			chopTree();
			return;
		}

		incrementVector();
	}
}
 
開發者ID:hockeyhurd,項目名稱:Project-Zed,代碼行數:23,代碼來源:TileEntityIndustrialHarvester.java

示例2: getLogAxis

import net.minecraft.block.BlockLog; //導入依賴的package包/類
private BlockLog.EnumAxis getLogAxis(BlockPos p_175938_1_, BlockPos p_175938_2_)
{
    BlockLog.EnumAxis blocklog$enumaxis = BlockLog.EnumAxis.Y;
    int i = Math.abs(p_175938_2_.getX() - p_175938_1_.getX());
    int j = Math.abs(p_175938_2_.getZ() - p_175938_1_.getZ());
    int k = Math.max(i, j);

    if (k > 0)
    {
        if (i == k)
        {
            blocklog$enumaxis = BlockLog.EnumAxis.X;
        }
        else if (j == k)
        {
            blocklog$enumaxis = BlockLog.EnumAxis.Z;
        }
    }

    return blocklog$enumaxis;
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:22,代碼來源:BaseLargeTreeGenerator.java

示例3: getMetaFromState

import net.minecraft.block.BlockLog; //導入依賴的package包/類
/**
 * Convert the BlockState into the correct metadata value
 */
@SuppressWarnings("incomplete-switch")
public int getMetaFromState(IBlockState state)
{
    int i = 0;

    switch ((BlockLog.EnumAxis)state.getValue(LOG_AXIS))
    {
        case X:
            i |= 0;
            break;
        case Z:
            i |= 1;
            break;
        case NONE:
            i |= 2;
    }
    
    int j = state.getValue(GENERATED);
    i += j*3;

    return i;
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:26,代碼來源:SappyLog.java

示例4: getAmountPerTick

import net.minecraft.block.BlockLog; //導入依賴的package包/類
public int getAmountPerTick(World world, BlockPos pos,EnumFacing facing){
 int amtPerBlock = 2; //mb

 BlockPos start = pos.offset(facing);
 int totalAmount = 0 ;
 if(world.getBlockState(start) instanceof BlockLog){

  for(int k= -1;k<14;k++){
	  for(int i= -1;i<2;i++){
		  for(int j= -1;j<2;j++){
			  if(world.getBlockState(start.add(i, j, k)) instanceof BlockLog){
				  totalAmount += amtPerBlock;
			  }
		  }
	  }
  }
 }
 return totalAmount;
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:20,代碼來源:BlockTreeTap.java

示例5: getStateFromMeta

import net.minecraft.block.BlockLog; //導入依賴的package包/類
@Override
public IBlockState getStateFromMeta(int meta) {
	IBlockState iblockstate = this.getDefaultState();

	switch (meta) {
		case 0:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y);
			break;
		case 1:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.X);
			break;
		case 2:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z);
			break;
		default:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE);
	}

	return iblockstate;
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:21,代碼來源:BlockWoodLog.java

示例6: getAmountPerTick

import net.minecraft.block.BlockLog; //導入依賴的package包/類
public int getAmountPerTick(World world, BlockPos pos, EnumFacing facing) {
	int amtPerBlock = 2; //mb
	BlockPos start = pos.offset(facing);
	int totalAmount = 0;
	if (world.getBlockState(start) instanceof BlockLog) {
		for (int k = -1; k < 14; k++) {
			for (int i = -1; i < 2; i++) {
				for (int j = -1; j < 2; j++) {
					if (world.getBlockState(start.add(i, j, k)) instanceof BlockLog) {
						totalAmount += amtPerBlock;
					}
				}
			}
		}
	}
	return totalAmount;
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:18,代碼來源:BlockTreeTap.java

示例7: func_175938_b

import net.minecraft.block.BlockLog; //導入依賴的package包/類
private BlockLog.EnumAxis func_175938_b(BlockPos p_175938_1_, BlockPos p_175938_2_)
{
    BlockLog.EnumAxis blocklog$enumaxis = BlockLog.EnumAxis.Y;
    int i = Math.abs(p_175938_2_.getX() - p_175938_1_.getX());
    int j = Math.abs(p_175938_2_.getZ() - p_175938_1_.getZ());
    int k = Math.max(i, j);

    if (k > 0)
    {
        if (i == k)
        {
            blocklog$enumaxis = BlockLog.EnumAxis.X;
        }
        else if (j == k)
        {
            blocklog$enumaxis = BlockLog.EnumAxis.Z;
        }
    }

    return blocklog$enumaxis;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:22,代碼來源:WorldGenBigTree.java

示例8: generate

import net.minecraft.block.BlockLog; //導入依賴的package包/類
@Override
    public boolean generate(World world, Random rand, BlockPos pos) {
        int height = getTreeHeight(rand);
        int trunkHeight = height - variant.leavesHeightTotal;

//        if (!BlockVolumeShape.region(-1, 1, -1, 1, trunkHeight - 1, 1)
//                .and(-3, trunkHeight, -3, 3, height, 3)
//                .hasSpace(pos, isEmptySpace(world)))
//            return false;

        for (int i = 0; i < trunkHeight; i++) {
            setBlockInWorld(world, pos.up(i), LOG.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y));
        }

        generateTreeLeavesAndBranches(world, pos.add(0, trunkHeight, 0), pos, rand);

        return true;
    }
 
開發者ID:Boethie,項目名稱:Genesis,代碼行數:19,代碼來源:WorldGenTreeDryophyllum.java

示例9: generateBranch

import net.minecraft.block.BlockLog; //導入依賴的package包/類
private void generateBranch(World world, Random rand, BlockPos trunkPos, Vec3d endPos) {
    Vec3d curr = new Vec3d(trunkPos);
    Vec3d next = next(world, curr, endPos.subtract(curr).normalize(), endPos, trunkPos);
    BlockPos prev;
    do {
        BlockPos currBlock = new BlockPos(curr);
        Vec3d dir = endPos.subtract(curr).normalize();
        prev = currBlock;
        curr = next;
        next = next(world, curr, dir, endPos, trunkPos);

        IBlockState state = (xzEqual(currBlock, trunkPos) ? LOG : LOG.withProperty(BlockLog.LOG_AXIS, getLogAxis(world, currBlock, dir)));
        setBlockInWorld(world, currBlock, state);

        // check to avoid long straight up branches
        BlockPos nextBlock = new BlockPos(next);
        if (endPos.squareDistanceTo(next) > Math.sqrt(3) && xzEqual(prev, currBlock) && xzEqual(currBlock, nextBlock)) {
            next = next.addVector(rand.nextBoolean() ? -1 : 1, 0, rand.nextBoolean() ? -1 : 1);
        }
    } while (endPos.squareDistanceTo(curr) > Math.sqrt(3));

    generateLeaves(world, rand, curr);
    generateLeaves(world, rand, new Vec3d(prev));
}
 
開發者ID:Boethie,項目名稱:Genesis,代碼行數:25,代碼來源:WorldGenTreeDryophyllum.java

示例10: getStateFromMeta

import net.minecraft.block.BlockLog; //導入依賴的package包/類
@Override
public IBlockState getStateFromMeta(int meta) {
    IBlockState state = getDefaultState();
    switch (meta & LOG_NO_AXIS_FLAG) {
        case 0:
            state = state.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y);
            break;
        case LOG_X_AXIS_FLAG:
            state = state.withProperty(LOG_AXIS, BlockLog.EnumAxis.X);
            break;
        case LOG_Z_AXIS_FLAG:
            state = state.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z);
            break;
        default:
            state = state.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE);
    }
    return state;
}
 
開發者ID:Boethie,項目名稱:Genesis,代碼行數:19,代碼來源:BlockGenesisLog.java

示例11: getStateFromMeta

import net.minecraft.block.BlockLog; //導入依賴的package包/類
/**
 * Convert the given metadata into a BlockState for this Block
 */
@Override
public IBlockState getStateFromMeta(int meta)
{
    IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, WoodType.byMetadata((meta & 3) % 4));

    switch (meta & 12)
    {
        case 0:
            iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y);
            break;
        case 4:
            iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.X);
            break;
        case 8:
            iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z);
            break;
        default:
            iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE);
    }

    return iblockstate;
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:26,代碼來源:BlockCrystalLog.java

示例12: getStateFromMeta

import net.minecraft.block.BlockLog; //導入依賴的package包/類
@Override
@Nonnull
public IBlockState getStateFromMeta(int meta) {
	IBlockState iblockstate = this.getDefaultState();

	switch (meta & 12) {
		case 0:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y);
			break;
		case 4:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.X);
			break;
		case 8:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z);
			break;
		default:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE);
	}

	return iblockstate;
}
 
開發者ID:yolp900,項目名稱:ItsJustaCharm1.10.2Dead,代碼行數:22,代碼來源:ModBlockLog.java

示例13: getStateFromMeta

import net.minecraft.block.BlockLog; //導入依賴的package包/類
@Override
  public IBlockState getStateFromMeta(int meta)
  {
IBlockState iblockstate = this.getDefaultState().withProperty(wood_type, EnumLogType.getType(meta)).withProperty(double_drop, Boolean.valueOf((meta % 4) < 2));

      switch (meta & 12)
      {
          case 0:
              iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y);
              break;
          case 4:
              iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.X);
              break;
          case 8:
              iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z);
              break;
          default:
              iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE);
      }

return iblockstate;
  }
 
開發者ID:Modding-Legacy,項目名稱:Aether-Legacy,代碼行數:23,代碼來源:BlockAetherLog.java

示例14: getStateFromMeta

import net.minecraft.block.BlockLog; //導入依賴的package包/類
@Override
public IBlockState getStateFromMeta(int meta) {
    
    IBlockState state = this.getDefaultState();
    
    switch (meta & 12) {
        
        case 0:
            return state.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y);
        case 4:
            return state.withProperty(LOG_AXIS, BlockLog.EnumAxis.X);
        case 8:
            return state.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z);
        default: 
            return state.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE);  
    }
}
 
開發者ID:JayAvery,項目名稱:geomastery,代碼行數:18,代碼來源:BlockWood.java

示例15: Trunk

import net.minecraft.block.BlockLog; //導入依賴的package包/類
@SuppressWarnings("incomplete-switch")
public Trunk(World world, BlockPos pos, EnumFacing direction,
        IBlockState blockState, int treeHeight) {
    
    super(world, pos, direction, blockState, treeHeight);
    
    switch (this.direction) {
        
        case NORTH :
        case SOUTH :
            this.blockState = this.blockState
                    .withProperty(BlockLog.LOG_AXIS, EnumAxis.Z);
            break;
        case EAST :
        case WEST :
            this.blockState = this.blockState
                    .withProperty(BlockLog.LOG_AXIS, EnumAxis.X);
    }
}
 
開發者ID:JayAvery,項目名稱:geomastery,代碼行數:20,代碼來源:FallingTreeBlock.java


注:本文中的net.minecraft.block.BlockLog類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。