To Fix#3672 , I avoid displaying the output item if enchantment is not possible for various reason
* Level of added enchantment is below the one from input item
* Incompatible enchantment
Co-authored-by: Araca <>
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3998
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Araca <araca.prod@gmail.com>
Co-committed-by: Araca <araca.prod@gmail.com>
- enchanted loot generated by mapgen now uses PseudoRandom for randomness
- prevent fishing loot from generating loot 32767 times (!!!) when only 1 is needed
- bows and fishing rods obtained from the treasure section of fishing loot are now enchanted
- there is now a function to uniform enchant items other than books
The Minecraft colorset (net.minecraft.util.text.TextFormatting) is only used for chat and tooltips.
This partically reverts 84819bf9f5164ab208b7be1e94d142906359a1af.
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.
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.
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.
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.