Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Minecraft Forge
  • Support & Bug Reports
  • Bug: Nether Quarz Ore does not have toolType
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
DancZer

Bug: Nether Quarz Ore does not have toolType

By DancZer, December 29, 2020 in Support & Bug Reports

  • Reply to this topic
  • Start new topic

Recommended Posts

DancZer    0

DancZer

DancZer    0

  • Tree Puncher
  • DancZer
  • Members
  • 0
  • 2 posts
Posted December 29, 2020

Nether Quarz Ore Block state does not returns the tool type. it returns null.

 

spacer.png

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7697

diesieben07

diesieben07    7697

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7697
  • 56414 posts
Posted December 29, 2020

Unfortunately not all blocks specify a tool type, quartz is just one. Forge tries to assign tool types to vanilla blocks on a best-effort basis. However vanilla simply has a giant if-statement in PickaxeItem which checks for various blocks. However it also checks for materials, anything that has Material.ROCK (and some others) can be harvested using a pickaxe (see PickaxeItem#canHarvestBlock).

 

Feel free to submit a PR that patches getHarvestTool to check for the material by default as well.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

DancZer    0

DancZer

DancZer    0

  • Tree Puncher
  • DancZer
  • Members
  • 0
  • 2 posts
Posted January 25 (edited)

What would be the ideal way to check if I can break a a block by a pickaxe or a shovel? 

 

I rewrote the whole logic and now I use the Item.canHarvestBlock, but it doesn't work reliable neither. For dirt the shovel returns false. 😔

 

Here is my logic: Github code

 

Do you have any suggestion? 

 

Thank you in advance and I will let you know when the PR is ready. 

Edited January 25 by DancZer
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7697

diesieben07

diesieben07    7697

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7697
  • 56414 posts
Posted January 25

The only true way to know is to call BlockState#canHarvestBlock, which requires a player and will check the item the player is currently holding or other arbitrary things about the player (mods may have all kinds of arbitrary requirements for harvesting).

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • troublemaker_47
      Teleport player in same direction as where he looks

      By troublemaker_47 · Posted 4 minutes ago

      Could you rewrite the function please because i am fairly new and i really wanted to add this functionality to my mod
    • Extrupt
      Forge won't fully download

      By Extrupt · Posted 7 minutes ago

      i tried to download forge but every time i got the same message after a few seconds of downloading Failed to run processor: java.io.FileNotFoundException:C:\Users\mande\AppData\Roaming\.minecraft\libraries\de\oceanlabs\mcp\mcp_config\1.16.5-20210115.111550\mcp_config-1.16.5-20210115.111550-mappings.txt (Access is denied) See log for more details. i tried to look up what i could do but no one else had the problem. Could someone please help me with this. thanks-  
    • GenElectrovise
      When I try to run my mod after I just added Deferred Registries it crashes

      By GenElectrovise · Posted 9 minutes ago

      All of it. If you don't have a repo, please make one. Everything will be easier.
    • SwiftNinjaPro
      Bug report: files.minecraftforge.net ssl

      By SwiftNinjaPro · Posted 10 minutes ago

      If I go to files.minecraftforge.net the http request does not redirect to https. This can effect security. The non ssl request does not redirect to ssl. Just letting you know that http:// does not redirect to https:// on files.minecraftforge.net   Just figured you should know. Thanks.
    • ThisIsNotOriginal
      When I try to run my mod after I just added Deferred Registries it crashes

      By ThisIsNotOriginal · Posted 13 minutes ago

      all of it? as in my registries, my main file and is there anything else you need to see?
  • Topics

    • troublemaker_47
      6
      Teleport player in same direction as where he looks

      By troublemaker_47
      Started 1 hour ago

    • Extrupt
      0
      Forge won't fully download

      By Extrupt
      Started 7 minutes ago

    • ThisIsNotOriginal
      14
      When I try to run my mod after I just added Deferred Registries it crashes

      By ThisIsNotOriginal
      Started 15 hours ago

    • SwiftNinjaPro
      0
      Bug report: files.minecraftforge.net ssl

      By SwiftNinjaPro
      Started 10 minutes ago

    • Retsal
      6
      [1.16.x] Custom block as a shop

      By Retsal
      Started Yesterday at 06:04 AM

  • Who's Online (See full list)

    • GenElectrovise
    • 3.1459
    • diesieben07
    • Extrupt
    • ThisIsNotOriginal
    • J_F1Nl3Y_
    • arna
    • WindRunner7
    • troublemaker_47
    • CAS_ual_TY
    • Tessa
    • SwiftNinjaPro
    • thepumpkinbg
    • llllllll
    • brok4d
    • Spacerulerwill
    • Draco18s
    • <Gl33p_0r4nge>
  • All Activity
  • Home
  • Minecraft Forge
  • Support & Bug Reports
  • Bug: Nether Quarz Ore does not have toolType
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community