Examples of onBlockHarvested()


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

        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.onBlockHarvested()

  private boolean removeBlock(int par1, int par2, int par3) {
    Block var4 = worldObj.getBlock(par1, par2, par3);
    int var5 = worldObj.getBlockMetadata(par1, par2, par3);

    if (var4 != null)
      var4.onBlockHarvested(worldObj, par1, par2, par3, var5, player);

    boolean var6 = var4 != null && var4.removedByPlayer(worldObj, player, par1, par2, par3);

    if (var4 != null && var6)
      var4.onBlockDestroyedByPlayer(worldObj, par1, par2, par3, var5);
View Full Code Here

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

          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.onBlockHarvested()

                                            {

                                                // Workaround for dropping experience
                                                int exp = localBlock.getExpDrop(world, localMeta, fortune);

                                                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
View Full Code Here

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

     * Removes a block and triggers the appropriate events
     */
    private boolean removeBlock(int par1, int par2, int par3){
        Block block = theWorld.getBlock(par1, par2, par3);
        int l = theWorld.getBlockMetadata(par1, par2, par3);
        block.onBlockHarvested(theWorld, par1, par2, par3, l, thisPlayerMP);
        boolean flag = block != null && block.removedByPlayer(theWorld, thisPlayerMP, par1, par2, par3);

        if(flag) {
            block.onBlockDestroyedByPlayer(theWorld, par1, par2, par3, l);
        }
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.