Add wear to shears used to harvest comb from a beehive #4251

Merged
the-real-herowl merged 5 commits from teknomunk/MineClone2:beehives-wear-shears into master 2024-05-02 13:52:50 +02:00
Member

This adds wear to shears used to harvest comb from a beehive.

Testing

  1. Find or make a beehive full of honey
  2. Use new shears to harvest comb from the hive
  3. Verify the shears wear
This adds wear to shears used to harvest comb from a beehive. ### Testing 1. Find or make a beehive full of honey 2. Use new shears to harvest comb from the hive 3. Verify the shears wear
teknomunk force-pushed beehives-wear-shears from 421e43a8af to 8917e9a982 2024-04-20 18:36:16 +02:00 Compare
teknomunk added this to the 0.88.0 milestone 2024-04-30 13:02:00 +02:00
rudzik8 modified the milestone from 0.88.0 to 0.87.0 - Prismatic 2024-05-01 10:57:17 +02:00
rudzik8 added the
gameplay
items
labels 2024-05-01 11:00:17 +02:00
rudzik8 reviewed 2024-05-01 11:19:03 +02:00
@ -41,0 +59,4 @@
-- Add wear to the shears
if not is_creative then
item:add_wear(276) -- 276 = math.ceil(65536 / 238))
Member

I've noticed this is the same as mobs_mc.shears_wear (defined at mods/ENTITIES/mobs_mc/init.lua:94). Is there anything we could do with that? Like, what about moving that to a different mod/namespace (e.g. mcl_vars) and use it here?

I've noticed this is the same as `mobs_mc.shears_wear` (defined at `mods/ENTITIES/mobs_mc/init.lua:94`). Is there anything we could do with that? Like, what about moving that to a different mod/namespace (e.g. `mcl_vars`) and use it here?
Author
Member

Rather than introducing a new namespace, it may be better to add a function to the existing mcl_tools that applies wear to any tool, so that these magic numbers aren't littered thru the code. Such a function would use the item definitions _mcl_diggroups to calculate the required amount of wear to apply.

For this specific instance, it would be a call that looks like mcl_tools.add_wear(player, item, "shearsy")

Rather than introducing a new namespace, it may be better to add a function to the existing mcl_tools that applies wear to any tool, so that these magic numbers aren't littered thru the code. Such a function would use the item definitions _mcl_diggroups to calculate the required amount of wear to apply. For this specific instance, it would be a call that looks like ````mcl_tools.add_wear(player, item, "shearsy")````
Member

Rather than introducing a new namespace,

Eh?

> Rather than introducing a new namespace, [Eh?](https://git.minetest.land/MineClone2/MineClone2/src/branch/master/mods/CORE/mcl_init/init.lua)
Author
Member

I did not see that. 🤦

I did not see that. 🤦
Author
Member

Wait, mcl_util.use_item_durability(itemstack, n) already exists. I should probably should use that instead.

Wait, mcl_util.use_item_durability(itemstack, n) already exists. I should probably should use that instead.
Author
Member

Done.

Done.
teknomunk marked this conversation as resolved
teknomunk force-pushed beehives-wear-shears from ebdae078ea to 758135f08d 2024-05-01 11:59:44 +02:00 Compare
Member

Really minor typo on line 22 'withing' was probably meant to be be 'within' but the typo is in a comment so not a big deal just thought worth mentioning.

Really minor typo on line 22 'withing' was probably meant to be be 'within' but the typo is in a comment so not a big deal just thought worth mentioning.
rudzik8 approved these changes 2024-05-01 12:21:49 +02:00
Dismissed
rudzik8 left a comment
Member

Tested; does what expected, improves code readability. LGTM

Tested; does what expected, improves code readability. LGTM
teknomunk dismissed rudzik8’s review 2024-05-01 12:31:10 +02:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

rudzik8 approved these changes 2024-05-01 12:34:31 +02:00
Dismissed
rudzik8 left a comment
Member

Reapproval for typo

Reapproval for typo
the-real-herowl reviewed 2024-05-01 18:02:05 +02:00
@ -28,2 +31,4 @@
node.name = beehive
minetest.set_node(pos, node)
-- Hive honey bottle and take the empty bottle if survival mode

Typo lol
Give not Hive

Typo lol Give not Hive
Author
Member

Fixed.

Fixed.
teknomunk marked this conversation as resolved
teknomunk force-pushed beehives-wear-shears from 01722058f7 to 2e0ef17a45 2024-05-01 19:59:17 +02:00 Compare
teknomunk force-pushed beehives-wear-shears from 2e0ef17a45 to c0e553fb40 2024-05-02 11:25:19 +02:00 Compare
teknomunk added 1 commit 2024-05-02 13:01:19 +02:00
teknomunk dismissed rudzik8’s review 2024-05-02 13:01:22 +02:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

the-real-herowl approved these changes 2024-05-02 13:52:15 +02:00
the-real-herowl merged commit 81ca224bb8 into master 2024-05-02 13:52:50 +02:00
teknomunk deleted branch beehives-wear-shears 2024-05-02 14:03:58 +02:00
Sign in to join this conversation.
No reviewers
No project
No Assignees
4 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#4251
No description provided.