Commit Graph

64 Commits

Author SHA1 Message Date
Elias Åström e52cae28cd Duplicate groupcaps before applying unbreaking 2021-04-23 16:33:22 +02:00
Elias Åström 1c6d3c2fea Do not include unnecessary tool_capabilities
This commit makes enchanted tools which have no use for
tool_capabilities to not include it in their metadata.  It does this by
not including tool_capabilities in the metadata of an enchanted tool if
at least one of two cases is true:

(1) The tool is not enchanted with unbreaking or efficiency
(2) The tool does not have tool_capabilities defined in its definition

The first case covers situations like having a pickaxe only being
enchanted with silk_touch.  The second case covers situations like a
piece of armor being enchanted with unbreaking.
2021-04-18 12:45:11 +02:00
Elias Åström d6e1fe42d1 Fix efficiency and unbreaking not working together
This commit fixes an issue were tools enchanted with both efficiency and
unbreaking would loose the effect of one of the enchantments in some
conditions.
2021-04-18 12:45:06 +02:00
Elias Åström b57c94df88 Fix crash when digging nodes with fishing rod
Previously the game would crash when digging nodes with a tool which
does not have tool_capabilities in their item definition.
2021-04-16 22:45:36 +02:00
Elias Åström 64e8b82ff7 Update the groupcaps of all enchanted tools
Not just those enchanted with efficiency.
2021-04-16 22:34:48 +02:00
Elias Åström 3308ce812d Move mcl_util.hash to a local function
It is probably unlikely it will be useful at other places in Mineclone2.
2021-04-16 22:34:10 +02:00
Elias Åström e32f17b82a Move efficiency code to its own file 2021-04-16 22:34:04 +02:00
Elias Åström fe883a40bc Use hashing for more efficient groupcaps updating
This adds the metadata field "groupcaps_hash" to tools enchanted with
efficiency.  This value contains a hash of the groupcaps field in
tool_capabilities.  This value gets compared to the expected hash value
to determine if the tools tool_capabilities should be updated according
to commit af31f8189e8e5c2b.

This commit makes efficiency more efficient.
2021-04-16 22:33:13 +02:00
Elias Åström 4a9561e5dc Update enchanted tools with outdated digging times
Because of the way digging times is implemented in Mineclone2, it is
possible for the digging times of efficiency enchanted tools to become
outdated.

This fixes that by automatically updating the tools tool_capabilities
after each time the tool is used.
2021-04-16 22:33:10 +02:00
Elias Åström ba0a09243b Make mcl_enchanting use the new mcl_autogroups
The function mcl_autogroups.get_groupcaps is used by mods to get the
groupcaps for tools with efficiency enchantments.  This function is used
by mcl_enchanting when enchanting tools with efficiency.
2021-04-16 22:33:00 +02:00
Elias Fleckenstein f5b590901e Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-03-01 10:52:07 +01:00
Elias Fleckenstein 95b0a495bc Fix #1152 2021-03-01 10:51:57 +01:00
Code-Sploit 578709c93e Add Depth Strider enchantment 2021-02-27 15:35:59 +00:00
kay27 3a2300382b Translate mcl_enchanting to Russian 2021-02-27 01:48:22 +04:00
Elias Fleckenstein 5de9d90569 Simplify mcl_burning API 2021-02-22 10:55:14 +01:00
Elias Fleckenstein 3d0f5a4de5 Fix #1161 2021-02-22 10:43:59 +01:00
Elias Fleckenstein c9e589b931 Add mcl_burning damage interval 2021-02-18 14:47:35 +01:00
Elias Fleckenstein aeb7078c05 Update use_texture_alpha to the minetest 5.4 conventions 2021-02-18 14:00:17 +01:00
Laurent Rocher 303d286603 Update French translation 2021-02-13 00:09:59 +01:00
MysticTempest 846b1d273d Fix the enchanting table book entity spawning multiple times as reported in issue #1008. 2021-02-11 19:25:54 -06:00
HimbeerserverDE a3ccb54376 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-27 20:13:16 +01:00
HimbeerserverDE 00df587bf7 Add flame enchantment 2021-01-27 20:11:02 +01:00
MysticTempest 9feee980f8 Add help text for enchanting table. 2021-01-27 01:41:23 -06:00
Elias Fleckenstein 02305c914d Merge branch 'enchanted_books_creative' 2021-01-18 20:08:37 +01:00
Elias Fleckenstein 427ac03a4d Fix #951 2021-01-17 13:21:09 +01:00
Elias Fleckenstein c4c3fc1c8c Fix Fire Aspect 2021-01-10 14:16:00 +01:00
Elias Fleckenstein 2f1a918667 Fix thorns incompabilities 2021-01-06 19:41:11 +01:00
Elias Fleckenstein 9a31252c5d Fix sharpness and bane of arthopods being compatible 2021-01-06 19:04:04 +01:00
Elias Fleckenstein 7d4688b70c Fix enchanted items showing up in craftguide 2021-01-06 14:17:27 +01:00
Elias Fleckenstein 7bdce54048 Give credit for the enchanting sounds (Closes #921) 2021-01-05 17:27:38 +01:00
Elias Fleckenstein 139a4d94d0 Merge branch 'master' into enchanted_books_creative 2021-01-05 14:25:56 +01:00
Elias Fleckenstein 37f256648b Fix enchanting book animation being weird sometimes 2021-01-05 12:40:29 +01:00
Elias Fleckenstein ebc2ec9f72 Add missing enchanting sound 2021-01-05 12:37:15 +01:00
kay27 c2a14e2eae Make glyph particles more close to MC and visible only for players in radius 15 2021-01-05 12:13:36 +01:00
Elias Fleckenstein 796c80b2d1 Merge branch 'fixes' into enchanted_books_creative 2021-01-04 17:59:41 +01:00
Elias Fleckenstein aea051fe37 Proper fire aspect damage 2021-01-04 17:53:49 +01:00
Elias Fleckenstein 5939baee52 Enchanted books in creative inventory 2021-01-04 13:02:55 +01:00
kay27 30379c823c Clean up some spaces in code after merging https://git.minetest.land/EliasFleckenstein03/MineClone2 2021-01-03 00:42:07 +04:00
Elias Fleckenstein 7d805ff789 Fix duplicate bookshelf positions 2021-01-02 12:28:38 +01:00
Elias Fleckenstein 64e510a730 Better bookshelf counting 2021-01-02 12:21:35 +01:00
Elias Fleckenstein 939a73dd77 Remove Licenses from mcl_burning and mcl_enchanting 2021-01-02 11:18:18 +01:00
Elias Fleckenstein fbd4a3a516 Fix burning sound keeping playing 2021-01-02 10:56:40 +01:00
Elias Fleckenstein 92bf864807 Fire Aspect 2021-01-01 19:51:31 +01:00
Elias Fleckenstein da7240d6c1 looting 2020-12-23 17:41:42 +01:00
Elias Fleckenstein a7ff5be28b Luck of the Sea 2020-12-23 15:18:20 +01:00
Elias Fleckenstein 6ba3fc869c Make villagers sell enchanted stuff 2020-12-22 12:00:04 +01:00
Elias Fleckenstein 3161668d26 Color tweaks 2020-12-22 10:42:22 +01:00
Elias Fleckenstein 213f62ac06 Fix translations 2020-12-21 18:00:35 +01:00
Elias Fleckenstein ef9a54872e Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2020-12-21 17:58:39 +01:00
Elias Fleckenstein a4d9d22bb0 Mending 2020-12-21 15:12:24 +01:00