minetest-mods / moreores

More Ores
https://content.minetest.net/packages/Calinou/moreores/
zlib License
26 stars 30 forks source link

Differentiating blocks, minerals and cooktimes #47

Open GreenDirkfried opened 2 years ago

GreenDirkfried commented 2 years ago

Blocks, minerals and cooktimes were the same for all ores (e.g. the mithril block had the same attributes as the silver one and thus was less tough than the diamondblock).

The changes from this branch are:

  1. For registering the block and mineral node the values can now respectively be added in the local oredef (if not defined, the values from before are used as default).
  2. A cooktime for lump -> ingot is added (if not defined, this is set to 3 as default (not in the code here)).
  3. Blocks, minerals and cooktimes for tin, silver and mithril are chosen differently. 3.1 The mithril block is probably now the first block with level=5 (> level 3) to result in a higher digging time and lower uses than for the diamondblock. It can only be dug with a mithril pickaxe. 3.2 Because of 3.1, all mithril tools have now max level=5. The digging times and uses are adjusted, so that they are still better for lower level blocks than the values for diamond tools (e.g. 207 versus 30 (or 40) uses for level=3). 3.3 The mithril block is now also TNT resistant.
GreenDirkfried commented 2 years ago

Note that this changes the underlying structure of the code to some degree, as described in the following: The line "if oredef.makes.ore then" is replaced by "if oredef.mineral then" meaning that an ore (here ore=mineral) is not defined by having "ore=true" in "makes", but by the existence of "oredef.mineral ". In other words: an ore is defined (or made), if an ore is defined in the code. The same thing is done for the "block".

GreenDirkfried commented 2 years ago

An explanation for level=5:

The mithril block should have less "uses" and a greater "digging time" than the diamond block, which is a level=3 node. Uses and digging times of a tool are defined for its "max level". Considering nodes of level less than the max level, the uses are multiplied by 3 to the power of the level difference and the digging times are divided by the level difference (the minetest engine should have a "level difference+1" here!), meaning that for one level difference the digging times does not change -- except for having a lower group-rating, but diamond already has cracky=1 (and lower numbers are not well treated).

Therefore, for the mithril block to have a higher digging time than the diamond block, it has to be not only level=4, but level=5.