Examples of harvestBlock()


Examples of net.minecraft.block.Block.harvestBlock()

      if (!player.capabilities.isCreativeMode && blk != Blocks.bedrock) {
        int localMeta = world.getBlockMetadata(x, y, z);
                if(MiscHelper.breakBlockToAirWithCheck(world, x, y, z, player)) {
                    blk.onBlockDestroyedByPlayer(world, x, y, z, localMeta);

                    blk.harvestBlock(world, player, x, y, z, localMeta);
                    blk.onBlockHarvested(world, x, y, z, localMeta, player);
                }
      } else {
        world.setBlockToAir(x, y, z);
      }
View Full Code Here

Examples of net.minecraft.block.Block.harvestBlock()

    if (stack != null)
      stack.getItem().onBlockDestroyed(stack, worldObj, block, par1, par2, par3, player);

    var6 = removeBlock(par1, par2, par3);
    if (var6 && var8)
      block.harvestBlock(worldObj, player, par1, par2, par3, var5);

    return var6;
  }

  // Copied from ItemInWorldManager, seems to do the trick.
View Full Code Here

Examples of net.minecraft.block.Block.harvestBlock()

        if (blk.removedByPlayer(world, player, x, y, z))
          blk.onBlockDestroyedByPlayer(world, x, y, z, localMeta);

        damageItem(stack, 1, player, 80);
        if(!dispose || !ItemElementiumPick.isDisposable(blk))
          blk.harvestBlock(world, player, x, y, z, localMeta);
        blk.onBlockHarvested(world, x, y, z, localMeta, player);
      } else world.setBlockToAir(x, y, z);

      if(ConfigHandler.blockBreakParticles && ConfigHandler.blockBreakParticlesTool && !world.isRemote)
        world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(blk) + (meta << 12));
View Full Code Here

Examples of net.minecraft.block.Block.harvestBlock()

      return;
    }
    int bMeta = world.getBlockMetadata(x, y, z);

    if (block.canHarvestBlock(player, bMeta)) {
      block.harvestBlock(world, player, x, y, z, bMeta);
    }
    if (ServerHelper.isServerWorld(world) && block.equals(Blocks.vine)) {
      CoreUtils.dropItemStackIntoWorldWithVelocity(new ItemStack(Blocks.vine), world, x, y, z);
    }
    world.setBlockToAir(x, y, z);
View Full Code Here

Examples of net.minecraft.block.Block.harvestBlock()

      return;
    }
    int bMeta = world.getBlockMetadata(x, y, z);

    if (block.canHarvestBlock(player, bMeta)) {
      block.harvestBlock(world, player, x, y, z, bMeta);
    }
    world.setBlockToAir(x, y, z);
  }

  protected boolean isValidHarvestMaterial(ItemStack stack, World world, int x, int y, int z) {
View Full Code Here

Examples of net.minecraft.block.Block.harvestBlock()

                                {
                                    if (localBlock == bID && localMeta % 4 == meta % 4)
                                    {
                                        if (!player.capabilities.isCreativeMode)
                                        {
                                            localBlock.harvestBlock(world, player, x,y,z, localMeta);
                                            onBlockDestroyed(stack, world, localBlock, xPos, yPos, zPos, player);
                                        }

                                        world.setBlockToAir(xPos, yPos, zPos);
                                        if (!world.isRemote)
View Full Code Here

Examples of net.minecraft.block.Block.harvestBlock()

                                                localBlock.onBlockHarvested(world, xPos, yPos, zPos, localMeta, player);
                                                if (localBlock.removedByPlayer(world, player, xPos, yPos, zPos, true))
                                                {
                                                    localBlock.onBlockDestroyedByPlayer(world, xPos, yPos, zPos, localMeta);
                                                    localBlock.harvestBlock(world, player, xPos, yPos, zPos, localMeta);
                                                    // Workaround for dropping experience
                                                    if (!butter)
                                                        localBlock.dropXpOnBlockBreak(world, xPos, yPos, zPos, exp);
                                                }
View Full Code Here

Examples of net.minecraft.block.Block.harvestBlock()

                    thisPlayerMP.destroyCurrentEquippedItem();
                }
            }

            if(removeBlock(x, y, z)) {
                block.harvestBlock(theWorld, thisPlayerMP, x, y, z, l);
            }

            // Drop experience
            if(!isCreative() && flag && event != null) {
                block.dropXpOnBlockBreak(theWorld, x, y, z, event.getExpToDrop());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.