Commit Graph

354 Commits

Author SHA1 Message Date
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
Lizzy Fleckenstein 2125c51c9c Fix mcl_util.get_color 2021-03-05 10:20:19 +01:00
Lizzy Fleckenstein 09671b7ac9 Add simple color validator / parser 2021-03-05 09:37:27 +01:00
Lizzy Fleckenstein d57db0444f Use mod.conf in all mods, part 1 2021-03-04 15:22:14 +01:00
Lizzy Fleckenstein 713f933a99 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-03-04 10:26:27 +01:00
Lizzy Fleckenstein ee084f33a7 Add mcl_colors 2021-03-04 10:26:17 +01:00
Elias Åström 53041a0d62 Add setting to bypass protection in mcl_explosions 2021-02-28 16:06:48 +01:00
kay27 47db5c5917 Make mcl_loot/get_random_slots() deterministic 2021-02-22 21:58:35 +04:00
kay27 89e55e9065 Add sub-map generators queue, fix MineClone2/MineClone2#993 and MineClone2/MineClone2#1060 2021-02-22 03:15:32 +04:00
Elias Åström 5972322639 Remove backward compatible names in explosion info
Appears like they were not used anywhere.
2021-02-16 21:36:37 +01:00
Elias Åström d5ea06bb47 Fix center of bounding box calculation 2021-02-16 21:33:26 +01:00
kay27 3b196da12f Speedup placing villages 1/2 (update mcl_tools through Gitea, as direct push doesn't work) 2021-02-10 13:04:49 +00:00
Elias Åström 948438bd1c Add max_blast_resistance to mcl_explosions.explode
If the option is specified, then the explosion will treat all
non-indestructible nodes as having a blast resistance of no more than
the value of the option.
2021-01-26 17:04:22 +01:00
Elias Åström 34274486c7 Add griefing option to mcl_explosions.explode
When set to false explosions will only affect entities and not destroy
nodes.
2021-01-26 17:04:22 +01:00
Elias Åström e3d2284485 Refactor some stuff in mcl_explosions 2021-01-26 17:04:22 +01:00
Elias Åström 4a07b0607f Improve API of mcl_explosions.explode
Replace the 'no_sound' and 'no_particle' options in the 'info' parameter
with 'sound' and 'particles'.  But also has backwards compatability for
the old parameter names.
2021-01-26 17:04:22 +01:00
Elias Åström c907df9669 Tiny code style cleanup in mcl_explosions 2021-01-26 17:04:22 +01:00
Elias Åström 5ecb56452e Fix creeper explosions only doing 1/2 heart damage
The solution was to move the creeper explosions to originate from the
center of the creepers collisionbox and not its entity position.
2021-01-26 17:04:22 +01:00
MysticTempest 41bd803185 Add support for mcimported worlds by clearing out singlenode mapgen, and adding a toggleable fix for converted double_plants. 2021-01-26 17:04:22 +01:00
kay27 1a2c500873 Restore missing 'died formspec' after player exploded being in the bed 2021-01-20 01:46:52 +04:00
Lizzy Fleckenstein 034174390d Fix #801 2021-01-06 12:48:39 +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 d820c35937 Fishing & Mineshaft loot 2020-12-20 17:33:24 +01:00
Wuzzy 70b078cdaf Move mcl_enchanting to ITEMS 2020-12-14 14:11:59 +01:00
Wuzzy 5a7fc3774f Make mcl_enchantments translatable 2020-12-14 14:08:55 +01:00
kay27 5da02bb8cc Merge https://git.minetest.land/EliasFleckenstein03/MineClone2 2020-12-13 03:00:04 +04:00
Wuzzy 9324c43d8d Reduce grass sound volume 2020-12-08 16:56:27 +01:00
Wuzzy b6c6602d13 New mob death particle and sound 2020-12-05 05:11:53 +01:00
Lizzy Fleckenstein ed738da016 Added Enchanting Table 2020-11-25 12:47:27 +01:00
Laurent Rocher af26f18bd6 Complete French Translation 2020-11-18 23:06:47 +01:00
kay27 2b1d21a5b5 Merge branch 'kay27_mechanics' as a squash 2020-11-14 01:59:03 +04:00
Lizzy Fleckenstein a3cf6b0e5d Blast Protection; Fire Protection; Projectile Protection; Feather Falling; Thorns 2020-11-13 12:21:36 +01:00
Lizzy Fleckenstein b9e5a991e2 Protection 2020-11-10 13:58:39 +01:00
Lizzy Fleckenstein 3d7bb69e81 Bane of Arthropods; Smite; Lure 2020-11-09 18:59:08 +01:00
Lizzy Fleckenstein 479dfd6c0d Soul Speed 2020-11-09 10:50:27 +01:00
Lizzy Fleckenstein 494ffb41d3 Punch 2020-11-06 15:05:31 +01:00
Lizzy Fleckenstein 86b2cd70f9 Fortune 2020-11-06 13:46:52 +01:00
Lizzy Fleckenstein 4d37e309e7 FrostWalker 2020-11-05 16:05:42 +01:00
Lizzy Fleckenstein bbc6db489e Power 2020-11-05 15:25:44 +01:00
Lizzy Fleckenstein cdafb1a07e Knockback 2020-11-04 12:00:42 +01:00
Lizzy Fleckenstein 2b55dac7d2 Fixed Curse of Binding bypass in rightclick handler 2020-11-04 11:29:44 +01:00
Lizzy Fleckenstein 7c28bf8507 Silk Touch 2020-11-02 19:09:23 +01:00
Lizzy Fleckenstein 8a406ad968 Sharpness 2020-11-02 17:58:13 +01:00
Lizzy Fleckenstein b89ffb12f2 Unbreaking for fishing rods 2020-11-02 17:38:51 +01:00
Lizzy Fleckenstein 22083a0ff5 Armor textures support 2020-11-02 17:22:03 +01:00
Lizzy Fleckenstein a516eccd6d Unbreaking for Bows 2020-11-02 15:09:11 +01:00
Lizzy Fleckenstein 04d8d999e2 Efficiency & Unbreaking 2020-11-02 13:38:17 +01:00
Lizzy Fleckenstein e09ecb5431 Enchanted Books; Fishing Rod Support; Curse of Binding 2020-11-01 17:24:57 +01:00
Lizzy Fleckenstein 3791f8983e Combine tools in anvil 2020-11-01 15:15:44 +01:00
Lizzy Fleckenstein 3fd1963da9 Compass support 2020-11-01 14:23:43 +01:00
Lizzy Fleckenstein 26f3d821a4 Proper anvil naming support 2020-11-01 13:44:05 +01:00
Lizzy Fleckenstein 76303ae194 Working Infinity Enchantment 2020-10-27 20:02:46 +01:00
Lizzy Fleckenstein a76fb8dd57 Added tt support, made enchanted bows function properly 2020-10-27 19:53:49 +01:00
Lizzy Fleckenstein 1cef707c6c /enchant working 2020-10-27 18:19:49 +01:00
Lizzy Fleckenstein 64e62486e2 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2020-10-27 16:37:40 +01:00
Lizzy Fleckenstein 79b624bc5c First Steps 2020-10-27 16:37:25 +01:00
kay27 1965696829 Merge kay27_textures branch: more recongizable obsidian texture; better NP texture; Nether particles 2020-10-24 21:49:11 +04:00
kay27 339f7c6359 Add calculation of mcl_vars.mapgen_edge_min/max in mcl_init and use them for Nether portal fast travelling 2020-09-26 02:17:49 +04:00
Wuzzy 87ffe2e8f5 Set default node particle level to "none" 2020-08-23 12:05:08 +02:00
Wuzzy c2afc82754 Disable some demanding particles by default
Fire smoke, lava droplets
2020-08-19 20:39:05 +02:00
Wuzzy c0aeb2f15f Add lava particles 2020-08-19 20:17:04 +02:00
Wuzzy 8a39474793 Add smoke particles at torches 2020-08-19 19:14:37 +02:00
Wuzzy 731f42ac88 Rename and move texture: tnt_smoke 2020-08-19 18:47:58 +02:00
Wuzzy 7c0c0d4d0c Change particle for instant effects 2020-08-19 17:37:41 +02:00
Wuzzy 9f43d6a5a5 Add setting to disable node particles 2020-08-19 16:37:28 +02:00
Wuzzy 2a1273b7e3 Add flame particles to torches and furnaces 2020-08-19 16:32:46 +02:00
Wuzzy 4acf953334 Add critical hit particles for bow 2020-08-19 14:45:37 +02:00
Wuzzy fa9ce11ddd Move potion particles to mcl_particles 2020-08-19 14:12:51 +02:00
Wuzzy 7f1e90ada9 Move note particle to mcl_particles 2020-08-19 13:29:13 +02:00
kay27 9537eaead0 Protect from explosions 2020-08-10 22:04:27 +04:00
kay27 ba51686e6c Russian translation 2020-07-20 00:11:13 +00:00
Elias Åström ea1ad14f72 Fix sound/particle bug in mcl_explosions 2020-07-17 00:39:33 +02:00
Wuzzy c106a62979 Use minetest.is_creative_enabled 2020-07-10 16:45:40 +02:00
Wuzzy d0678d33f8 Use dungeons flag in mg_dungeons for MCL2 dungeons 2020-06-16 02:33:51 +02:00
Wuzzy 4524aee758 Fix controls mod crashing in 5.3.0-dev 2020-06-15 23:32:32 +02:00
Wuzzy 8ecc96fff2 Fix crash when spawning firey explosion 2020-06-12 12:30:45 +02:00
Wuzzy 6f12adcb03 Fix broken blast handling for chest/shulkerbox 2020-06-06 16:57:19 +02:00
Wuzzy 2d6e0a99af Check more nodes for falling after explosion 2020-06-04 23:43:17 +02:00
Wuzzy 546ee09e6f Check for falling after explosion 2020-06-04 14:17:04 +02:00
Wuzzy 2f9e5d302e Fix explosion API not calling on_[con|de]struct 2020-06-04 14:02:18 +02:00
Wuzzy f184c84241 Fix flowlib README header 2020-05-30 20:17:04 +02:00
Wuzzy 1a0e979b0c Update incomplete license information and credits 2020-05-11 17:18:04 +02:00
Wuzzy 5108f398bb Fix all explosions spawning fire 2020-05-08 18:04:04 +02:00
Wuzzy 2ec66fc61b Fix leaking global in mcl_explosions 2020-05-08 18:01:33 +02:00
Alexander Minges ad70a71f8c Fix crash when triggering explosion (type check error) 2020-05-08 17:31:41 +02:00
Wuzzy bc740efafe Add fire explosions 2020-05-02 19:05:56 +02:00
Wuzzy 6a576c50a0 Add puncher to tnt_explosions 2020-05-02 18:24:53 +02:00
Wuzzy d4bc7a2f88 Add back the explosion death msg 2020-05-02 18:09:25 +02:00
Wuzzy 7fa8828bd5 Explosions: Use minetest.get_position_from_hash 2020-04-30 21:13:10 +02:00
Wuzzy 026d406d4b Fix indents in mcl_explosions 2020-04-30 21:12:30 +02:00
Wuzzy 679e2b1b70 Explosions: Reduce repeated code 2020-04-30 21:08:42 +02:00
Wuzzy 772ea01aff Explosions: Fix syntax error 2020-04-30 21:00:13 +02:00
Wuzzy 2b5ddbd62d Explosions: Change item drop handler 2020-04-30 20:58:58 +02:00
Wuzzy 9ee0ef5a8d Explosions: Replace some API calls 2020-04-30 20:57:38 +02:00
Wuzzy 58458b2bca mcl_explosions: Rename description.txt 2020-04-30 20:55:49 +02:00
Elias Åström a10dff8421 Use walkable for entity exposure
This makes TNT do full damage under water.
2020-04-19 13:08:36 +02:00
Elias Åström a62a75c799 Do not drop items in creative mode
It works like this in Minecraft.  This will also reduce lag when playing
with TNT in creative.
2020-04-19 13:08:36 +02:00
Elias Åström b4ea2afe77 Add tnt_knockback flag for entities
When set to true, entities will be knocked back when affected by TNT
explosions.  Also ignore '__builtin:item' entities to reduce lag, and
replace tabs with spaces in 'mcl_explosions/init.lua'.
2020-04-19 13:08:36 +02:00
Elias Åström 92ab90fd1b Add knockback for mobs 2020-04-19 13:08:36 +02:00
Elias Åström ca7c8c23c7 Add entity damage and player knockback
Could not find a way to add knockback to entities.  After adding a
velocity to them they will just slide around indefinitely.  Because of
this, knockback is only enabled on players for now.
2020-04-19 13:08:36 +02:00
Elias Åström 77c95fe8c3 Add particles and sounds from explosions 2020-04-19 13:08:36 +02:00
Elias Åström 1d5c11f683 Add mcl_explosions for ray traced explosions
Code has been adapted from the Minetest explosions API mod to have
Minecraft-like explosion mechanics and work with MineClone 2.
2020-04-17 20:47:12 +02:00
Wuzzy c5e4ec5e27 Use ephemeral sounds 2020-04-07 00:55:45 +02:00
Wuzzy b2c8d7cff0 Update biomeinfo to 1.0.3 2020-04-03 12:50:48 +02:00
Wuzzy 03ad3cca29 Major default formspec style update
- Uses formspec_prepend to set e.g. button style
- Make all formspecs use the MCL2 style consistently
2020-03-10 05:01:49 +01:00
Wuzzy 98e87fd5db mcl_attached: Check if dir is nil 2020-02-23 20:37:42 +01:00
Wuzzy a8a875a7b4 Add biomeinfo mod 2019-09-11 16:06:34 +02:00
Wuzzy c623860af8 Add wool sounds 2019-06-14 23:01:50 +02:00
Wuzzy fbba40fe5c Fix item container transfer destroying item metadata 2019-04-05 15:30:32 +02:00
Wuzzy 895b9e7e3a More End tweaks 2019-03-09 19:15:10 +01:00
Wuzzy 3edf880301 Add minimal formspec prepend 2019-03-07 13:05:26 +01:00
Wuzzy a84f7935fa Revert "Utilize formspec prepend"
This reverts commit ea0c2e9568.
2019-03-07 12:42:08 +01:00
Wuzzy 26c9150591 Revert "Use formspec prepend for real"
This reverts commit 3ca01c3149.
2019-03-07 12:42:06 +01:00
Wuzzy 720bc6a56f Revert "Move mcl_formspec_prepend"
This reverts commit 581f0fa2dd.
2019-03-07 12:41:59 +01:00
Wuzzy 581f0fa2dd Move mcl_formspec_prepend 2019-03-06 07:32:13 +01:00
Wuzzy 3ca01c3149 Use formspec prepend for real 2019-03-06 06:38:25 +01:00
Wuzzy ea0c2e9568 Utilize formspec prepend 2019-03-06 06:35:24 +01:00
Wuzzy c4558a31ab Update modpack meta files (MT 5.0.0) 2019-03-06 05:52:31 +01:00
Wuzzy 149d1450ef Remove console spam from mcl_loot 2019-03-06 05:14:31 +01:00
Wuzzy a4d40560c3 Replace damage sound to something gender-neutral 2019-03-05 00:15:48 +01:00
Wuzzy 1daf9b7a59 Put treasure loot into random inventory slots 2019-02-28 18:00:17 +01:00
Wuzzy 3ec7914962 Allow to use Minetest's original flat mapgen again 2019-02-09 03:07:18 +01:00
Wuzzy e789801662 Replace getpos() with get_pos() 2019-02-01 06:33:07 +01:00
Wuzzy 68c373d2b8 Add a couple of modpack.conf files 2019-01-07 00:52:05 +01:00
Wuzzy bae1fa072c Remove dead code 2018-05-12 22:53:21 +02:00
Wuzzy e38f19b5f3 Comparator now detects jukebox as container 2018-05-12 22:48:49 +02:00
Wuzzy 1ce9ab22bf Turn jukebox into a container (part 1) 2018-05-12 21:50:56 +02:00
Wuzzy fff3eb1ee7 Rename mcl_autogroup to _mcl_autogroup
This should fix some autogroup-related issues due to loading order.
2018-05-08 16:43:25 +02:00
Wuzzy 9b47ec2797 Add controls mod by arcelmi 2018-05-07 14:52:53 +02:00
Wuzzy 093e9b0b08 Declare observers not opaque 2018-01-28 19:25:05 +01:00
Wuzzy c2d0414255 Fix crash when obj tele's Nether→Overworld @ rain 2018-01-26 19:37:00 +01:00
Wuzzy 30517ecb98 Add lava place sound 2018-01-12 02:26:12 +01:00