Commit Graph

21 Commits

Author SHA1 Message Date
Lizzy Fleckenstein 116e9dbe65
Fix another anvil weirdness and dupe glitch 2021-11-29 19:32:10 +01: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 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 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
Lizzy Fleckenstein 95b0a495bc Fix #1152 2021-03-01 10:51:57 +01:00
Lizzy Fleckenstein 427ac03a4d Fix #951 2021-01-17 13:21:09 +01:00
Lizzy Fleckenstein 7d4688b70c Fix enchanted items showing up in craftguide 2021-01-06 14:17:27 +01:00
Lizzy Fleckenstein 37f256648b Fix enchanting book animation being weird sometimes 2021-01-05 12:40:29 +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
Lizzy Fleckenstein 6ba3fc869c Make villagers sell enchanted stuff 2020-12-22 12:00:04 +01:00
Lizzy Fleckenstein d820c35937 Fishing & Mineshaft loot 2020-12-20 17:33:24 +01:00
Lizzy Fleckenstein 66eb5c35da Fix enchanted book 2020-12-18 15:57:52 +01:00
Lizzy Fleckenstein 0477e729f5 Fixed crash 2020-12-17 18:58:07 +01:00
Lizzy Fleckenstein 19726241c3 Fixed lapis slot 2020-12-17 18:53:44 +01:00
Lizzy Fleckenstein 6c3588bad8 Rework inventory 2020-12-17 13:29:21 +01:00
Wuzzy 73cb6b7a22 Don't save book entity statically to save space 2020-12-14 19:08:57 +01:00
Wuzzy 4be2f2f76d Fix more book entity spawn/despawn bugs 2020-12-14 18:53:34 +01:00
Wuzzy 70b078cdaf Move mcl_enchanting to ITEMS 2020-12-14 14:11:59 +01:00