Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiating blocks, minerals and cooktimes #47

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

GreenDirkfried
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor Author

GreenDirkfried commented Aug 27, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants