Commit graph

284 commits

Author SHA1 Message Date
AFCMS
28402ca663 store tool wield scale in a global var 2021-04-05 10:16:56 +02:00
AFCMS
0740854b5d Merge branch 'master' into doc-refactoring 2021-03-30 22:28:48 +02:00
kay27
cb2aae5a55 [mcl_mapgen_core] Redesign, mostly to remove water from End and restore static lvm_buffer to speed it up 2021-03-28 22:57:11 +04:00
AFCMS
890a569b13 add API documentation to mcl_worlds 2021-03-28 07:40:36 +02:00
AFCMS
cdb67d96a6 add API documentation to mcl_explosions 2021-03-28 01:00:18 +01:00
AFCMS
6f9c1856b8 add API documentation to mcl_colors (!) 2021-03-28 00:48:24 +01:00
AFCMS
e56d9d2ab8 add API documentation to controls 2021-03-28 00:44:36 +01:00
AFCMS
52939ff6a4 add API documentation to flowlib (part 5) 2021-03-28 00:32:52 +01:00
AFCMS
39ac3f208d add API documentation to flowlib (part 4) 2021-03-28 00:25:54 +01:00
AFCMS
2a5dcd1634 add API documentation to flowlib (part 3) 2021-03-28 00:23:57 +01:00
AFCMS
19db2a479f add API documentation to flowlib (part 2) 2021-03-28 00:18:19 +01:00
AFCMS
fb50b256ed add API documentation to flowlib (part 1) 2021-03-28 00:12:41 +01:00
AFCMS
ce123d4676 add API documentation to mcl_autogroup 2021-03-28 00:02:35 +01:00
Elias Åström
0d7c2c4988 Fix #1358 for real 2021-03-23 12:02:00 +01:00
kay27
03feb36558 Improve Nether Portals (#1315) (as a squash)
Remove Nether portal caches, https://git.minetest.land/MineClone2/MineClone2/issues/1210

Store all exits from Nether portals in quick-access table

Implement proper Nether portal search, using the table, https://git.minetest.land/MineClone2/MineClone2/issues/1055

Store Nether portal exits table in mod storage

Remove exits from table on Nether portal destruction

Align destination area to [map chunks 5x5x5](https://git.minetest.land/MineClone2/MineClone2/wiki/World-structure%3A-positions%2C-boundaries%2C-blocks%2C-chunks%2C-dimensions%2C-barriers-and-the-void) to avoid lots of ```emerge_area()``` calls

Support Nether roof, https://git.minetest.land/MineClone2/MineClone2/issues/1267

Implement better suitable place search, https://git.minetest.land/MineClone2/MineClone2/issues/1126

Implement object queue not to trigger the same search again

Avoid lava lakes, https://git.minetest.land/MineClone2/MineClone2/issues/1126

Add ```/spawnstruct nether_portal``` chat command
Co-Authored-By: kay27 <kay27@noreply.git.minetest.land>
Co-Committed-By: kay27 <kay27@noreply.git.minetest.land>
2021-03-21 23:14:33 +00:00
Elias Åström
0996a83ba0 Assert that both parts of mcl_autogroup exist 2021-03-20 19:32:04 +01:00
Elias Åström
1621c23308 Rename "tool_multiplier" to "speed" for tools 2021-03-20 19:25:47 +01:00
Elias Åström
10154d5778 Fix #1348 2021-03-20 11:02:16 +01:00
Elias Åström
0f2c487dca Remove _mcl_autogroup depends on mcl_autogroup
It looks like the dependency might cause problems with the mod loading
order and lead to situations were _mcl_autogroup is not loaded after all
the other mods.  Because _mcl_autogroup begins with an underscore it
should always be loaded after mcl_autogroup anyways.
2021-03-18 13:59:22 +01:00
Elias Åström
bfe51316ee Merge branch 'mcl_autogroups' 2021-03-18 13:43:58 +01:00
Elias Åström
13268965ee Update README.txt in _mcl_autogroup 2021-03-18 13:40:56 +01:00
Elias Åström
521f96b4ab Use mod.conf for mcl_autogroup and _mcl_autogroup 2021-03-18 13:36:25 +01:00
Elias Åström
c8b543991f Automatically assign nodes to creative_breakable
If they belong to any digging group.
2021-03-18 11:35:40 +01:00
Elias Åström
4c46eb2b4b Make tools without toolcaps do damage as hand
If the tool_capabilities defaults to {} if unspecified the tool, then
users will not be able to attack with the tool at all.  This solves that
by including the damage_group and full_punch_interval from the hand into
the tool_capabilities when it is nil.
2021-03-18 11:35:40 +01:00
Elias Åström
fe770c19a5 Fix crash when tool_capabilities is nil 2021-03-18 11:35:40 +01:00
Elias Åström
0112825a9f Localize variables in _mcl_autogroup 2021-03-18 11:35:40 +01:00
Elias Åström
cff0130506 Rename _mcl_autogroup_groupcaps to _mcl_diggroups 2021-03-18 11:35:40 +01:00
Elias Åström
7b93f68ed8 Fix typo 2021-03-18 11:35:40 +01:00
Elias Åström
ece4c892f4 Force tools to include levels in their diggroups 2021-03-18 11:35:40 +01:00
Elias Åström
bec1f786a6 Improve documentation of mcl_autogroup 2021-03-18 11:35:40 +01:00
Elias Åström
6458565bf9 Move mcl_util.hash to a local function
It is probably unlikely it will be useful at other places in Mineclone2.
2021-03-18 11:35:40 +01:00
Elias Åström
5193730652 Truncate groupcaps_hash to 8 Base64 digits 2021-03-18 11:35:40 +01:00
Elias Åström
e77473e800 Make changes to the mcl_autogroup API
Group levels are now specified as a list of names when registering a
digging group.  Digging groups which do not have specified levels will
support tools having two levels, 0 and 1 where 0 means the tool can dig
but not harvest the node and 1 means it can also harvest the node.  If
more levels are required one has to specifiy them when registering the
digging group.
2021-03-18 11:35:40 +01:00
Elias Åström
922bdbc601 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-03-18 11:35:40 +01:00
Elias Åström
b47733507d Fix tools not taking wear when rightclicking
Added the API function mcl_autogroup.get_wear which is used to get the
tool wear for digging a node of a group.  This is used by mcl_tools to
compute the wear of shovels and shears when rightclicking to create
grass paths and carve pumpkins.
2021-03-18 11:35:29 +01:00
Elias Åström
f0528b11d7 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-03-18 11:34:26 +01:00
Elias Åström
503b3a8149 Fix some nodes not being diggable
Previously some nodes like "mcl_flowers:double_grass_top" would be
undiggable.  This was because they did not define _mcl_hardness and it
was not defaulted to 0 in all parts of _mcl_autogroup.
2021-03-18 11:34:26 +01:00
Elias Åström
5b5a254b1a Fix tool uses not being set in _mcl_autogroups 2021-03-18 11:34:26 +01:00
Elias Åström
0c90dda04c Rename register_digtime_group to register_diggroup 2021-03-18 11:34:26 +01:00
Elias Åström
fa86d4e5eb Change comments for mcl_autogroup 2021-03-18 11:34:20 +01:00
Elias Åström
f8461d5e90 Remove mcl_autogroups.get_groupcaps
Requiring tool definitions to call a function in _mcl_autogroup means
that they need to be loaded after _mcl_autogroup.  This can cause
problems because _mcl_autogroup needs to be loaded after all tool and
node definitions are completed.

Because of this the API is changed so tool definitions instead put the
data used to generate groupcaps in the custom field
_mcl_autogroup_groupcaps.  _mcl_autogroup will then go through all
registered tools and update the groupcaps for every tool where this
field is present.  This means that no mod ever has to depend on
_mcl_autogroup.
2021-03-18 11:33:18 +01:00
Elias Åström
fb6f5eae7a Rewrite mcl_autogroup
These changes are primarly made to make mcl_autogroup more efficient.
Previously enchanted tools required storing around 21 kB of metadata due
to the way the previous version of the mod was implemented.  This caused
a lot of lag and a huge amount of network traffic.  With the changes
enchanted tools won't require more than 1 kB of metadata.

The mod is also rewritten to use an API to register digging groups and
compute the groupcaps for tools.  This will make it easier for modders
to register custom digging groups.

The mod is now split up into two parts.  One part called "mcl_autogroup"
to implement the API for registering custom digging groups, and the
other part called "_mcl_autogroup" which contains most of the code which
has to be loaded after most mods.
2021-03-18 11:32:18 +01:00
AFCMS
ae18ca7602 fix wrong value in walkover 2021-03-17 10:48:59 +01:00
AFCMS
f35f80d79a fix walkover 2021-03-16 17:31:29 +01:00
AFCMS
2da8be9f78 optimise walkover part2 2021-03-16 11:22:13 +01:00
AFCMS
71bb18cd76 walkover optimisation part1 2021-03-16 11:07:17 +01:00
AFCMS
4b2c963222 performances improvement for mcl_explosions 2021-03-15 01:20:22 +01:00
AFCMS
671de95357 improve performances of controls 2021-03-15 00:35:58 +01:00
AFCMS
787d997e51 fix warnings in mcl_explosion 2021-03-11 23:08:51 +01:00
Elias Fleckenstein
2125c51c9c Fix mcl_util.get_color 2021-03-05 10:20:19 +01:00