Breaking Nodes with Tool's Last Use #3931

Open
opened 2023-09-11 17:05:38 +02:00 by Dehydrate6684 · 5 comments
Contributor

MineClone2 version:0.84.0

What happened?

When breaking nodes with a tool's last use, it is broken as if it is broken using bare hands.

Examples

  1. Breaking stone with the 60th use of a wooden pickaxe drops nothing.
  2. Breaking grass block with the 60th use of wooden shovel with silk touch drops dirt.
  3. Breaking bookshelf with the 60th use of wooden axe with silk touch drops 3 books.

What should happen:

  1. Breaking stone with the 60th use of a wooden pickaxe drops cobblestone.
  2. Breaking grass block with the 60th use of wooden shovel with silk touch drops grass block.
  3. Breaking bookshelf with the 60th use of wooden axe with silk touch drops bookshelf.

Steps to reproduce

Breaking nodes when a tool only have 1 use left.

<!-- Thanks for taking the time to fill out this bug report! Please follow our contributing guidelines first: https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CONTRIBUTING.md#rules-about-both-bugs-and-feature-requests By submitting this issue, you agree to follow our Code of Conduct: https://git.minetest.land/MineClone2/MineClone2/src/branch/master/CODE_OF_CONDUCT.md --> <!-- What version of MineClone2 are you using? We do not provide support for outdated versions of MineClone2. Current latest version is listed here, at the top: https://git.minetest.land/MineClone2/MineClone2/tags --> MineClone2 version:0.84.0 ### What happened? When breaking nodes with a tool's last use, it is broken as if it is broken using bare hands. Examples 1. Breaking stone with the 60th use of a wooden pickaxe drops nothing. 2. Breaking grass block with the 60th use of wooden shovel with silk touch drops dirt. 3. Breaking bookshelf with the 60th use of wooden axe with silk touch drops 3 books. ### What should happen: 1. Breaking stone with the 60th use of a wooden pickaxe drops cobblestone. 2. Breaking grass block with the 60th use of wooden shovel with silk touch drops grass block. 3. Breaking bookshelf with the 60th use of wooden axe with silk touch drops bookshelf. ### Steps to reproduce Breaking nodes when a tool only have 1 use left.
Dehydrate6684 added the
bug
unconfirmed
labels 2023-09-11 17:05:38 +02:00
Member

Which Minetest version did you use?

Which Minetest version did you use?

From what I have been told, this is an engine bug. On the last usage, when it breaks, it doesn't have a reference to the tool so doesn't know if it's the correct tool that was used.

From what I have been told, this is an engine bug. On the last usage, when it breaks, it doesn't have a reference to the tool so doesn't know if it's the correct tool that was used.
Author
Contributor

The minetest version I am using is 5.7.0.

The minetest version I am using is 5.7.0.
Author
Contributor

From what I have been told, this is an engine bug. On the last usage, when it breaks, it doesn't have a reference to the tool so doesn't know if it's the correct tool that was used.

I read the engine source code and I can confirm that this is happening as the minetest.on_dig function wears the tools before calling the minetest.handle_node_drops callback.

However, I think there is a potential solution to this. We can try and replace the minetest.get_node_drops function to do the checks of using the right tools and plus silk touch. This will cascade the drops variable when calling the minetest.handle_node_drops function.

> From what I have been told, this is an engine bug. On the last usage, when it breaks, it doesn't have a reference to the tool so doesn't know if it's the correct tool that was used. I read the engine source code and I can confirm that this is happening as the `minetest.on_dig` function wears the tools before calling the `minetest.handle_node_drops` callback. However, I think there is a potential solution to this. We can try and replace the `minetest.get_node_drops` function to do the checks of using the right tools and plus silk touch. This will cascade the `drops` variable when calling the `minetest.handle_node_drops` function.
Author
Contributor

I am reopening this issue until the bug is fixed in the engine.

Issue at engine

I am reopening this issue until the bug is fixed in the engine. [Issue at engine](https://github.com/minetest/minetest/issues/14108)
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#3931
No description provided.