Jump to content

[1.10.2][1.11.2] ItemTool.onBlockDestroyed() different between versions...


Recommended Posts

Posted

In 1.10.2-12.18.3.2221:

    public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
    {
        if ((double)state.getBlockHardness(worldIn, pos) != 0.0D)
        {
            stack.damageItem(1, entityLiving);
        }

        return true;
    }

 

In 1.11.2-13.20.0.2223:

 

    public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
    {
        if (!worldIn.isRemote && (double)state.getBlockHardness(worldIn, pos) != 0.0D)
        {
            stack.damageItem(1, entityLiving);
        }

        return true;
    }

 

The 1.11.2 version has a check for isRemote.  In my sandbox I believe it is preventing the tool break sound from playing in the client.  Under this all the logic is using the "play sound" that excludes the player.  Am I missing something?

  • 2 months later...
Posted

You have most likely found the cause why in 1.11.2 tools dont make the braking sound and sawn the particles. I think there is maybe a usefull Thought behind that change but it seems like its only causing issues. Have you opend and issue or Pullrequest on forge to fix this ?

catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.