EwyBoy / BlockTweaker

Tweak blocks
1 stars 2 forks source link

Block harvest level setting has no effect #1

Open Vampsku11 opened 6 years ago

Vampsku11 commented 6 years ago

1.12.2-forge1.12.2-14.23.1.2555 BlockTweaker-1.0.0.jar

Vanilla block harvest level does not seem to affect harvest-ability of blocks. Default harvest level for all blocks in config is 0 (wood) but will allow harvesting with fist. Setting harvest level higher does not prevent harvesting with fist or another lower level tool. I have only tested with clay and "wood" (may want to rename to wood log for easier ctrl+f through config file).

Behavior I hoped to see would be for blocks to break slower, but drop no resources, if not mined with the tool level set in the config, similar to stone or coal ore.

tyra314 commented 6 years ago

May I answer for you.

Certain blocks, like clay and logs, can by default be harvested without tools, but they also define one tool class with which harvesting those blocks is faster. Let's call such a tool effective for harvesting the block. In your case shovels and axes, respectively. In order to achieve this behavior, the harvest tool and the harvest level of the block are set to the tool requirement for effective harvesting, in particular, the harvest level is not -1 to begin with. However, to represent that the block is still harvestable by hand, the block material is used. The material defines several attributes of the block. Amongst others, this class has a method called isToolNotRequired(), which returns a boolean value denoting whether you can or cannot harvest the block by hand. In summary, the block, those harvest level you try to change to 0, already is set to the harvest level 0. What you would have to change is the return value of the said method, which you can't.