Java 类net.minecraft.block.BlockLog 实例源码

项目:Project-Zed    文件:TileEntityIndustrialHarvester.java   
@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();
    }
}
项目:harshencastle    文件:BaseLargeTreeGenerator.java   
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;
}
项目:Got-Wood    文件:SappyLog.java   
/**
 * 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;
}
项目:Got-Wood    文件:BlockTreeTap.java   
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;
}
项目:Got-Wood    文件:BlockWoodLog.java   
@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;
}
项目:Got-Wood    文件:BlockTreeTap.java   
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;
}
项目:DecompiledMinecraft    文件:WorldGenBigTree.java   
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;
}
项目:DecompiledMinecraft    文件:WorldGenBigTree.java   
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;
}
项目:BaseClient    文件:WorldGenBigTree.java   
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;
}
项目:BaseClient    文件:WorldGenBigTree.java   
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;
}
项目:Genesis    文件:WorldGenTreeDryophyllum.java   
@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;
    }
项目:Genesis    文件:WorldGenTreeDryophyllum.java   
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));
}
项目:Genesis    文件:BlockGenesisLog.java   
@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;
}
项目:Backmemed    文件:WorldGenBigTree.java   
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;
}
项目:CustomWorldGen    文件:WorldGenBigTree.java   
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;
}
项目:BetterWithAddons    文件:WorldGenBigTrees.java   
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;
}
项目:CrystalMod    文件:BlockCrystalLog.java   
/**
 * 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;
}
项目:ItsJustaCharm1.10.2Dead    文件:ModBlockLog.java   
@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;
}
项目:Aether-Legacy    文件:BlockAetherLog.java   
@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;
  }
项目:geomastery    文件:BlockWood.java   
@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);  
    }
}
项目:geomastery    文件:FallingTreeBlock.java   
@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);
    }
}
项目:geomastery    文件:TreeFallUtils.java   
/** Checks and fells tree starting at given position. */
public static void checkTreeFall(World world, BlockPos pos) {

    boolean logFall = world.isAirBlock(pos.down());

    for (BlockPos offset : TreeFallUtils.TRUNK_OFFSETS) {

        if (world.getBlockState(pos.subtract(offset)).getBlock()
                instanceof BlockLog) {

            logFall = false;
            break;
        }
    }

    if (logFall) {

        fellTree(world, pos);
    }
}
项目:LightningCraft    文件:BlockLogLC.java   
@Override
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;
}
项目:NordMod    文件:BlockAbstractLog.java   
@Override
public int getMetaFromState(IBlockState state) {
    byte b0 = 0;
    int i = b0 | ((IMetadataEnum) state.getValue(getVariant())).getMetadata();

    switch (SwitchEnumAxis.AXIS_LOOKUP[((net.minecraft.block.BlockLog.EnumAxis) state.getValue(LOG_AXIS)).ordinal()]) {
        case 1:
            i |= 4;
            break;
        case 2:
            i |= 8;
            break;
        case 3:
            i |= 12;
    }

    return i;
}
项目:Minestrappolation-4    文件:MBlockLog.java   
@Override
public IBlockState getStateFromMeta(int meta)
{
    IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, MWoodType.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;
}
项目:HeavyMeddle    文件:HeavyMeddleMod.java   
public static boolean onBlockDestroyedHook(boolean result, ItemStack stack, World world, IBlockState state, BlockPos pos, EntityLivingBase entity)
{
    if (stack.hasTagCompound()) {
        NBTTagCompound tag = stack.getTagCompound();
        if (!tag.hasKey("isHeavyAxe", 1) && !HeavyMeddleMod.allAxesHeavy) return result;
    }
    else if (!HeavyMeddleMod.allAxesHeavy) return result;   

    if (entity.isSneaking()) return result;

    Block block = state.getBlock();
    if (block instanceof BlockLog && entity instanceof EntityPlayer) {
        HashSet<BlockPos> tree = new HashSet<BlockPos>();
        boolean hasLeaves = addNeighbors(block, world, pos, pos, (EntityPlayer)entity, tree);
        if (hasLeaves || ignoreLeaves) {
            for (BlockPos currentPos : tree) {
                if (!destroyBlock(block, world, currentPos, (EntityPlayer)entity))
                    break;
            }
        }
    }

    return result;
}
项目:Rediscovered-Mod-1.8    文件:BlockCherryLog.java   
/**
 * Convert the given metadata into a BlockState for this Block
 */
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;
}
项目:Rediscovered-Mod-1.8    文件:BlockCherryLog.java   
/**
 * Convert the BlockState into the correct metadata value
 */
public int getMetaFromState(IBlockState state)
{
    byte b0 = 0;
    int i = b0;

    switch (BlockCherryLog.SwitchEnumAxis.AXIS_LOOKUP[((BlockLog.EnumAxis)state.getValue(LOG_AXIS)).ordinal()])
    {
        case 1:
            i |= 4;
            break;
        case 2:
            i |= 8;
            break;
        case 3:
            i |= 12;
    }

    return i;
}
项目:Rediscovered-Mod-1.8.8    文件:BlockCherryLog.java   
/**
 * Convert the given metadata into a BlockState for this Block
 */
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;
}
项目:Rediscovered-Mod-1.8.8    文件:BlockCherryLog.java   
/**
 * Convert the BlockState into the correct metadata value
 */
public int getMetaFromState(IBlockState state)
{
    byte b0 = 0;
    int i = b0;

    switch (BlockCherryLog.SwitchEnumAxis.AXIS_LOOKUP[((BlockLog.EnumAxis)state.getValue(LOG_AXIS)).ordinal()])
    {
        case 1:
            i |= 4;
            break;
        case 2:
            i |= 8;
            break;
        case 3:
            i |= 12;
    }

    return i;
}
项目:MobTotems    文件:TotemicFocus.java   
@Nonnull
@Override
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand enumHand, EnumFacing side, float hitX, float hitY, float hitZ) {
    if (!world.isRemote) {
        Block targetBlock = BlockUtils.getBlock(world, pos);
        if (targetBlock != null
                && targetBlock instanceof BlockLog) {
            world.destroyBlock(pos, false);
            Block blockToPlace = ModBlocks.TOTEM_WOOD;
            if (blockToPlace != null) {
                world.setBlockState(pos, blockToPlace.getDefaultState());
                return EnumActionResult.SUCCESS;
            }
        }
    }
    return EnumActionResult.FAIL;
}
项目:AbyssalCraft    文件:BlockACLog.java   
@Override
public IBlockState getStateFromMeta(int meta)
{
    IBlockState iblockstate = 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;
}
项目:mcplus_mods    文件:BlockSaw.java   
@Override
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    if (worldIn.isRemote) return;

    BlockPos outpos = pos.offset(getFacing(this.getMetaFromState(state)));
    IBlockState outblock = worldIn.getBlockState(outpos);

    worldIn.playAuxSFX(2001, outpos, Block.getIdFromBlock(state.getBlock()));
    if (outblock.getBlock() instanceof BlockLog)
    {
        this.breakWood(worldIn, outpos, outblock, rand);
    }
    else if (outblock.getBlock().getMaterial() == Material.wood)
    {
        worldIn.setBlockToAir(outpos);
        this.dropBlockAsItem(worldIn, outpos, outblock, 0);
    }
}
项目:SecurityCraft    文件:BlockReinforcedNewLog.java   
/**
 * Convert the given metadata into a BlockState for this Block
 */
@Override
public IBlockState getStateFromMeta(int meta)
{
    IBlockState iblockstate = getDefaultState().withProperty(VARIANT, BlockPlanks.EnumType.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;
}
项目:SecurityCraft    文件:BlockReinforcedNewLog.java   
/**
 * Convert the BlockState into the correct metadata value
 */
@Override
public int getMetaFromState(IBlockState state)
{
    byte b0 = 0;
    int i = b0 | ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4;

    switch (BlockReinforcedNewLog.SwitchEnumAxis.AXIS_LOOKUP[((BlockLog.EnumAxis)state.getValue(LOG_AXIS)).ordinal()])
    {
        case 1:
            i |= 4;
            break;
        case 2:
            i |= 8;
            break;
        case 3:
            i |= 12;
    }

    return i;
}
项目:SecurityCraft    文件:BlockReinforcedOldLog.java   
/**
 * Convert the given metadata into a BlockState for this Block
 */
@Override
public IBlockState getStateFromMeta(int meta)
{
    IBlockState iblockstate = getDefaultState().withProperty(VARIANT, BlockPlanks.EnumType.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;
}
项目:SecurityCraft    文件:BlockReinforcedOldLog.java   
/**
 * Convert the BlockState into the correct metadata value
 */
@Override
public int getMetaFromState(IBlockState state)
{
    byte b0 = 0;
    int i = b0 | ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata();

    switch (BlockReinforcedOldLog.SwitchEnumAxis.AXIS_LOOKUP[((BlockLog.EnumAxis)state.getValue(LOG_AXIS)).ordinal()])
    {
        case 1:
            i |= 4;
            break;
        case 2:
            i |= 8;
            break;
        case 3:
            i |= 12;
    }

    return i;
}
项目:SecurityCraft    文件:BlockReinforcedNewLog.java   
/**
 * Convert the given metadata into a BlockState for this Block
 */
@Override
public IBlockState getStateFromMeta(int meta)
{
    IBlockState iblockstate = getDefaultState().withProperty(VARIANT, BlockPlanks.EnumType.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;
}
项目:SecurityCraft    文件:BlockReinforcedNewLog.java   
/**
 * Convert the BlockState into the correct metadata value
 */
@Override
public int getMetaFromState(IBlockState state)
{
    byte b0 = 0;
    int i = b0 | ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4;

    switch (BlockReinforcedNewLog.SwitchEnumAxis.AXIS_LOOKUP[((BlockLog.EnumAxis)state.getValue(LOG_AXIS)).ordinal()])
    {
        case 1:
            i |= 4;
            break;
        case 2:
            i |= 8;
            break;
        case 3:
            i |= 12;
    }

    return i;
}
项目:SecurityCraft    文件:BlockReinforcedOldLog.java   
/**
 * Convert the given metadata into a BlockState for this Block
 */
@Override
public IBlockState getStateFromMeta(int meta)
{
    IBlockState iblockstate = getDefaultState().withProperty(VARIANT, BlockPlanks.EnumType.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;
}