1
0
Fork 0

Compare commits

..

141 Commits

Author SHA1 Message Date
the-real-herowl accb8742dd Merge pull request 'Make golem go home. Fixes #3288' (#3929) from golem_nav into master
Reviewed-on: MineClone2/MineClone2#3929
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2023-11-06 22:31:43 +00:00
codiac 71282e196e Move mob nav hacks to Experimental 2023-11-06 22:46:04 +01:00
codiac 89c97690c8 Add a setting to enable mod nav hacks 2023-11-06 22:01:31 +01:00
codiac 06f9486e4d Do not go home if attacking 2023-11-06 21:59:40 +01:00
codiac ae5564e658 Make golem go home. Fixes #3288 2023-11-06 21:59:40 +01:00
the-real-herowl fdf823fff6 Merge pull request 'Update trapdoor climbable behavior' (#3938) from Dehydrate6684/MineClone2:trapdoor-ladder into master
Reviewed-on: MineClone2/MineClone2#3938
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2023-11-06 20:29:23 +00:00
Araca 52b65554d9 Do not output enchanted item if enchantment is impossible (#3998)
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: MineClone2/MineClone2#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>
2023-11-06 20:12:36 +00:00
the-real-herowl 5a069af072 Merge pull request 'Piston-breakable nodes don't fill up the push limit, items properly drop' (#3813) from seventeenthShulker/MineClone2:piston_digs_properly into master
Reviewed-on: MineClone2/MineClone2#3813
2023-11-06 19:50:31 +00:00
the-real-herowl 14f73a8c55 Merge pull request 'armor trim followup' (#3974) from trim_achievement into master
Reviewed-on: MineClone2/MineClone2#3974
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2023-11-06 19:37:56 +00:00
the-real-herowl dbab70ea38 Fixed the wayfinder 2023-11-06 20:22:46 +01:00
chmodsayshello 952a96b57d fix leggings trim textures 2023-11-05 20:35:13 +01:00
Dehydrate6684 e5a260b563
Added vines and skulk vines to ladder group 2023-11-05 14:10:58 +08:00
Dehydrate6684 9b2b8ee56e
Removed direction checks 2023-11-05 14:06:53 +08:00
seventeenthShulker 00cfca5947 Make carpet sticky again 2023-11-04 16:01:46 +00:00
seventeenthShulker c37da143da Add crying obsidian and lodestone to mvps_stoppers 2023-11-04 16:01:46 +00:00
seventeenthShulker 520fd773fb Fix random crash when piston breaks node with no player 2023-11-04 16:01:46 +00:00
seventeenthShulker 378df76e5f Prevent signs from being replaced by pushed/pulled blocks 2023-11-04 16:01:46 +00:00
seventeenthShulker 3e12b3c700 Check protection of certain nodes before push/pull
- The node directly in front of a piston (including air)

- The 'final' position of any connected nodes
2023-11-04 16:01:46 +00:00
seventeenthShulker 0637182697 Tallgrass and dead bush added to dig_by_piston 2023-11-04 16:01:46 +00:00
seventeenthShulker 0580b14310 Vertical pistons now save owner meta 2023-11-04 16:01:46 +00:00
seventeenthShulker 98cf3b7f7a Check node_replaceable after dig_by_piston
Allows tallgrass, nether vines etc to drop
2023-11-04 16:01:46 +00:00
seventeenthShulker e5829f719d All signs are mvps_stopper upon registration
All buttons are mvps_unsticky upon registration
Add some missing unmovable nodes
Bamboo trapdoor is now sticky
2023-11-04 16:01:46 +00:00
seventeenthShulker 089e3d46f1 Several more blocks comply with MC piston mechanics. 2023-11-04 16:01:46 +00:00
seventeenthShulker 5d8688dbeb Change tall flowers to `buildable_to = false` 2023-11-04 16:01:46 +00:00
seventeenthShulker 058684f17f Improve dig_node simulation and fix duplication 2023-11-04 16:01:46 +00:00
seventeenthShulker 918b8eee38 Fix unsticky defs for shulker_box_small names (some did not exist) 2023-11-04 16:01:46 +00:00
seventeenthShulker af206ed8b3 All bamboo plant tiles can be broken with pistons 2023-11-04 16:01:46 +00:00
seventeenthShulker f2eca64e42 Blocks with dig_by_piston no longer fill up the push limit
Fix for broken nodes (e.g. sugar cane) not updating and leaving floating bits

Short-term fix for minetest.dig_node not always working (checking for group dig_immediate = 3)
2023-11-04 16:01:46 +00:00
the-real-herowl 262100be24 Fixed stew/bowl duplication bug (#3995)
Fixed #3991, copied some code over from mcl_potions

Reviewed-on: MineClone2/MineClone2#3995
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2023-11-03 22:39:21 +00:00
Eliy21 69dc013799 Prevent multiple chestboat drivers (#3992)
Fixes #3872

Reviewed-on: MineClone2/MineClone2#3992
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Eliy21 <eliy21@noreply.git.minetest.land>
Co-committed-by: Eliy21 <eliy21@noreply.git.minetest.land>
2023-11-03 22:09:49 +00:00
Michieal a425d359f5 WaterLoggedRootsKelpFix (#3994)
Fixes #3990

A very simple fix to Kelp and the current water logged nodes. It adds the group "waterlogged" to water logged items and then puts a check for the group in kelp growth. Made it as a group, because eventually there will be other waterlogged nodes.

Reviewed-on: MineClone2/MineClone2#3994
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Michieal <michieal@noreply.git.minetest.land>
Co-committed-by: Michieal <michieal@noreply.git.minetest.land>
2023-11-03 21:46:00 +00:00
Freedom 83d6e2a5d2 polar bear fix typo (#3846)
horrizonatal -> horizontal

Reviewed-on: MineClone2/MineClone2#3846
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Freeman <project@gnuhacker.org>
Co-committed-by: Freeman <project@gnuhacker.org>
2023-11-03 00:06:06 +00:00
FossFanatic ce403b9245 Rename Liquid Textures (#3758)
This pull request renames the textures of water and lava to more closely follow the MineClone 2 naming convention.

The code has also been changed to now reflect these new names.

Reviewed-on: MineClone2/MineClone2#3758
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: FossFanatic <fossfanatic@noreply.git.minetest.land>
Co-committed-by: FossFanatic <fossfanatic@noreply.git.minetest.land>
2023-11-02 23:47:26 +00:00
Eliy21 da911bd4d4 Turn non-player boat passenger sideways (#3986)
Some low hanging simple boat fixes.

Fixes #3259

Reviewed-on: MineClone2/MineClone2#3986
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Eliy21 <eliy21@noreply.git.minetest.land>
Co-committed-by: Eliy21 <eliy21@noreply.git.minetest.land>
2023-11-02 19:24:52 +00:00
the-real-herowl 8789411ab7 Merge pull request 'Add ability for shovels to turn grass paths into dirt on shift+right click' (#3932) from add-dirty-shovel-function into master
Reviewed-on: MineClone2/MineClone2#3932
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2023-11-02 19:03:47 +00:00
the-real-herowl 5b1deedaf0 Disabled grass path making when sneaking 2023-11-02 20:00:19 +01:00
SmokeyDope fa1d8dfc47 Adjust grass path long description to inform players of new way to turn paths back to dirt. 2023-11-02 17:34:01 +00:00
SmokeyDope d2a4a6d042 add group 'path_remove_possible' to grass paths 2023-11-02 17:34:01 +00:00
SmokeyDope 5e194b33bd Adjust make_grass_path function to let shovels turn grass paths back to dirt with shift+rightclick 2023-11-02 17:34:01 +00:00
Araca 35bb569ee1 make craft guide search use local language (#3984)
Fix #3909

It is now possible to search in the crafting guide using both item id ("name", usually related to the English name) and translated item description (containing the displayed in-game name).

Co-authored-by: Araca <>
Reviewed-on: MineClone2/MineClone2#3984
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>
2023-10-31 10:00:58 +00:00
chmodsayshello 5be506830f make diamond tools upgradeable again 2023-10-25 18:04:32 +02:00
codiac 4fcd1ae541 Fix slime spawn crash (#3977)
Declare global variables before using them!

Fixes #3975

Reviewed-on: MineClone2/MineClone2#3977
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: codiac <codiac@inbox.lv>
Co-committed-by: codiac <codiac@inbox.lv>
2023-10-23 05:32:18 +00:00
the-real-herowl f941817c39 Merge pull request 'Un-hardcode blast resistance and hardness of fences and walls' (#3943) from wood_fence_blast_resistance into master
Reviewed-on: MineClone2/MineClone2#3943
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2023-10-22 02:24:28 +00:00
seventeenthShulker bc3bde4cf8 Forgot about blackstone 2023-10-22 02:14:17 +00:00
seventeenthShulker 8099a4bd17 Walls use `source` parameter for default hardness and blast resistance
If no `source` given, fallbacks are 2 and 6 respectively
2023-10-22 02:14:17 +00:00
seventeenthShulker e2ed1ab4a6 Fix prismarine bricks and dark variant blast res.
Should be 6 like regular prismarine
2023-10-22 02:14:17 +00:00
seventeenthShulker e43a8e267d Un-hardcode blast resistance, hardness for walls,
now only based on their material
2023-10-22 02:14:17 +00:00
seventeenthShulker 570caf47eb All wood-type and nether-type fences now match material's blast resistance 2023-10-22 02:14:17 +00:00
the-real-herowl 59f3b53a51 Merge pull request 'Use MC 1.18+ light levels to control mob spawning' (#3946) from spawn_lighting into master
Reviewed-on: MineClone2/MineClone2#3946
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2023-10-22 01:35:00 +00:00
chmodsayshello ec7e99019e add trim advancements 2023-10-21 22:25:30 +02:00
Dehydrate6684 b320d008ca
Unhardcoded nil 2023-10-18 08:04:54 +08:00
the-real-herowl 3d7155c1b9 Merge pull request 'Raise player eye height to 1.6 blocks.' (#3967) from Dark/MineClone2:master into master
Reviewed-on: MineClone2/MineClone2#3967
Reviewed-by: chmodsayshello <chmodsayshello@hotmail.com>
2023-10-16 16:41:18 +00:00
chmodsayshello e3ab94809e Merge pull request 'Fixed a crash in minetest vector code that isn't propogated to lua.' (#3966) from fix_rotate_around_axis_crash into master
Reviewed-on: MineClone2/MineClone2#3966
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Reviewed-by: chmodsayshello <chmodsayshello@hotmail.com>
2023-10-16 12:21:56 +00:00
Dark a66be39d9b Raise player eye height to 1.6 blocks.
This is the same as in Minecraft. The previous value of 1.5 can feel very strange for those coming from that game.
2023-10-16 00:15:12 +00:00
ancientmarinerdev 3564f6ebde Fixed a crash in minetest vector code that isn't propogated to lua. Create util for ease of use. 2023-10-15 22:03:48 +01:00
chmodsayshello f99ae93bf6 Merge pull request 'fix crash when opening a chest that has an unknow node on it' (#3964) from pepebotella/MineClone2:chest-under-unknow into master
Reviewed-on: MineClone2/MineClone2#3964
Reviewed-by: chmodsayshello <chmodsayshello@hotmail.com>
2023-10-15 19:21:10 +00:00
Freedom 8d440252a4 fix crash when opening a chest that has an unknow node on it
fix #3961
2023-10-13 21:07:00 +02:00
the-real-herowl d706833f21 Merge pull request 'Wither finishing & effect fixes' (#3957) from the-real-herowl/MineClone2:wither into master
Reviewed-on: MineClone2/MineClone2#3957
2023-10-11 20:46:24 +00:00
the-real-herowl c874e01cf9 Wither falling when no target found and small fixes 2023-10-11 00:54:31 +00:00
the-real-herowl 7ce82b9dcb Peaceful crash fixed 2023-10-11 00:54:31 +00:00
the-real-herowl 645072507f Wither melee attack and bug fixes 2023-10-11 00:54:31 +00:00
the-real-herowl 924a6c1c47 Settings-related fixes
-moved to the cleaner way of obtaining settings values
-disabled the anti-troll measures by default
-made the wither per-dimension limit dependent on the settings
-(anti-troll measures enabled required for wither counting and limit)
2023-10-11 00:54:31 +00:00
the-real-herowl 20b0f0748d Added some comments to the code 2023-10-11 00:54:31 +00:00
the-real-herowl d7c76e33d8 Tiny adjustments
- wither initial explosion radius moved from a magic value into a local variable
- wither initial explosion radius reduced
- wither attack_exception improved to better handle unlikely edge cases
2023-10-11 00:54:31 +00:00
the-real-herowl 966712f4ff Optimisation and cleanup
-optimised and cleaned up wither rose withering effect code
-removed unused code
2023-10-11 00:54:31 +00:00
the-real-herowl e4102e6124 Implemented wither defensive measures
Added block breaking when hit, or a safe_boom when hit and mobs_griefing
is disabled. Removed dubious anti-troll measures.
2023-10-11 00:54:31 +00:00
the-real-herowl 17c8f220e6 A few more wither fixes 2023-10-11 00:54:31 +00:00
the-real-herowl df17688b7d Great batch of improvements 2023-10-11 00:54:31 +00:00
the-real-herowl 729d8ec9e0 Another batch of wither adjustments 2023-10-11 00:54:31 +00:00
the-real-herowl c9dc12b081 Further wither adjustments 2023-10-11 00:54:31 +00:00
Nauta Turbidus a1b6819756 Withering effect and effect immunities
Added withering effect and immunities to effects.

Signed-off-by: Nauta Turbidus <88062389+nauta-turbidus@users.noreply.github.com>
2023-10-11 00:54:31 +00:00
the-real-herowl f1568483b3 Merge pull request 'Keep axolotls from attacking sheep' (#3963) from ThePython10110/MineClone2:axolotl-sheep into master
Reviewed-on: MineClone2/MineClone2#3963
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
2023-10-11 00:50:12 +00:00
ThePython10110 d7fa24ebf8 Keep axolotls from attacking sheep 2023-10-10 23:50:46 +00:00
Dehydrate6684 23468cc2dd
Used vector.offset instead of add/subtract 2023-10-10 09:39:16 +08:00
Dehydrate6684 0c48a46f7c
Updated code based on reviews 2023-10-09 13:55:08 +08:00
chmodsayshello 712a6d6c66 Merge pull request 'add 1.20 armor trims' (#3784) from armor_trims into master
Reviewed-on: MineClone2/MineClone2#3784
Reviewed-by: AFCMS <afcm.contact@gmail.com>
2023-10-03 21:46:00 +00:00
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 a620d24ec8 Fix a number of crashes involving unknown nodes, also fix fishbuckets on_place (#3914)
Fixes: #3913 #3915

~~You can reproduce the crash by placing a fish bucket on top snow above an unknown node.

I also noticed that the code always uses pointed_thing.above so I fixed that and also added a function to mcl_utils to figure out where a node should be placed (either above or below). Looks like the rest of the code could also use improvement but at least it does not crash now.~~

Cora fixed a bunch of related crashes in Mineclona so I am replacing my commit and cherry picking all her commits here.
https://codeberg.org/mineclonia/mineclonia/pulls/549

Here is the list of fixes from that PR:
- Crash when placing snow layer on unknown nodes
- Crash when snow layers on unknown nodes are flooded
- Crash when placing fishbucket on snow on top of unknown nodes
- Crash when placing chorus flower and stem on unknown
- Crash when placing mob spawners on unknown
- The fishbucket on place to actually replace buildable_to

Co-authored-by: cora <coradelamouche@gmx.ch>
Reviewed-on: MineClone2/MineClone2#3914
Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
Co-authored-by: 𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 <mrrar@noreply.git.minetest.land>
Co-committed-by: 𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 <mrrar@noreply.git.minetest.land>
2023-09-29 18:47:07 +00:00
ancientmarinerdev 178b24886f Merge pull request 'mcl_oxidation: typo in README.' (#3910) from mdk/MineClone2:typo into master
Reviewed-on: MineClone2/MineClone2#3910
Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
2023-09-29 18:41:27 +00:00
ancientmarinerdev 8333281b4f Merge pull request 'Halved the creeper explosion timer reset radius' (#3808) from reduce-explosiontimer_reset_radius into master
Reviewed-on: MineClone2/MineClone2#3808
Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
2023-09-29 18:36:28 +00:00
Nicu 6d3e55ce12 Reduced the creeper explosion timer reset radius from 6 to 3
This gives the player just enough time to get out of the creeper's range, to reset their explosion timer and avoid unnecessary destruction.
2023-09-29 18:35:21 +00:00
ancientmarinerdev 2c2f5595f3 Merge pull request 'Add Setting to keep respawn location set if bed is destroyed.' (#3933) from Eliy21/MineClone2:no_bed_respawn_setting into master
Reviewed-on: MineClone2/MineClone2#3933
Reviewed-by: chmodsayshello <chmodsayshello@hotmail.com>
2023-09-29 18:29:31 +00:00
chmodsayshello 8936313fb3 proper itemslot background
redo of 904cd78d3f ; caused some issues after cherry pick, same texture
2023-09-29 16:59:45 +02:00
ancientmarinerdev c51442704c Merge pull request 'mcl_skins: link to official mcl_custom_skins' (#3954) from skins into master
Reviewed-on: MineClone2/MineClone2#3954
Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
2023-09-28 19:43:24 +00:00
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 2bd6678b08 mcl_skins: link to official mcl_custom_skins 2023-09-28 13:09:45 -05:00
Codiac e0c44244f9 Merge pull request 'Point mcl_custom_skins link to a working URL' (#3949) from Montandalar/MineClone2:fix_url_mcl_custom_skins into master
Reviewed-on: MineClone2/MineClone2#3949
Reviewed-by: Codiac <codiac@noreply.git.minetest.land>
2023-09-28 10:40:03 +00:00
Codiac 5b7352a23a Merge pull request 'Fix Server crash (Issue #3939)' (#3947) from Michieal/MineClone2_For_PRs:Bamboo_Fix_PointedThing into master
Reviewed-on: MineClone2/MineClone2#3947
Reviewed-by: Codiac <codiac@noreply.git.minetest.land>
2023-09-28 10:39:23 +00:00
Michieal e8c658658d Update Credits. 2023-09-26 18:59:51 +00:00
Michieal e9d994b74d Fix Campifires API to not crash the server.
Fixed the error in Campfires' On_RightClick() to not error out when called with a non-existent pointed_thing.
2023-09-26 18:57:17 +00:00
Michieal eafe6627d8 Extra checks placed in. 2023-09-26 18:35:12 +00:00
chmodsayshello 4046a68fbf Add trim snippet 2023-09-26 20:24:54 +02:00
Blockhead 882c3ef339 Point mcl_custom_skins link to a working URL 2023-09-25 19:55:36 +10:00
codiac 95db118361 Add rules for blaze, wither skeleton, silverfish 2023-09-22 09:09:35 +10:00
codiac d2d7887e0f Handle bat and slime light checks 2023-09-21 14:53:32 +10:00
Michieal b2ebcf5d4f Readme Change
Putting my name back into the credits in the mod.
2023-09-20 06:07:13 +00:00
Michieal f57220f784 Fix Server crash (Issue ##3939)
Fixes the error of pointed_thing being nil (null) by first checking to see if it exists, and if not, exit the on_place call back.
2023-09-20 05:57:49 +00:00
codiac 7577d37b38 Clarify MC version for lighting 2023-09-20 15:56:27 +10:00
codiac bf4c7e1913 Allow non monsters spawns too 2023-09-20 09:24:51 +10:00
codiac 11e3674926 Use MC 1.18 light levels to control mob spawning 2023-09-19 11:18:40 +10:00
Dehydrate6684 cc217d0089
Removed unnessary node definitions 2023-09-17 17:13:50 +08:00
Dehydrate6684 e6653b78ee
Added directional checks 2023-09-17 17:04:24 +08:00
Dehydrate6684 a960bf2e8e
Update trapdoor climbable behavior 2023-09-16 13:16:49 +08:00
Eliy21 2d9bffaa43 Update settingtypes.txt
Add the no bed respawn in settings
2023-09-11 19:42:04 +00:00
Eliy21 eb658a4996 Update mods/PLAYER/mcl_spawn/init.lua
Add if then condition for no bed/anchor respawn settings
2023-09-11 19:38:33 +00:00
Julien Palard 878480d010
mcl_oxidation: typo in README. 2023-09-02 15:18:30 +02:00
chmodsayshello 49bd28e109 add/remove comments 2023-08-31 18:16:34 +02:00
chmodsayshello 6c107ce990 fix for enchanted items 2023-08-31 17:59:46 +02:00
chmodsayshello 7c43c15fda update loottables 2023-08-31 17:17:38 +02:00
chmodsayshello 291cbaf434 move armor trim license info to LEGAL.md 2023-08-28 18:48:37 +02:00
chmodsayshello fb74689f3d resolve merge conflicts 2023-08-28 16:47:31 +02:00
chmodsayshello da024bb4b8 move mcl_armor_trims to mcl_armor 2023-08-28 15:09:48 +02:00
chmodsayshello 2f8bb9726b meta based: proof of concept 2023-08-27 21:44:43 +02:00
chmodsayshello 8176e7319f update 'armor trim credits' 2023-08-27 19:42:40 +02:00
chmodsayshello 64bc57c6a4 replace trim textures with CC ones 2023-08-18 16:47:17 +02:00
chmodsayshello d346aa07ee reduce filesize for a FINAL time 2023-06-29 20:46:39 +02:00
chmodsayshello 9d1840f4ca fix crash (no longer allow blacklisted items) 2023-06-21 12:15:41 +02:00
chmodsayshello 5cc9038169 reduce texture filesize (again) 2023-06-21 11:51:03 +02:00
chmodsayshello 460ef23b50 make upgrade_trimmed global 2023-06-21 11:49:21 +02:00
chmodsayshello 1e16647fe9 various codestyle fixes 2023-06-21 11:21:39 +02:00
chmodsayshello 16415ae577 bring back old global function 2023-06-21 10:57:50 +02:00
chmodsayshello 2665980007 add ':' to modname once 2023-06-21 10:53:41 +02:00
chmodsayshello bb2ce9ef92 pare down a few bytes from textures 2023-06-17 20:16:36 +02:00
chmodsayshello bc29e4dd95 fix texture filename 2023-06-08 10:41:49 +02:00
chmodsayshello b76ed92aba add missing rib_boots texture 2023-06-08 10:38:30 +02:00
chmodsayshello 703f1f46fc make slot names fit 2023-06-08 10:06:26 +02:00
chmodsayshello 0b118c170e armor trims: support smithing table 2023-06-08 10:02:00 +02:00
chmodsayshello 8431ac34d0 add armor trim templates 2023-06-08 00:16:57 +02:00
chmodsayshello 049128972f armor trim: more color transparency & creative inventory removal 2023-06-07 22:49:04 +02:00
chmodsayshello 0c65d9d11a add mcl_enchanting as hard dependency 2023-06-07 22:29:59 +02:00
chmodsayshello 311beeb31c fix enchanting of trimmed armor 2023-06-07 22:27:52 +02:00
chmodsayshello bc3da8dab8 add armor trim color support 2023-06-07 21:01:55 +02:00
chmodsayshello ed5232411b remove raw trim textures 2023-06-07 20:31:54 +02:00
chmodsayshello 6c6a27320d add trim boot textures 2023-06-07 20:30:10 +02:00
chmodsayshello 82f2f4784e add helm trim textures 2023-06-07 20:13:18 +02:00
chmodsayshello 8476865ea7 add chestplate trim texture 2023-06-07 19:47:51 +02:00
chmodsayshello b4273af245 fix color overlay 2023-06-07 17:22:57 +02:00
chmodsayshello 483285a612 loop through tools instead of items 2023-06-07 17:12:02 +02:00
chmodsayshello b154f2def1 armor trims: inventory overlay 2023-06-07 17:06:53 +02:00
chmodsayshello c62195662c trims: blacklist certain iems 2023-06-07 16:42:34 +02:00
chmodsayshello 4dc5ad3bdb add mcl_armor dependency 2023-06-07 16:11:07 +02:00
chmodsayshello cc186cc588 add durability back 2023-06-07 15:58:28 +02:00
chmodsayshello df8c9625e4 armor trims: proof of concept 2023-06-07 15:41:53 +02:00
203 changed files with 2029 additions and 717 deletions

View File

@ -178,6 +178,7 @@
* Faerraven / Michieal * Faerraven / Michieal
* Nicu * Nicu
* Exhale * Exhale
* Aeonix_Aeon
* Wbjitscool * Wbjitscool
* SmokeyDope * SmokeyDope

View File

@ -42,6 +42,10 @@ The glazed terracotta textures have been created by [MysticTempest](https://gith
Source: <https://www.planetminecraft.com/texture_pack/131pixel-perfection/> Source: <https://www.planetminecraft.com/texture_pack/131pixel-perfection/>
License: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/) License: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)
Armor trim models were created by Aeonix_Aeon
Source: <https://www.curseforge.com/minecraft/texture-packs/ozocraft-remix>
License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
The main menu images are released under: [CC0](https://creativecommons.org/publicdomain/zero/1.0/) The main menu images are released under: [CC0](https://creativecommons.org/publicdomain/zero/1.0/)
All other files, unless mentioned otherwise, fall under: All other files, unless mentioned otherwise, fall under:

View File

@ -11,4 +11,4 @@ For example, Copper Blocks have the definition arguement of `_mcl_waxed_variant
For waxed nodes, scraping is easy. Start by putting `waxed = 1` into the list of groups of the waxed node. For waxed nodes, scraping is easy. Start by putting `waxed = 1` into the list of groups of the waxed node.
Next put `_mcl_stripped_variant = item string of the unwaxed variant of the node` into the defintion table. Next put `_mcl_stripped_variant = item string of the unwaxed variant of the node` into the defintion table.
Wxaed Copper Blocks can be scrapped into normal Copper Blocks because of the definition `_mcl_stripped_variant = "mcl_copper:block"`. Waxed Copper Blocks can be scrapped into normal Copper Blocks because of the definition `_mcl_stripped_variant = "mcl_copper:block"`.

View File

@ -74,6 +74,18 @@ function mcl_util.check_dtime_timer(self, dtime, timer_name, threshold)
return false return false
end end
-- While we should always favour the new minetest vector functions such as vector.new or vector.offset which validate on
-- creation. There may be cases where state gets corrupted and we may have to check the vector is valid if created the
-- old way. This allows us to do this as a tactical solution until old style vectors are completely removed.
function mcl_util.validate_vector (vect)
if vect then
if tonumber(vect.x) and tonumber(vect.y) and tonumber(vect.z) then
return true
end
end
return false
end
-- Minetest 5.3.0 or less can only measure the light level. This came in at 5.4 -- Minetest 5.3.0 or less can only measure the light level. This came in at 5.4
-- This function has been known to fail in multiple places so the error handling is added increase safety and improve -- This function has been known to fail in multiple places so the error handling is added increase safety and improve
-- debugging. See: -- debugging. See:
@ -612,7 +624,7 @@ function mcl_util.deal_damage(target, damage, mcl_reason)
end end
return return
end end
end elseif not target:is_player() then return end
local is_immortal = target:get_armor_groups().immortal or 0 local is_immortal = target:get_armor_groups().immortal or 0
if is_immortal>0 then if is_immortal>0 then

View File

@ -62,8 +62,13 @@ end
local function set_double_attach(boat) local function set_double_attach(boat)
boat._driver:set_attach(boat.object, "", boat._driver:set_attach(boat.object, "",
{x = 0, y = 0.42, z = 0.8}, {x = 0, y = 0, z = 0}) {x = 0, y = 0.42, z = 0.8}, {x = 0, y = 0, z = 0})
if boat._passenger:is_player() then
boat._passenger:set_attach(boat.object, "", boat._passenger:set_attach(boat.object, "",
{x = 0, y = 0.42, z = -2.2}, {x = 0, y = 0, z = 0}) {x = 0, y = 0.42, z = -6.2}, {x = 0, y = 0, z = 0})
else
boat._passenger:set_attach(boat.object, "",
{x = 0, y = 0.42, z = -4.5}, {x = 0, y = 270, z = 0})
end
end end
local function set_choat_attach(boat) local function set_choat_attach(boat)
boat._driver:set_attach(boat.object, "", boat._driver:set_attach(boat.object, "",
@ -155,7 +160,7 @@ local boat = {
minetest.register_on_respawnplayer(detach_object) minetest.register_on_respawnplayer(detach_object)
function boat.on_rightclick(self, clicker) function boat.on_rightclick(self, clicker)
if self._passenger or not clicker or clicker:get_attach() then if self._passenger or not clicker or clicker:get_attach() or (self.name == "mcl_boats:chest_boat" and self._driver) then
return return
end end
attach_object(self, clicker) attach_object(self, clicker)

View File

@ -21,7 +21,7 @@ mcl_dripping.register_drop({
-- The group the liquid's nodes belong to -- The group the liquid's nodes belong to
liquid = "water", liquid = "water",
-- The texture used (particles will take a random 2x2 area of it) -- The texture used (particles will take a random 2x2 area of it)
texture = "default_water_source_animated.png", texture = "mcl_core_water_source_animation.png",
-- Define particle glow, ranges from `0` to `minetest.LIGHT_MAX` -- Define particle glow, ranges from `0` to `minetest.LIGHT_MAX`
light = 1, light = 1,
-- The nodes (or node group) the particles will spawn under -- The nodes (or node group) the particles will spawn under

View File

@ -82,7 +82,7 @@ end
mcl_dripping.register_drop({ mcl_dripping.register_drop({
liquid = "water", liquid = "water",
texture = "default_water_source_animated.png", texture = "mcl_core_water_source_animation.png",
light = 1, light = 1,
nodes = { "group:opaque", "group:leaves" }, nodes = { "group:opaque", "group:leaves" },
sound = "drippingwater_drip", sound = "drippingwater_drip",
@ -92,7 +92,7 @@ mcl_dripping.register_drop({
mcl_dripping.register_drop({ mcl_dripping.register_drop({
liquid = "lava", liquid = "lava",
texture = "default_lava_source_animated.png", texture = "mcl_core_lava_source_animation.png",
light = math.max(7, minetest.registered_nodes["mcl_core:lava_source"].light_source - 3), light = math.max(7, minetest.registered_nodes["mcl_core:lava_source"].light_source - 3),
nodes = { "group:opaque" }, nodes = { "group:opaque" },
sound = "drippingwater_lavadrip", sound = "drippingwater_lavadrip",

View File

@ -21,6 +21,8 @@ local function atan(x)
end end
end end
mcl_mobs.effect_functions = {}
-- check if daytime and also if mob is docile during daylight hours -- check if daytime and also if mob is docile during daylight hours
function mob_class:day_docile() function mob_class:day_docile()
@ -382,7 +384,8 @@ function mob_class:monster_attack()
-- find specific mob to attack, failing that attack player/npc/animal -- find specific mob to attack, failing that attack player/npc/animal
if specific_attack(self.specific_attack, name) if specific_attack(self.specific_attack, name)
and (type == "player" or ( type == "npc" and self.attack_npcs ) and (type == "player" or ( type == "npc" and self.attack_npcs )
or (type == "animal" and self.attack_animals == true)) then or (type == "animal" and self.attack_animals == true)
or (self.extra_hostile and not self.attack_exception(player))) then
p = player:get_pos() p = player:get_pos()
sp = s sp = s
@ -1103,6 +1106,11 @@ function mob_class:do_states_attack (dtime)
full_punch_interval = 1.0, full_punch_interval = 1.0,
damage_groups = {fleshy = self.damage} damage_groups = {fleshy = self.damage}
}, nil) }, nil)
if self.dealt_effect then
mcl_mobs.effect_functions[self.dealt_effect.name](
self.attack, self.dealt_effect.factor, self.dealt_effect.dur
)
end
end end
else else
self.custom_attack(self, p) self.custom_attack(self, p)
@ -1209,6 +1217,9 @@ function mob_class:do_states_attack (dtime)
end end
end end
end end
elseif self.attack_type == "custom" and self.attack_state then
self.attack_state(self, dtime)
else else
end end

View File

@ -1,5 +1,7 @@
local math, tonumber, vector, minetest, mcl_mobs = math, tonumber, vector, minetest, mcl_mobs local math, tonumber, vector, minetest, mcl_mobs = math, tonumber, vector, minetest, mcl_mobs
local mob_class = mcl_mobs.mob_class local mob_class = mcl_mobs.mob_class
local validate_vector = mcl_util.validate_vector
local active_particlespawners = {} local active_particlespawners = {}
local disable_blood = minetest.settings:get_bool("mobs_disable_blood") local disable_blood = minetest.settings:get_bool("mobs_disable_blood")
local DEFAULT_FALL_SPEED = -9.81*1.5 local DEFAULT_FALL_SPEED = -9.81*1.5
@ -9,16 +11,6 @@ local PATHFINDING = "gowp"
local player_transfer_distance = tonumber(minetest.settings:get("player_transfer_distance")) or 128 local player_transfer_distance = tonumber(minetest.settings:get("player_transfer_distance")) or 128
if player_transfer_distance == 0 then player_transfer_distance = math.huge end if player_transfer_distance == 0 then player_transfer_distance = math.huge end
local function validate_vector (vect)
if vect then
if tonumber(vect.x) and tonumber(vect.y) and tonumber(vect.z) then
return true
end
end
return false
end
-- custom particle effects -- custom particle effects
function mcl_mobs.effect(pos, amount, texture, min_size, max_size, radius, gravity, glow, go_down) function mcl_mobs.effect(pos, amount, texture, min_size, max_size, radius, gravity, glow, go_down)
@ -418,7 +410,7 @@ function mob_class:check_head_swivel(dtime)
--final_rotation = vector.new(0,0,0) --final_rotation = vector.new(0,0,0)
end end
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), final_rotation) mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horizontal_head_height), final_rotation)
end end

View File

@ -147,7 +147,7 @@ function mcl_mobs.register_mob(name, def)
head_eye_height = def.head_eye_height or def.bone_eye_height or 0, -- how hight aproximatly the mobs head is fromm the ground to tell the mob how high to look up at the player head_eye_height = def.head_eye_height or def.bone_eye_height or 0, -- how hight aproximatly the mobs head is fromm the ground to tell the mob how high to look up at the player
curiosity = def.curiosity or 1, -- how often mob will look at player on idle curiosity = def.curiosity or 1, -- how often mob will look at player on idle
head_yaw = def.head_yaw or "y", -- axis to rotate head on head_yaw = def.head_yaw or "y", -- axis to rotate head on
horrizonatal_head_height = def.horrizonatal_head_height or 0, horizontal_head_height = def.horizontal_head_height or 0,
wears_armor = def.wears_armor, -- a number value used to index texture slot for armor wears_armor = def.wears_armor, -- a number value used to index texture slot for armor
stepheight = def.stepheight or 0.6, stepheight = def.stepheight or 0.6,
name = name, name = name,
@ -287,6 +287,7 @@ function mcl_mobs.register_mob(name, def)
spawn_in_group_min = def.spawn_in_group_min, spawn_in_group_min = def.spawn_in_group_min,
noyaw = def.noyaw or false, noyaw = def.noyaw or false,
particlespawners = def.particlespawners, particlespawners = def.particlespawners,
spawn_check = def.spawn_check,
-- End of MCL2 extensions -- End of MCL2 extensions
on_spawn = def.on_spawn, on_spawn = def.on_spawn,
on_blast = def.on_blast or function(self,damage) on_blast = def.on_blast or function(self,damage)
@ -297,6 +298,7 @@ function mcl_mobs.register_mob(name, def)
return false, true, {} return false, true, {}
end, end,
do_punch = def.do_punch, do_punch = def.do_punch,
deal_damage = def.deal_damage,
on_breed = def.on_breed, on_breed = def.on_breed,
on_grown = def.on_grown, on_grown = def.on_grown,
on_pick_up = def.on_pick_up, on_pick_up = def.on_pick_up,
@ -311,8 +313,15 @@ function mcl_mobs.register_mob(name, def)
return self:mob_activate(staticdata, def, dtime) return self:mob_activate(staticdata, def, dtime)
end, end,
attack_state = def.attack_state,
harmed_by_heal = def.harmed_by_heal, harmed_by_heal = def.harmed_by_heal,
on_lightning_strike = def.on_lightning_strike is_boss = def.is_boss,
dealt_effect = def.dealt_effect,
on_lightning_strike = def.on_lightning_strike,
extra_hostile = def.extra_hostile,
attack_exception = def.attack_exception or function(p) return false end,
_spawner = def._spawner,
} }
minetest.register_entity(name, setmetatable(final_def,mcl_mobs.mob_class_meta)) minetest.register_entity(name, setmetatable(final_def,mcl_mobs.mob_class_meta))
@ -343,9 +352,10 @@ function mcl_mobs.register_arrow(name, def)
collisionbox = {0, 0, 0, 0, 0, 0}, -- remove box around arrows collisionbox = {0, 0, 0, 0, 0, 0}, -- remove box around arrows
timer = 0, timer = 0,
switch = 0, switch = 0,
_lifetime = def._lifetime or 150,
owner_id = def.owner_id, owner_id = def.owner_id,
rotate = def.rotate, rotate = def.rotate,
on_punch = function(self) on_punch = def.on_punch or function(self)
local vel = self.object:get_velocity() local vel = self.object:get_velocity()
self.object:set_velocity({x=vel.x * -1, y=vel.y * -1, z=vel.z * -1}) self.object:set_velocity({x=vel.x * -1, y=vel.y * -1, z=vel.z * -1})
end, end,
@ -362,7 +372,7 @@ function mcl_mobs.register_arrow(name, def)
local pos = self.object:get_pos() local pos = self.object:get_pos()
if self.switch == 0 if self.switch == 0
or self.timer > 150 or self.timer > self._lifetime
or not within_limits(pos, 0) then or not within_limits(pos, 0) then
mcl_burning.extinguish(self.object) mcl_burning.extinguish(self.object)
self.object:remove(); self.object:remove();

View File

@ -1,5 +1,6 @@
local math, vector, minetest, mcl_mobs = math, vector, minetest, mcl_mobs local math, vector, minetest, mcl_mobs = math, vector, minetest, mcl_mobs
local mob_class = mcl_mobs.mob_class local mob_class = mcl_mobs.mob_class
local validate_vector = mcl_util.validate_vector
local ENTITY_CRAMMING_MAX = 24 local ENTITY_CRAMMING_MAX = 24
local CRAMMING_DAMAGE = 3 local CRAMMING_DAMAGE = 3
@ -355,7 +356,7 @@ function mob_class:set_yaw(yaw, delay, dtime)
if math.abs(target_shortest_path_nums) > 10 then if math.abs(target_shortest_path_nums) > 10 then
self.object:set_yaw(self.object:get_yaw()+(target_shortest_path*(3.6*ddtime))) self.object:set_yaw(self.object:get_yaw()+(target_shortest_path*(3.6*ddtime)))
if self.acc then if validate_vector(self.acc) then
self.acc=vector.rotate_around_axis(self.acc,vector.new(0,1,0), target_shortest_path*(3.6*ddtime)) self.acc=vector.rotate_around_axis(self.acc,vector.new(0,1,0), target_shortest_path*(3.6*ddtime))
end end
end end
@ -681,6 +682,9 @@ function mob_class:do_env_damage()
-- don't fall when on ignore, just stand still -- don't fall when on ignore, just stand still
if self.standing_in == "ignore" then if self.standing_in == "ignore" then
self.object:set_velocity({x = 0, y = 0, z = 0}) self.object:set_velocity({x = 0, y = 0, z = 0})
-- wither rose effect
elseif self.standing_in == "mcl_flowers:wither_rose" then
mcl_potions.withering_func(self.object, 1, 2)
end end
local nodef = minetest.registered_nodes[self.standing_in] local nodef = minetest.registered_nodes[self.standing_in]

View File

@ -2,6 +2,13 @@
local math, vector, minetest, mcl_mobs = math, vector, minetest, mcl_mobs local math, vector, minetest, mcl_mobs = math, vector, minetest, mcl_mobs
local mob_class = mcl_mobs.mob_class local mob_class = mcl_mobs.mob_class
local modern_lighting = minetest.settings:get_bool("mcl_mobs_modern_lighting", true)
local nether_threshold = tonumber(minetest.settings:get("mcl_mobs_nether_threshold")) or 11
local end_threshold = tonumber(minetest.settings:get("mcl_mobs_end_threshold")) or 0
local overworld_threshold = tonumber(minetest.settings:get("mcl_mobs_overworld_threshold")) or 0
local overworld_sky_threshold = tonumber(minetest.settings:get("mcl_mobs_overworld_sky_threshold")) or 7
local overworld_passive_threshold = tonumber(minetest.settings:get("mcl_mobs_overworld_passive_threshold")) or 7
local get_node = minetest.get_node local get_node = minetest.get_node
local get_item_group = minetest.get_item_group local get_item_group = minetest.get_item_group
local get_node_light = minetest.get_node_light local get_node_light = minetest.get_node_light
@ -709,9 +716,6 @@ local function spawn_check(pos, spawn_def)
and spawn_def.dimension == dimension and spawn_def.dimension == dimension
and biome_check(spawn_def.biomes, gotten_biome) then and biome_check(spawn_def.biomes, gotten_biome) then
--mcl_log("Level 1 spawn check passed")
--minetest.log("Mob: " .. mob_def.name)
if (is_ground or spawn_def.type_of_spawning ~= "ground") if (is_ground or spawn_def.type_of_spawning ~= "ground")
and (spawn_def.type_of_spawning ~= "ground" or not is_leaf) and (spawn_def.type_of_spawning ~= "ground" or not is_leaf)
and (not is_farm_animal(spawn_def.name) or is_grass) and (not is_farm_animal(spawn_def.name) or is_grass)
@ -721,20 +725,42 @@ local function spawn_check(pos, spawn_def)
and (spawn_def.check_position and spawn_def.check_position(pos) or spawn_def.check_position == nil) and (spawn_def.check_position and spawn_def.check_position(pos) or spawn_def.check_position == nil)
and ( not spawn_protected or not minetest.is_protected(pos, "") ) then and ( not spawn_protected or not minetest.is_protected(pos, "") ) then
--mcl_log("Level 2 spawn check passed")
local gotten_light = get_node_light(pos) local gotten_light = get_node_light(pos)
if gotten_light >= spawn_def.min_light and gotten_light <= spawn_def.max_light then
--mcl_log("Level 3 spawn check passed") if modern_lighting then
local my_node = get_node(pos)
local sky_light = minetest.get_natural_light(pos)
local art_light = minetest.get_artificial_light(my_node.param1)
if dimension == "nether" then
if art_light <= nether_threshold then
return true
end
elseif dimension == "end" then
if art_light <= end_threshold then
return true
end
elseif dimension == "overworld" then
if mob_type == "monster" then
if mob_def.spawn_check then
return mob_def.spawn_check(pos, gotten_light, art_light, sky_light)
elseif art_light <= overworld_threshold and sky_light <= overworld_sky_threshold then
return true return true
else
--mcl_log("Spawn check level 3 failed")
end end
else else
--mcl_log("Spawn check level 2 failed") if mob_def.spawn_check then
return mob_def.spawn_check(pos, gotten_light, art_light, sky_light)
elseif gotten_light > overworld_passive_threshold then
return true
end
end
end end
else else
--mcl_log("Spawn check level 1 failed") if gotten_light >= spawn_def.min_light and gotten_light <= spawn_def.max_light then
return true
end
end
end
end end
return false return false
end end

View File

@ -2,6 +2,9 @@ local dim = {"x", "z"}
local modpath = minetest.get_modpath(minetest.get_current_modname()) local modpath = minetest.get_modpath(minetest.get_current_modname())
local anti_troll = minetest.settings:get_bool("wither_anti_troll_measures", false)
local peaceful = minetest.settings:get_bool("only_peaceful_mobs", false)
local function load_schem(filename) local function load_schem(filename)
local file = io.open(modpath .. "/schems/" .. filename, "r") local file = io.open(modpath .. "/schems/" .. filename, "r")
local data = minetest.deserialize(file:read()) local data = minetest.deserialize(file:read())
@ -9,6 +12,14 @@ local function load_schem(filename)
return data return data
end end
local wboss_overworld = 0
local wboss_nether = 0
local wboss_end = 0
local LIM_OVERWORLD = tonumber(minetest.settings:get("wither_cap_overworld")) or 3
local LIM_NETHER = tonumber(minetest.settings:get("wither_cap_nether")) or 10
local LIM_END = tonumber(minetest.settings:get("wither_cap_end")) or 5
local wither_spawn_schems = {} local wither_spawn_schems = {}
for _, d in pairs(dim) do for _, d in pairs(dim) do
@ -16,8 +27,13 @@ for _, d in pairs(dim) do
end end
local function check_schem(pos, schem) local function check_schem(pos, schem)
local cn_name
for _, n in pairs(schem) do for _, n in pairs(schem) do
if minetest.get_node(vector.add(pos, n)).name ~= n.name then cn_name = minetest.get_node(vector.add(pos, n)).name
if string.find(cn_name, "mcl_heads:wither_skeleton") then
cn_name = "mcl_heads:wither_skeleton"
end
if cn_name ~= n.name then
return false return false
end end
end end
@ -30,14 +46,32 @@ local function remove_schem(pos, schem)
end end
end end
local function wither_spawn(pos) local function check_limit(pos)
local dim = mcl_worlds.pos_to_dimension(pos)
if dim == "overworld" and wboss_overworld >= LIM_OVERWORLD then return false
elseif dim == "end" and wboss_end >= LIM_END then return false
elseif wboss_nether >= LIM_NETHER then return false
else return true end
end
local function wither_spawn(pos, player)
if peaceful then return end
for _, d in pairs(dim) do for _, d in pairs(dim) do
for i = 0, 2 do for i = 0, 2 do
local p = vector.add(pos, {x = 0, y = -2, z = 0, [d] = -i}) local p = vector.add(pos, {x = 0, y = -2, z = 0, [d] = -i})
local schem = wither_spawn_schems[d] local schem = wither_spawn_schems[d]
if check_schem(p, schem) then if check_schem(p, schem) and (not anti_troll or check_limit(pos)) then
remove_schem(p, schem) remove_schem(p, schem)
minetest.add_entity(vector.add(p, {x = 0, y = 1, z = 0, [d] = 1}), "mobs_mc:wither") local wither = minetest.add_entity(vector.add(p, {x = 0, y = 1, z = 0, [d] = 1}), "mobs_mc:wither")
if not wither then return end
local wither_ent = wither:get_luaentity()
wither_ent._spawner = player:get_player_name()
local dim = mcl_worlds.pos_to_dimension(pos)
if dim == "overworld" then
wboss_overworld = wboss_overworld + 1
elseif dim == "end" then
wboss_end = wboss_end + 1
else wboss_nether = wboss_nether + 1 end
local objects = minetest.get_objects_inside_radius(pos, 20) local objects = minetest.get_objects_inside_radius(pos, 20)
for _, players in ipairs(objects) do for _, players in ipairs(objects) do
if players:is_player() then if players:is_player() then
@ -54,7 +88,19 @@ local old_on_place = wither_head.on_place
function wither_head.on_place(itemstack, placer, pointed) function wither_head.on_place(itemstack, placer, pointed)
local n = minetest.get_node(vector.offset(pointed.above,0,-1,0)) local n = minetest.get_node(vector.offset(pointed.above,0,-1,0))
if n and n.name == "mcl_nether:soul_sand" then if n and n.name == "mcl_nether:soul_sand" then
minetest.after(0, wither_spawn, pointed.above) minetest.after(0, wither_spawn, pointed.above, placer)
end end
return old_on_place(itemstack, placer, pointed) return old_on_place(itemstack, placer, pointed)
end end
if anti_troll then
-- pull wither counts per dimension
minetest.register_globalstep(function(dtime)
wboss_overworld = mobs_mc.wither_count_overworld
wboss_nether = mobs_mc.wither_count_nether
wboss_end = mobs_mc.wither_count_end
mobs_mc.wither_count_overworld = 0
mobs_mc.wither_count_nether = 0
mobs_mc.wither_count_end = 0
end)
end

View File

@ -13,7 +13,7 @@ local axolotl = {
head_swivel = "head.control", head_swivel = "head.control",
bone_eye_height = -1, bone_eye_height = -1,
head_eye_height = -0.5, head_eye_height = -0.5,
horrizonatal_head_height = 0, horizontal_head_height = 0,
curiosity = 10, curiosity = 10,
head_yaw="z", head_yaw="z",
@ -78,7 +78,6 @@ local axolotl = {
attack_animals = true, attack_animals = true,
specific_attack = { specific_attack = {
"extra_mobs_cod", "extra_mobs_cod",
"mobs_mc:sheep",
"extra_mobs_glow_squid", "extra_mobs_glow_squid",
"extra_mobs_salmon", "extra_mobs_salmon",
"extra_mobs_tropical_fish", "extra_mobs_tropical_fish",

View File

@ -2,6 +2,18 @@
local S = minetest.get_translator("mobs_mc") local S = minetest.get_translator("mobs_mc")
local function spawn_check(pos, environmental_light, artificial_light, sky_light)
local date = os.date("*t")
local maxlight
if (date.month == 10 and date.day >= 20) or (date.month == 11 and date.day <= 3) then
maxlight = 6
else
maxlight = 3
end
return artificial_light <= maxlight
end
mcl_mobs.register_mob("mobs_mc:bat", { mcl_mobs.register_mob("mobs_mc:bat", {
description = S("Bat"), description = S("Bat"),
type = "animal", type = "animal",
@ -50,6 +62,7 @@ mcl_mobs.register_mob("mobs_mc:bat", {
jump = false, jump = false,
fly = true, fly = true,
makes_footstep_sound = false, makes_footstep_sound = false,
spawn_check = spawn_check,
}) })

View File

@ -11,6 +11,9 @@ local mod_target = minetest.get_modpath("mcl_target")
--################### BLAZE --################### BLAZE
--################### --###################
local function spawn_check(pos, environmental_light, artificial_light, sky_light)
return artificial_light <= 11
end
mcl_mobs.register_mob("mobs_mc:blaze", { mcl_mobs.register_mob("mobs_mc:blaze", {
description = S("Blaze"), description = S("Blaze"),
@ -137,6 +140,7 @@ mcl_mobs.register_mob("mobs_mc:blaze", {
}, },
}) })
end, end,
spawn_check = spawn_check,
}) })
mcl_mobs:spawn_specific( mcl_mobs:spawn_specific(

View File

@ -23,7 +23,7 @@ mcl_mobs.register_mob("mobs_mc:chicken", {
head_swivel = "head.control", head_swivel = "head.control",
bone_eye_height = 4, bone_eye_height = 4,
head_eye_height = 1.5, head_eye_height = 1.5,
horrizonatal_head_height = -.3, horizontal_head_height = -.3,
curiosity = 10, curiosity = 10,
head_yaw="z", head_yaw="z",
visual_size = {x=1,y=1}, visual_size = {x=1,y=1},

View File

@ -24,7 +24,7 @@ local cow_def = {
head_swivel = "head.control", head_swivel = "head.control",
bone_eye_height = 10, bone_eye_height = 10,
head_eye_height = 1.1, head_eye_height = 1.1,
horrizonatal_head_height=-1.8, horizontal_head_height=-1.8,
curiosity = 2, curiosity = 2,
head_yaw="z", head_yaw="z",
makes_footstep_sound = true, makes_footstep_sound = true,

View File

@ -50,7 +50,7 @@ mcl_mobs.register_mob("mobs_mc:creeper", {
explosion_strength = 3, explosion_strength = 3,
explosion_radius = 3.5, explosion_radius = 3.5,
explosion_damage_radius = 3.5, explosion_damage_radius = 3.5,
explosiontimer_reset_radius = 6, explosiontimer_reset_radius = 3,
reach = 3, reach = 3,
explosion_timer = 1.5, explosion_timer = 1.5,
allow_fuse_reset = true, allow_fuse_reset = true,
@ -172,7 +172,7 @@ mcl_mobs.register_mob("mobs_mc:creeper_charged", {
explosion_strength = 6, explosion_strength = 6,
explosion_radius = 8, explosion_radius = 8,
explosion_damage_radius = 8, explosion_damage_radius = 8,
explosiontimer_reset_radius = 6, explosiontimer_reset_radius = 3,
reach = 3, reach = 3,
explosion_timer = 1.5, explosion_timer = 1.5,
allow_fuse_reset = true, allow_fuse_reset = true,

View File

@ -136,6 +136,7 @@ mcl_mobs.register_mob("mobs_mc:enderdragon", {
end end
end, end,
fire_resistant = true, fire_resistant = true,
is_boss = true,
}) })

View File

@ -4,12 +4,14 @@
--License for code WTFPL and otherwise stated in readmes --License for code WTFPL and otherwise stated in readmes
local S = minetest.get_translator("mobs_mc") local S = minetest.get_translator("mobs_mc")
local allow_nav_hacks = minetest.settings:get_bool("mcl_mob_allow_nav_hacks ",false)
--################### --###################
--################### IRON GOLEM --################### IRON GOLEM
--################### --###################
local etime = 0 local walk_dist = 40
local tele_dist = 80
mcl_mobs.register_mob("mobs_mc:iron_golem", { mcl_mobs.register_mob("mobs_mc:iron_golem", {
description = S("Iron Golem"), description = S("Iron Golem"),
@ -85,11 +87,23 @@ mcl_mobs.register_mob("mobs_mc:iron_golem", {
punch_start = 40, punch_end = 50, punch_start = 40, punch_end = 50,
}, },
jump = true, jump = true,
on_step = function(self,dtime) do_custom = function(self, dtime)
etime = etime + dtime self.home_timer = (self.home_timer or 0) + dtime
if etime > 10 then
if self._home and vector.distance(self._home,self.object:get_pos()) > 50 then if self.home_timer > 10 then
self:gopath(self._home) self.home_timer = 0
if self._home and self.state ~= "attack" then
local dist = vector.distance(self._home,self.object:get_pos())
if allow_nav_hacks and dist >= tele_dist then
self.object:set_pos(self._home)
self.state = "stand"
self.order = "follow"
elseif dist >= walk_dist then
self:gopath(self._home, function(self)
self.state = "stand"
self.order = "follow"
end)
end
end end
end end
end, end,

View File

@ -62,7 +62,7 @@ mcl_mobs.register_mob("mobs_mc:llama", {
head_swivel = "head.control", head_swivel = "head.control",
bone_eye_height = 11, bone_eye_height = 11,
head_eye_height = 3, head_eye_height = 3,
horrizonatal_head_height=0, horizontal_head_height=0,
curiosity = 60, curiosity = 60,
head_yaw = "z", head_yaw = "z",

View File

@ -2,4 +2,4 @@ name = mobs_mc
author = maikerumine author = maikerumine
description = Adds Minecraft-like monsters and animals. description = Adds Minecraft-like monsters and animals.
depends = mcl_init, mcl_particles, mcl_mobs, mcl_wip, mcl_core, mcl_util depends = mcl_init, mcl_particles, mcl_mobs, mcl_wip, mcl_core, mcl_util
optional_depends = default, mcl_tnt, mcl_bows, mcl_throwing, mcl_fishing, bones, mesecons_materials, doc_items optional_depends = default, mcl_tnt, mcl_bows, mcl_throwing, mcl_fishing, bones, mesecons_materials, doc_items, mcl_worlds

View File

@ -39,7 +39,7 @@ local ocelot = {
head_swivel = "head.control", head_swivel = "head.control",
bone_eye_height = 6.2, bone_eye_height = 6.2,
head_eye_height = 0.4, head_eye_height = 0.4,
horrizonatal_head_height=-0, horizontal_head_height=-0,
head_yaw="z", head_yaw="z",
curiosity = 4, curiosity = 4,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.69, 0.3}, collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.69, 0.3},

View File

@ -137,7 +137,7 @@ mcl_mobs.register_mob("mobs_mc:parrot", {
xp_max = 3, xp_max = 3,
head_swivel = "head.control", head_swivel = "head.control",
bone_eye_height = 1.1, bone_eye_height = 1.1,
horrizonatal_head_height=0, horizontal_head_height=0,
curiosity = 10, curiosity = 10,
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25}, collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
visual = "mesh", visual = "mesh",

View File

@ -22,7 +22,7 @@ mcl_mobs.register_mob("mobs_mc:pig", {
head_swivel = "head.control", head_swivel = "head.control",
bone_eye_height = 7.5, bone_eye_height = 7.5,
head_eye_height = 0.8, head_eye_height = 0.8,
horrizonatal_head_height=-1, horizontal_head_height=-1,
curiosity = 3, curiosity = 3,
head_yaw="z", head_yaw="z",
makes_footstep_sound = true, makes_footstep_sound = true,

View File

@ -219,6 +219,10 @@ mcl_mobs.register_mob("mobs_mc:sword_piglin", sword_piglin)
-- Zombified Piglin -- -- Zombified Piglin --
local function spawn_check(pos, environmental_light, artificial_light, sky_light)
return artificial_light <= 11
end
local zombified_piglin = { local zombified_piglin = {
description = S("Zombie Piglin"), description = S("Zombie Piglin"),
-- type="animal", passive=false: This combination is needed for a neutral mob which becomes hostile, if attacked -- type="animal", passive=false: This combination is needed for a neutral mob which becomes hostile, if attacked
@ -256,6 +260,7 @@ local zombified_piglin = {
}, },
jump = true, jump = true,
makes_footstep_sound = true, makes_footstep_sound = true,
spawn_check = spawn_check,
walk_velocity = .8, walk_velocity = .8,
run_velocity = 2.6, run_velocity = 2.6,
pathfinding = 1, pathfinding = 1,

View File

@ -27,7 +27,7 @@ mcl_mobs.register_mob("mobs_mc:polar_bear", {
head_swivel = "head.control", head_swivel = "head.control",
bone_eye_height = 2.6, bone_eye_height = 2.6,
head_eye_height = 1, head_eye_height = 1,
horrizonatal_head_height = 0, horizontal_head_height = 0,
curiosity = 20, curiosity = 20,
head_yaw="z", head_yaw="z",
visual_size = {x=3.0, y=3.0}, visual_size = {x=3.0, y=3.0},

View File

@ -18,7 +18,7 @@ local rabbit = {
head_swivel = "head.control", head_swivel = "head.control",
bone_eye_height = 2, bone_eye_height = 2,
head_eye_height = 0.5, head_eye_height = 0.5,
horrizonatal_head_height = -.3, horizontal_head_height = -.3,
curiosity = 20, curiosity = 20,
head_yaw="z", head_yaw="z",
visual = "mesh", visual = "mesh",

View File

@ -67,7 +67,7 @@ mcl_mobs.register_mob("mobs_mc:sheep", {
head_swivel = "head.control", head_swivel = "head.control",
bone_eye_height = 3.3, bone_eye_height = 3.3,
head_eye_height = 1.1, head_eye_height = 1.1,
horrizonatal_head_height=-.7, horizontal_head_height=-.7,
curiosity = 6, curiosity = 6,
head_yaw="z", head_yaw="z",
visual = "mesh", visual = "mesh",

View File

@ -4,6 +4,10 @@
local S = minetest.get_translator("mobs_mc") local S = minetest.get_translator("mobs_mc")
local function spawn_check(pos, environmental_light, artificial_light, sky_light)
return artificial_light <= 11
end
mcl_mobs.register_mob("mobs_mc:silverfish", { mcl_mobs.register_mob("mobs_mc:silverfish", {
description = S("Silverfish"), description = S("Silverfish"),
type = "monster", type = "monster",
@ -53,6 +57,7 @@ mcl_mobs.register_mob("mobs_mc:silverfish", {
view_range = 16, view_range = 16,
attack_type = "dogfight", attack_type = "dogfight",
damage = 1, damage = 1,
spawn_check = spawn_check,
}) })
mcl_mobs.register_egg("mobs_mc:silverfish", S("Silverfish"), "#6d6d6d", "#313131", 0) mcl_mobs.register_egg("mobs_mc:silverfish", S("Silverfish"), "#6d6d6d", "#313131", 0)

View File

@ -96,6 +96,11 @@ mcl_mobs.register_mob("mobs_mc:witherskeleton", {
fear_height = 4, fear_height = 4,
harmed_by_heal = true, harmed_by_heal = true,
fire_resistant = true, fire_resistant = true,
dealt_effect = {
name = "withering",
factor = 1,
dur = 10,
},
}) })
--spawn --spawn

View File

@ -161,6 +161,18 @@ local spawn_children_on_die = function(child_mob, spawn_distance, eject_speed)
end end
end end
local swamp_light_max = 7
local function slime_spawn_check(pos, environmental_light, artificial_light, sky_light)
local maxlight = swamp_light_max
if is_slime_chunk(pos) then
maxlight = minetest.LIGHT_MAX + 1
end
return artificial_light <= maxlight
end
-- Slime -- Slime
local slime_big = { local slime_big = {
description = S("Slime"), description = S("Slime"),
@ -213,6 +225,7 @@ local slime_big = {
spawn_small_alternative = "mobs_mc:slime_small", spawn_small_alternative = "mobs_mc:slime_small",
on_die = spawn_children_on_die("mobs_mc:slime_small", 1.0, 1.5), on_die = spawn_children_on_die("mobs_mc:slime_small", 1.0, 1.5),
use_texture_alpha = true, use_texture_alpha = true,
spawn_check = slime_spawn_check,
} }
mcl_mobs.register_mob("mobs_mc:slime_big", slime_big) mcl_mobs.register_mob("mobs_mc:slime_big", slime_big)
@ -297,7 +310,6 @@ local cave_min = mcl_vars.mg_overworld_min
local cave_max = water_level - 23 local cave_max = water_level - 23
local swampy_biomes = {"Swampland", "MangroveSwamp"} local swampy_biomes = {"Swampland", "MangroveSwamp"}
local swamp_light_max = 7
local swamp_min = water_level local swamp_min = water_level
local swamp_max = water_level + 27 local swamp_max = water_level + 27

View File

@ -114,9 +114,7 @@ mcl_mobs.register_mob("mobs_mc:spider", spider)
local cave_spider = table.copy(spider) local cave_spider = table.copy(spider)
cave_spider.description = S("Cave Spider") cave_spider.description = S("Cave Spider")
cave_spider.textures = { {"mobs_mc_cave_spider.png^(mobs_mc_spider_eyes.png^[makealpha:0,0,0)"} } cave_spider.textures = { {"mobs_mc_cave_spider.png^(mobs_mc_spider_eyes.png^[makealpha:0,0,0)"} }
-- TODO: Poison damage cave_spider.damage = 2
-- TODO: Revert damage to 2
cave_spider.damage = 3 -- damage increased to undo non-existing poison
cave_spider.hp_min = 1 cave_spider.hp_min = 1
cave_spider.hp_max = 12 cave_spider.hp_max = 12
cave_spider.collisionbox = {-0.35, -0.01, -0.35, 0.35, 0.46, 0.35} cave_spider.collisionbox = {-0.35, -0.01, -0.35, 0.35, 0.46, 0.35}
@ -138,6 +136,11 @@ cave_spider.walk_velocity = 1.3
cave_spider.run_velocity = 3.2 cave_spider.run_velocity = 3.2
cave_spider.sounds = table.copy(spider.sounds) cave_spider.sounds = table.copy(spider.sounds)
cave_spider.sounds.base_pitch = 1.25 cave_spider.sounds.base_pitch = 1.25
cave_spider.dealt_effect = {
name = "poison",
factor = 2.5,
dur = 7,
}
mcl_mobs.register_mob("mobs_mc:cave_spider", cave_spider) mcl_mobs.register_mob("mobs_mc:cave_spider", cave_spider)

View File

@ -70,6 +70,11 @@ mcl_mobs.register_mob("mobs_mc:witch", {
}, },
view_range = 16, view_range = 16,
fear_height = 4, fear_height = 4,
deal_damage = function(self, damage, mcl_reason)
local factor = 1
if mcl_reason.type == "magic" then factor = 0.15 end
self.health = self.health - factor*damage
end,
}) })
-- potion projectile (EXPERIMENTAL) -- potion projectile (EXPERIMENTAL)

View File

@ -1,14 +1,72 @@
--MCmobs v0.4 --MCmobs v0.4
--maikerumine --maikerumine
--updated by Herowl
--made for MC like Survival game --made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes --License for code WTFPL and otherwise stated in readmes
local S = minetest.get_translator("mobs_mc") local S = minetest.get_translator("mobs_mc")
local mobs_griefing = minetest.settings:get_bool("mobs_griefing", true)
local follow_spawner = minetest.settings:get_bool("wither_follow_spawner", false)
local w_strafes = minetest.settings:get_bool("wither_strafes", true)
local anti_troll = minetest.settings:get_bool("wither_anti_troll_measures", false)
local WITHER_INIT_BOOM = 7
local WITHER_MELEE_COOLDOWN = 3
local function atan(x)
if not x or x ~= x then
return 0
else
return math.atan(x)
end
end
--################### --###################
--################### WITHER --################### WITHER
--################### --###################
local function wither_unstuck(self)
local pos = self.object:get_pos()
if mobs_griefing then -- destroy blocks very nearby (basically, colliding with)
local col = self.collisionbox
local pos1 = vector.offset(pos, col[1], col[2], col[3])
local pos2 = vector.offset(pos, col[4], col[5], col[6])
for z = pos1.z, pos2.z do for y = pos1.y, pos2.y do for x = pos1.x, pos2.x do
local npos = vector.new(x,y,z)
local name = minetest.get_node(npos).name
if name ~= "air" then
local ndef = minetest.registered_nodes[name]
if ndef and ndef._mcl_hardness and ndef._mcl_hardness >= 0 then
local drops = minetest.get_node_drops(name, "")
if minetest.dig_node(npos) then
for _, item in ipairs(drops) do
if type(item) ~= "string" then
item = item:get_name() .. item:get_count()
end
minetest.add_item(npos, item)
end
end
end
end
end end end
end
mcl_mobs.mob_class.safe_boom(self, pos, 2)
end
local function get_dim_relative_y(pos)
if (pos.y >= mcl_vars.mg_realm_barrier_overworld_end_max) then
return pos.y
elseif (pos.y <= mcl_vars.mg_nether_max + 200) then
return (pos.y - mcl_vars.mg_nether_min - 20)
else
return (pos.y - mcl_vars.mg_end_min - 50)
end
end
mobs_mc.wither_count_overworld = 0
mobs_mc.wither_count_nether = 0
mobs_mc.wither_count_end = 0
mcl_mobs.register_mob("mobs_mc:wither", { mcl_mobs.register_mob("mobs_mc:wither", {
description = S("Wither"), description = S("Wither"),
type = "monster", type = "monster",
@ -26,11 +84,11 @@ mcl_mobs.register_mob("mobs_mc:wither", {
{"mobs_mc_wither.png"}, {"mobs_mc_wither.png"},
}, },
visual_size = {x=4, y=4}, visual_size = {x=4, y=4},
makes_footstep_sound = true, view_range = 50,
view_range = 16,
fear_height = 4, fear_height = 4,
walk_velocity = 2, walk_velocity = 2,
run_velocity = 4, run_velocity = 4,
strafes = w_strafes,
sounds = { sounds = {
shoot_attack = "mobs_mc_ender_dragon_shoot", shoot_attack = "mobs_mc_ender_dragon_shoot",
attack = "mobs_mc_ender_dragon_attack", attack = "mobs_mc_ender_dragon_attack",
@ -41,9 +99,8 @@ mcl_mobs.register_mob("mobs_mc:wither", {
jump_height = 10, jump_height = 10,
fly = true, fly = true,
makes_footstep_sound = false, makes_footstep_sound = false,
dogshoot_switch = 1, dogshoot_switch = 1, -- unused
dogshoot_count_max = 1, dogshoot_count_max = 1, -- unused
attack_animals = true,
can_despawn = false, can_despawn = false,
drops = { drops = {
{name = "mcl_mobitems:nether_star", {name = "mcl_mobitems:nether_star",
@ -53,13 +110,13 @@ mcl_mobs.register_mob("mobs_mc:wither", {
}, },
lava_damage = 0, lava_damage = 0,
fire_damage = 0, fire_damage = 0,
attack_type = "dogshoot", attack_type = "custom",
explosion_strength = 8, explosion_strength = 8,
dogshoot_stop = true, dogshoot_stop = true,
arrow = "mobs_mc:wither_skull", arrow = "mobs_mc:wither_skull",
reach = 5, reach = 5,
shoot_interval = 0.5, shoot_interval = 1,
shoot_offset = -1, shoot_offset = -0.5,
animation = { animation = {
walk_speed = 12, run_speed = 12, stand_speed = 12, walk_speed = 12, run_speed = 12, stand_speed = 12,
stand_start = 0, stand_end = 20, stand_start = 0, stand_end = 20,
@ -67,49 +124,322 @@ mcl_mobs.register_mob("mobs_mc:wither", {
run_start = 0, run_end = 20, run_start = 0, run_end = 20,
}, },
harmed_by_heal = true, harmed_by_heal = true,
do_custom = function(self) is_boss = true,
extra_hostile = true,
attack_exception = function(p)
local ent = p:get_luaentity()
if p:is_player() then return false end
if not ent or not ent.is_mob or ent.harmed_by_heal or string.find(ent.name, "ghast") then return true
else return false end
end,
do_custom = function(self, dtime)
if self._spawning then
-- "loading" bar while spawning
if not self._spw_max then self._spw_max = self._spawning end
self._spawning = self._spawning - dtime
local bardef = {
color = "dark_purple",
text = "Wither spawning",
percentage = math.floor((self._spw_max - self._spawning) / self._spw_max * 100),
}
local pos = self.object:get_pos()
for _, player in pairs(minetest.get_connected_players()) do
local d = vector.distance(pos, player:get_pos())
if d <= 80 then
mcl_bossbars.add_bar(player, bardef, true, d)
end
end
-- turn around and flash while spawning
self.object:set_yaw(self._spawning*10)
local factor = math.floor((math.sin(self._spawning*10)+1.5) * 85)
local str = minetest.colorspec_to_colorstring({r=factor, g=factor, b=factor})
self.object:set_texture_mod("^[brighten^[multiply:"..str)
-- when fully spawned, explode
if self._spawning <= 0 then
if mobs_griefing and not minetest.is_protected(pos, "") then
mcl_explosions.explode(pos, WITHER_INIT_BOOM, { drop_chance = 1.0 }, self.object)
else
mcl_mobs.mob_class.safe_boom(self, pos, WITHER_INIT_BOOM)
end
self.object:set_texture_mod("")
self._spawning = nil
self._spw_max = nil
else
return false
end
end
-- passive regeneration
self._custom_timer = self._custom_timer + dtime
if self._custom_timer > 1 then
self.health = math.min(self.health + 1, self.hp_max)
self._custom_timer = self._custom_timer - 1
end
-- anti-troll measures
if anti_troll then
if self._spawner then
local spawner = minetest.get_player_by_name(self._spawner)
if follow_spawner and spawner then
self._death_timer = 0
local pos = self.object:get_pos()
local spw = spawner:get_pos()
local dist = vector.distance(pos, spw)
if dist > 60 then -- teleport to the player who spawned the wither
local R = 10
pos.x = spw.x + math.random(-R, R)
pos.y = spw.y + math.random(-R, R)
pos.z = spw.z + math.random(-R, R)
self.object:set_pos(pos)
end
else -- despawn automatically after set time
-- HP changes impact timer: taking damage sets it back
self._death_timer = self._death_timer + self.health - self._health_old
if self.health == self._health_old then self._death_timer = self._death_timer + dtime end
if self._death_timer > 100 then
self.object:remove()
return false
end
self._health_old = self.health
end
end
-- count withers per dimension
local dim = mcl_worlds.pos_to_dimension(self.object:get_pos())
if dim == "overworld" then mobs_mc.wither_count_overworld = mobs_mc.wither_count_overworld + 1
elseif dim == "nether" then mobs_mc.wither_count_nether = mobs_mc.wither_count_nether + 1
elseif dim == "end" then mobs_mc.wither_count_end = mobs_mc.wither_count_end + 1 end
end
-- update things dependent on HP
local rand_factor
if self.health < (self.hp_max / 2) then if self.health < (self.hp_max / 2) then
self.base_texture = "mobs_mc_wither_half_health.png" self.base_texture = "mobs_mc_wither_half_health.png"
self.fly = false self.fly = false
self.object:set_properties({textures={self.base_texture}}) self._arrow_resistant = true
self.armor = {undead = 80, fleshy = 80} rand_factor = 3
else
self.base_texture = "mobs_mc_wither.png"
self.fly = true
self._arrow_resistant = false
rand_factor = 10
end end
if not self.attack then
local y = get_dim_relative_y(self.object:get_pos())
if y > 0 then
self.fly = false
else
self.fly = true
local vel = self.object:get_velocity()
self.object:set_velocity(vector.new(vel.x, self.walk_velocity, vel.z))
end
end
self.object:set_properties({textures={self.base_texture}})
mcl_bossbars.update_boss(self.object, "Wither", "dark_purple") mcl_bossbars.update_boss(self.object, "Wither", "dark_purple")
if math.random(1, rand_factor) < 2 then
self.arrow = "mobs_mc:wither_skull_strong"
else
self.arrow = "mobs_mc:wither_skull"
end
end, end,
attack_state = function(self, dtime)
local s = self.object:get_pos()
local p = self.attack:get_pos() or s
p.y = p.y - .5
s.y = s.y + .5
local dist = vector.distance(p, s)
local vec = {
x = p.x - s.x,
y = p.y - s.y,
z = p.z - s.z
}
local yaw = (atan(vec.z / vec.x) +math.pi/ 2) - self.rotate
if p.x > s.x then yaw = yaw +math.pi end
yaw = self:set_yaw( yaw, 0, dtime)
local stay_away_from_player = vector.zero()
--strafe back and fourth
--stay away from player so as to shoot them
if dist < self.avoid_distance and self.shooter_avoid_enemy then
self:set_animation( "shoot")
stay_away_from_player=vector.multiply(vector.direction(p, s), 0.33)
end
if self.fly then
local vel = self.object:get_velocity()
local diff = s.y - p.y
local FLY_FACTOR = self.walk_velocity
if diff < 10 then
self.object:set_velocity({x=vel.x, y= FLY_FACTOR, z=vel.z})
elseif diff > 15 then
self.object:set_velocity({x=vel.x, y=-FLY_FACTOR, z=vel.z})
end
for i=1, 15 do
if minetest.get_node(vector.offset(s, 0, -i, 0)).name ~= "air" then
self.object:set_velocity({x=vel.x, y= FLY_FACTOR, z=vel.z})
break
elseif minetest.get_node(vector.offset(s, 0, i, 0)).name ~= "air" then
self.object:set_velocity({x=vel.x, y=-FLY_FACTOR/i, z=vel.z})
break
end
end
end
if self.strafes then
if not self.strafe_direction then
self.strafe_direction = 1.57
end
if math.random(40) == 1 then
self.strafe_direction = self.strafe_direction*-1
end
local dir = vector.rotate_around_axis(vector.direction(s, p), vector.new(0,1,0), self.strafe_direction)
local dir2 = vector.multiply(dir, 0.3 * self.walk_velocity)
if dir2 and stay_away_from_player then
self.acc = vector.add(dir2, stay_away_from_player)
end
else
self:set_velocity(0)
end
if dist > 30 then self.acc = vector.add(self.acc, vector.direction(s, p)*0.01) end
local side_cor = vector.new(0.7*math.cos(yaw), 0, 0.7*math.sin(yaw))
local m = self.object:get_pos() -- position of the middle head
local sr = self.object:get_pos() + side_cor -- position of side right head
local sl = self.object:get_pos() - side_cor -- position of side left head
-- height corrections
m.y = m.y + self.collisionbox[5]
sr.y = sr.y + self.collisionbox[5] - 0.3
sl.y = sl.y + self.collisionbox[5] - 0.3
local rand_pos = math.random(1,3)
if rand_pos == 1 then m = sr
elseif rand_pos == 2 then m = sl end
-- melee attack
if not self._melee_timer then
self._melee_timer = 0
end
if self._melee_timer < WITHER_MELEE_COOLDOWN then
self._melee_timer = self._melee_timer + dtime
else
self._melee_timer = 0
local pos = table.copy(s)
pos.y = pos.y + 2
local objs = minetest.get_objects_inside_radius(pos, self.reach)
local obj_pos, dist
local hit_some = false
for n = 1, #objs do
objs[n]:punch(objs[n], 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 4},
}, pos)
local ent = objs[n]:get_luaentity()
if objs[n]:is_player() or (ent and ent ~= self and (not ent._shooter or ent._shooter ~= self)) then
mcl_util.deal_damage(objs[n], 8, {type = "magic"})
hit_some = true
end
mcl_mobs.effect_functions["withering"](objs[n], 0.5, 10)
end
if hit_some then
mcl_mobs.effect(pos, 32, "mcl_particles_soul_fire_flame.png", 5, 10, self.reach, 1, 0)
end
end
if dist < self.reach then
self.shoot_interval = 3
else
self.shoot_interval = 1
end
if self.shoot_interval
and self.timer > self.shoot_interval
and not minetest.raycast(vector.add(m, vector.new(0,self.shoot_offset,0)), vector.add(self.attack:get_pos(), vector.new(0,1.5,0)), false, false):next()
and math.random(1, 100) <= 60 then
self.timer = 0
self:set_animation( "shoot")
-- play shoot attack sound
self:mob_sound("shoot_attack")
-- Shoot arrow
if minetest.registered_entities[self.arrow] then
local arrow, ent
local v = 1
if not self.shoot_arrow then
self.firing = true
minetest.after(1, function()
self.firing = false
end)
arrow = minetest.add_entity(m, self.arrow)
ent = arrow:get_luaentity()
if ent.velocity then
v = ent.velocity
end
ent.switch = 1
ent.owner_id = tostring(self.object) -- add unique owner id to arrow
-- important for mcl_shields
ent._shooter = self.object
ent._saved_shooter_pos = self.object:get_pos()
end
local amount = (vec.x * vec.x + vec.y * vec.y + vec.z * vec.z) ^ 0.5
-- offset makes shoot aim accurate
vec.y = vec.y + self.shoot_offset
vec.x = vec.x * (v / amount)
vec.y = vec.y * (v / amount)
vec.z = vec.z * (v / amount)
if self.shoot_arrow then
vec = vector.normalize(vec)
self:shoot_arrow(m, vec)
else
arrow:set_velocity(vec)
end
end
end
end,
do_punch = function(self, hitter, tflp, tool_capabilities, dir)
if self._spawning or hitter == self.object then return false end
local ent = hitter:get_luaentity()
if ent and self._arrow_resistant and (string.find(ent.name, "arrow") or string.find(ent.name, "rocket")) then return false end
wither_unstuck(self)
return true
end,
deal_damage = function(self, damage, mcl_reason)
if self._spawning then return end
if self._arrow_resistant and mcl_reason.type == "magic" then return end
wither_unstuck(self)
self.health = self.health - damage
end,
on_spawn = function(self) on_spawn = function(self)
minetest.sound_play("mobs_mc_wither_spawn", {object=self.object, gain=1.0, max_hear_distance=64}) minetest.sound_play("mobs_mc_wither_spawn", {object=self.object, gain=1.0, max_hear_distance=64})
self._custom_timer = 0.0
self._death_timer = 0.0
self._health_old = self.hp_max
self._spawning = 10
return true
end, end,
}) })
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
local wither_rose_soil = { "group:grass_block", "mcl_core:dirt", "mcl_core:coarse_dirt", "mcl_nether:netherrack", "group:soul_block", "mcl_mud:mud", "mcl_moss:moss" } local wither_rose_soil = { "group:grass_block", "mcl_core:dirt", "mcl_core:coarse_dirt", "mcl_nether:netherrack", "group:soul_block", "mcl_mud:mud", "mcl_moss:moss" }
local function spawn_wither_rose(obj)
mcl_mobs.register_arrow("mobs_mc:wither_skull", { local n = minetest.find_node_near(obj:get_pos(),2,wither_rose_soil)
visual = "sprite",
visual_size = {x = 0.75, y = 0.75},
-- TODO: 3D projectile, replace tetxture
textures = {"mobs_mc_TEMP_wither_projectile.png"},
velocity = 6,
-- direct hit
hit_player = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 0.5,
damage_groups = {fleshy = 8},
}, nil)
mcl_mobs.mob_class.boom(self,self.object:get_pos(), 1)
end,
hit_mob = function(self, mob)
mob:punch(self.object, 1.0, {
full_punch_interval = 0.5,
damage_groups = {fleshy = 8},
}, nil)
mcl_mobs.mob_class.boom(self,self.object:get_pos(), 1)
local l = mob:get_luaentity()
if l and l.health - 8 <= 0 then
local n = minetest.find_node_near(mob:get_pos(),2,wither_rose_soil)
if n then if n then
local p = vector.offset(n,0,1,0) local p = vector.offset(n,0,1,0)
if minetest.get_node(p).name == "air" then if minetest.get_node(p).name == "air" then
@ -119,6 +449,53 @@ mcl_mobs.register_arrow("mobs_mc:wither_skull", {
end end
end end
end end
mcl_mobs.register_arrow("mobs_mc:wither_skull", {
visual = "cube",
visual_size = {x = 0.3, y = 0.3},
textures = {
"mobs_mc_wither_projectile.png^[verticalframe:6:0", -- top
"mobs_mc_wither_projectile.png^[verticalframe:6:1", -- bottom
"mobs_mc_wither_projectile.png^[verticalframe:6:2", -- left
"mobs_mc_wither_projectile.png^[verticalframe:6:3", -- right
"mobs_mc_wither_projectile.png^[verticalframe:6:4", -- back
"mobs_mc_wither_projectile.png^[verticalframe:6:5", -- front
},
velocity = 7,
rotate = 90,
_lifetime = 350,
on_punch = function(self) end,
-- direct hit
hit_player = function(self, player)
local pos = vector.new(self.object:get_pos())
mcl_mobs.effect_functions["withering"](player, 0.5, 10)
player:punch(self.object, 1.0, {
full_punch_interval = 0.5,
damage_groups = {fleshy = 8},
}, nil)
mcl_mobs.mob_class.boom(self, pos, 1)
if player:get_hp() <= 0 then
local shooter = self._shooter:get_luaentity()
if shooter then shooter.health = shooter.health + 5 end
spawn_wither_rose(player)
end
end,
hit_mob = function(self, mob)
local pos = vector.new(self.object:get_pos())
mcl_mobs.effect_functions["withering"](mob, 0.5, 10)
mob:punch(self.object, 1.0, {
full_punch_interval = 0.5,
damage_groups = {fleshy = 8},
}, nil)
mcl_mobs.mob_class.boom(self, pos, 1)
local l = mob:get_luaentity()
if l and l.health - 8 <= 0 then
local shooter = self._shooter:get_luaentity()
if shooter then shooter.health = shooter.health + 5 end
spawn_wither_rose(mob)
end
end, end,
-- node hit, explode -- node hit, explode
@ -126,10 +503,75 @@ mcl_mobs.register_arrow("mobs_mc:wither_skull", {
mcl_mobs.mob_class.boom(self,pos, 1) mcl_mobs.mob_class.boom(self,pos, 1)
end end
}) })
-- TODO: Add blue wither skull mcl_mobs.register_arrow("mobs_mc:wither_skull_strong", {
visual = "cube",
visual_size = {x = 0.35, y = 0.35},
textures = {
"mobs_mc_wither_projectile_strong.png^[verticalframe:6:0", -- top
"mobs_mc_wither_projectile_strong.png^[verticalframe:6:1", -- bottom
"mobs_mc_wither_projectile_strong.png^[verticalframe:6:2", -- left
"mobs_mc_wither_projectile_strong.png^[verticalframe:6:3", -- right
"mobs_mc_wither_projectile_strong.png^[verticalframe:6:4", -- back
"mobs_mc_wither_projectile_strong.png^[verticalframe:6:5", -- front
},
velocity = 4,
rotate = 90,
_lifetime = 500,
on_punch = function(self) end,
-- direct hit
hit_player = function(self, player)
local pos = vector.new(self.object:get_pos())
mcl_mobs.effect_functions["withering"](player, 0.5, 10)
player:punch(self.object, 1.0, {
full_punch_interval = 0.5,
damage_groups = {fleshy = 12},
}, nil)
if mobs_griefing and not minetest.is_protected(pos, "") then
mcl_explosions.explode(pos, 1, { drop_chance = 1.0, max_blast_resistance = 0, }, self.object)
else
mcl_mobs.mob_class.safe_boom(self, pos, 1) --need to call it this way bc self is the "arrow" object here
end
if player:get_hp() <= 0 then
local shooter = self._shooter:get_luaentity()
if shooter then shooter.health = shooter.health + 5 end
spawn_wither_rose(player)
end
end,
hit_mob = function(self, mob)
local pos = vector.new(self.object:get_pos())
mcl_mobs.effect_functions["withering"](mob, 0.5, 10)
mob:punch(self.object, 1.0, {
full_punch_interval = 0.5,
damage_groups = {fleshy = 12},
}, nil)
if mobs_griefing and not minetest.is_protected(pos, "") then
mcl_explosions.explode(pos, 1, { drop_chance = 1.0, max_blast_resistance = 0, }, self.object)
else
mcl_mobs.mob_class.safe_boom(self, pos, 1) --need to call it this way bc self is the "arrow" object here
end
local l = mob:get_luaentity()
if l and l.health - 8 <= 0 then
local shooter = self._shooter:get_luaentity()
if shooter then shooter.health = shooter.health + 5 end
spawn_wither_rose(mob)
end
end,
-- node hit, explode
hit_node = function(self, pos, node)
if mobs_griefing and not minetest.is_protected(pos, "") then
mcl_explosions.explode(pos, 1, { drop_chance = 1.0, max_blast_resistance = 0, }, self.object)
else
mcl_mobs.mob_class.safe_boom(self, pos, 1) --need to call it this way bc self is the "arrow" object here
end
end
})
--Spawn egg --Spawn egg
mcl_mobs.register_egg("mobs_mc:wither", S("Wither"), "#4f4f4f", "#4f4f4f", 0, true) mcl_mobs.register_egg("mobs_mc:wither", S("Wither"), "#4f4f4f", "#4f4f4f", 0, true)
mcl_wip.register_wip_item("mobs_mc:wither") mcl_wip.register_wip_item("mobs_mc:wither")
mcl_mobs:non_spawn_specific("mobs_mc:wither","overworld",0,minetest.LIGHT_MAX+1) mcl_mobs:non_spawn_specific("mobs_mc:wither","overworld",0,minetest.LIGHT_MAX+1)

View File

@ -29,7 +29,7 @@ local wolf = {
head_swivel = "head.control", head_swivel = "head.control",
bone_eye_height = 3.5, bone_eye_height = 3.5,
head_eye_height = 1.1, head_eye_height = 1.1,
horrizonatal_head_height=0, horizontal_head_height=0,
curiosity = 3, curiosity = 3,
head_yaw="z", head_yaw="z",
sounds = { sounds = {

View File

@ -774,7 +774,7 @@ local function search(data)
for i = 1, #data.items_raw do for i = 1, #data.items_raw do
local item = data.items_raw[i] local item = data.items_raw[i]
local def = reg_items[item] local def = reg_items[item]
local desc = lower(def.description) local desc = string.lower(M.get_translated_string(data.lang_code, def.description))
local search_in = item .. desc local search_in = item .. desc
local to_add local to_add
@ -838,6 +838,7 @@ local function init_data(name)
iX = sfinv_only and 8 or DEFAULT_SIZE, iX = sfinv_only and 8 or DEFAULT_SIZE,
items = init_items, items = init_items,
items_raw = init_items, items_raw = init_items,
lang_code = M.get_player_information(name).lang_code or 'en',
} }
end end

21
mods/HUD/mcl_achievements/init.lua Normal file → Executable file
View File

@ -431,6 +431,27 @@ awards.register_achievement("mcl:wax_off", {
group = "Husbandry", group = "Husbandry",
}) })
-- Triggered in mcl_smithing_table
awards.register_achievement("mcl:trim", {
title = S("Crafting a New Look"),
description = S("Craft a trimmed armor at a Smithing Table"),
icon = "dune_armor_trim_smithing_template.png",
type = "Advancement",
group = "Adventure",
})
awards.register_achievement("mcl:lots_of_trimming", {
title = S("Smithing with Style"),
description = S("Apply these smithing templates at least once: Spire, Snout, Rib, Ward, Silence, Vex, Tide, Wayfinder"),
icon = "silence_armor_trim_smithing_template.png",
type = "Advancement",
group = "Adventure",
on_unlock = function(name, awdef)
-- delete json that is no longer needed
minetest.get_player_by_name(name):get_meta():set_string("mcl_smithing_table:achievement_trims", "")
end,
})
-- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.) -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.)
if non_pc_achievements then if non_pc_achievements then

View File

@ -51,3 +51,7 @@ Bring Home the Beacon=Den Nachbarn heimleuchten
Use a beacon.=Benutzen Sie ein Leuchtfeuer. Use a beacon.=Benutzen Sie ein Leuchtfeuer.
Beaconator=Leuchtturmwärter Beaconator=Leuchtturmwärter
Use a fully powered beacon.=Benutzen Sie ein vollständiges Leuchtfeuer. Use a fully powered beacon.=Benutzen Sie ein vollständiges Leuchtfeuer.
Crafting a New Look=Ein neues Aussehen
Craft a trimmed armor at a Smithing Table=Versieh ein Rüstungsteil an einem Schmiedetisch mit einem Rüstungsbesatz
Smithing with Style=Schmieden mit Stil
Apply these smithing templates at least once: Spire, Snout, Rib, Ward, Silence, Vex, Tide, Wayfinder=Wende jede dieser Schmiedevorlagen mindestens einmal an: Turmspitze, Schnauze, Rippe, Warthof, Stille, Plagegeist, Gezeiten und Wegfinder

4
mods/HUD/mcl_achievements/locale/template.txt Normal file → Executable file
View File

@ -111,3 +111,7 @@ Voluntary Exile=
Kill a raid captain. Maybe consider staying away from the local villages for the time being...= Kill a raid captain. Maybe consider staying away from the local villages for the time being...=
Tactical Fishing= Tactical Fishing=
Catch a fish... without a fishing rod!= Catch a fish... without a fishing rod!=
Crafting a New Look=
Craft a trimmed armor at a Smithing Table=
Smithing with Style=
Apply these smithing templates at least once: Spire, Snout, Rib, Ward, Silence, Vex, Tide, Wayfinder=

View File

@ -741,7 +741,8 @@ if minetest.is_creative_enabled("") then
for _, item in ipairs(drops) do for _, item in ipairs(drops) do
minetest.add_item(pos, item) minetest.add_item(pos, item)
end end
end else
-- If there is a player
local inv = digger:get_inventory() local inv = digger:get_inventory()
if inv then if inv then
for _, item in ipairs(drops) do for _, item in ipairs(drops) do
@ -752,6 +753,7 @@ if minetest.is_creative_enabled("") then
end end
end end
end end
end
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
-- Initialize variables and inventory -- Initialize variables and inventory

View File

@ -113,8 +113,8 @@ mesecon.register_node("mcl_observers:observer", {
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
paramtype2 = "facedir", paramtype2 = "facedir",
on_rotate = false, on_rotate = false,
_mcl_blast_resistance = 3, _mcl_blast_resistance = 3.5,
_mcl_hardness = 3, _mcl_hardness = 3.5,
}, { }, {
description = S("Observer"), description = S("Observer"),
_tt_help = S("Emits redstone pulse when block in front changes"), _tt_help = S("Emits redstone pulse when block in front changes"),
@ -172,8 +172,8 @@ mesecon.register_node("mcl_observers:observer_down", {
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
groups = {pickaxey=1, material_stone=1, not_opaque=1, not_in_creative_inventory=1 }, groups = {pickaxey=1, material_stone=1, not_opaque=1, not_in_creative_inventory=1 },
on_rotate = false, on_rotate = false,
_mcl_blast_resistance = 3, _mcl_blast_resistance = 3.5,
_mcl_hardness = 3, _mcl_hardness = 3.5,
drop = "mcl_observers:observer_off", drop = "mcl_observers:observer_off",
}, { }, {
tiles = { tiles = {
@ -224,8 +224,8 @@ mesecon.register_node("mcl_observers:observer_up", {
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
groups = {pickaxey=1, material_stone=1, not_opaque=1, not_in_creative_inventory=1 }, groups = {pickaxey=1, material_stone=1, not_opaque=1, not_in_creative_inventory=1 },
on_rotate = false, on_rotate = false,
_mcl_blast_resistance = 3, _mcl_blast_resistance = 3.5,
_mcl_hardness = 3, _mcl_hardness = 3.5,
drop = "mcl_observers:observer_off", drop = "mcl_observers:observer_off",
}, { }, {
tiles = { tiles = {

View File

@ -246,6 +246,15 @@ function mesecon.mergetable(source, dest)
return rval return rval
end end
--
function mesecon.join_table(t1, t2)
local rval = mesecon.tablecopy(t2)
for i, v in ipairs(t1) do
table.insert(rval, mesecon.tablecopy(v))
end
return rval
end
function mesecon.register_node(name, spec_common, spec_off, spec_on) function mesecon.register_node(name, spec_common, spec_off, spec_on)
spec_common.drop = spec_common.drop or name .. "_off" spec_common.drop = spec_common.drop or name .. "_off"
spec_common.on_blast = spec_common.on_blast or mesecon.on_blastnode spec_common.on_blast = spec_common.on_blast or mesecon.on_blastnode

View File

@ -211,6 +211,11 @@ function mesecon.register_button(basename, description, texture, recipeitem, sou
output = "mesecons_button:button_"..basename.."_off", output = "mesecons_button:button_"..basename.."_off",
recipe = {{ recipeitem }}, recipe = {{ recipeitem }},
}) })
if minetest.get_modpath("mesecons_mvps") then
mesecon.register_mvps_unsticky("mesecons_button:button_"..basename.."_off")
mesecon.register_mvps_unsticky("mesecons_button:button_"..basename.."_on")
end
end end
mesecon.register_button( mesecon.register_button(

View File

@ -117,7 +117,7 @@ local function is_available(pos)
return false, n return false, n
end end
if minetest.registered_nodes[name] then if minetest.registered_nodes[name] then
return minetest.registered_nodes[name].buildable_to, n or false, n return minetest.registered_nodes[name].buildable_to or minetest.get_item_group(name, "dig_by_piston") == 1, n or false, n
end end
return false, n return false, n
end end
@ -126,6 +126,7 @@ end
function mesecon.mvps_get_stack(pos, dir, maximum, piston_pos) function mesecon.mvps_get_stack(pos, dir, maximum, piston_pos)
-- determine the number of nodes to be pushed -- determine the number of nodes to be pushed
local nodes = {} local nodes = {}
local dig_nodes = {}
local frontiers = {pos} local frontiers = {pos}
while #frontiers > 0 do while #frontiers > 0 do
@ -140,22 +141,24 @@ function mesecon.mvps_get_stack(pos, dir, maximum, piston_pos)
return return
end end
if minetest.get_item_group(nn.name, "dig_by_piston") == 1 then
-- if we want the node to drop, e.g. sugar cane, do not count towards push limit
table.insert(dig_nodes, {node = nn, pos = {x=np.x, y=np.y, z=np.z}})
else
if not node_replaceable(nn.name) then if not node_replaceable(nn.name) then
if #nodes >= maximum then return nil, false end
table.insert(nodes, {node = nn, pos = {x=np.x, y=np.y, z=np.z}}) table.insert(nodes, {node = nn, pos = {x=np.x, y=np.y, z=np.z}})
if #nodes > maximum then return nil, nil, false, true end
-- add connected nodes to frontiers, connected is a vector list -- add connected nodes to frontiers, connected is a vector list
-- the vectors must be absolute positions -- the vectors must be absolute positions
local connected = {} local connected = {}
local has_loop local has_loop
if minetest.registered_nodes[nn.name] if minetest.registered_nodes[nn.name] and minetest.registered_nodes[nn.name].mvps_sticky then
and minetest.registered_nodes[nn.name].mvps_sticky then
connected, has_loop = minetest.registered_nodes[nn.name].mvps_sticky(np, nn, piston_pos) connected, has_loop = minetest.registered_nodes[nn.name].mvps_sticky(np, nn, piston_pos)
if has_loop then if has_loop then
return {}, true return {}, {}, true, false
end end
end end
table.insert(connected, vector.add(np, dir)) table.insert(connected, vector.add(np, dir))
-- Make sure there are no duplicates in frontiers / nodes before -- Make sure there are no duplicates in frontiers / nodes before
@ -172,15 +175,16 @@ function mesecon.mvps_get_stack(pos, dir, maximum, piston_pos)
duplicate = true duplicate = true
end end
end end
if not duplicate and not mesecon.is_mvps_stopper(minetest.get_node(cp)) then if not duplicate and not mesecon.is_mvps_stopper(minetest.get_node(cp)) and minetest.get_item_group(nn.name, "dig_by_piston") == 0 then
table.insert(frontiers, cp) table.insert(frontiers, cp)
end end
end end
end end
end
table.remove(frontiers, 1) table.remove(frontiers, 1)
end end
return nodes, false return nodes, dig_nodes, false, false
end end
function mesecon.mvps_set_owner(pos, placer) function mesecon.mvps_set_owner(pos, placer)
@ -203,6 +207,11 @@ local function are_protected(nodes, player_name)
end end
function mesecon.mvps_push(pos, dir, maximum, player_name, piston_pos) function mesecon.mvps_push(pos, dir, maximum, player_name, piston_pos)
-- check if the node in front of the piston is protected against player_name (to prevent replacing air)
if minetest.is_protected(pos, player_name) then
return false
end
return mesecon.mvps_push_or_pull(pos, dir, dir, maximum, player_name, piston_pos) return mesecon.mvps_push_or_pull(pos, dir, dir, maximum, player_name, piston_pos)
end end
@ -222,9 +231,9 @@ end
-- movedir: direction of actual movement -- movedir: direction of actual movement
-- maximum: maximum nodes to be pushed -- maximum: maximum nodes to be pushed
function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, player_name, piston_pos) function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, player_name, piston_pos)
local nodes, has_loop = mesecon.mvps_get_stack(pos, movedir, maximum, piston_pos) local nodes, dig_nodes, has_loop, too_many = mesecon.mvps_get_stack(pos, movedir, maximum, piston_pos)
if has_loop then if has_loop or too_many then
return false return false
end end
@ -237,6 +246,9 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, player_name,
if (newpos[i].x == piston_pos.x) and (newpos[i].y == piston_pos.y) and (newpos[i].z == piston_pos.z) then if (newpos[i].x == piston_pos.x) and (newpos[i].y == piston_pos.y) and (newpos[i].z == piston_pos.z) then
return return
end end
if minetest.is_protected(newpos[i], player_name) then
return
end
if not is_available(newpos[i]) then if not is_available(newpos[i]) then
local available = false local available = false
for j in ipairs(nodes) do for j in ipairs(nodes) do
@ -253,18 +265,35 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, player_name,
end end
end end
if are_protected(nodes, player_name) then local all_nodes = nodes
if dig_nodes and #dig_nodes > 0 then all_nodes = mesecon.join_table(dig_nodes, nodes) end
if are_protected(all_nodes, player_name) then
return return
end end
local first_dropper = nil local first_dropper = nil
-- remove all nodes -- remove all nodes
for id, n in ipairs(nodes) do for id, n in ipairs(all_nodes) do
n.meta = minetest.get_meta(n.pos):to_table() n.meta = minetest.get_meta(n.pos):to_table()
local is_dropper = mesecon.is_mvps_dropper(n.node, movedir, nodes, id) local is_dropper = mesecon.is_mvps_dropper(n.node, movedir, all_nodes, id)
if is_dropper then if is_dropper then
--local drops = minetest.get_node_drops(n.node.name, "") -- if current node has already been destroyed (e.g. chain reaction of sugar cane breaking), skip it
minetest.dig_node(n.pos) if minetest.get_node(n.pos).name == n.node.name then
-- simulate dig_node using handle_node_drops
local drops = minetest.get_node_drops(n.node.name, "")
local counted_drops = {}
minetest.remove_node(n.pos)
for _, callback in pairs(minetest.registered_on_dignodes) do
callback(n.pos, n)
end
for _, item in ipairs(drops) do
if type(item) ~= "string" then
item = item:get_name() .. item:get_count()
end
table.insert(counted_drops, item)
end
minetest.handle_node_drops(n.pos, counted_drops)
end
else else
minetest.remove_node(n.pos) minetest.remove_node(n.pos)
local node_timer = minetest.get_node_timer(n.pos) local node_timer = minetest.get_node_timer(n.pos)
@ -273,13 +302,13 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, player_name,
end end
end end
if is_dropper then if is_dropper then
first_dropper = id -- get id of the first dropper, but we still let everything else drop, so don't break here
break if not first_dropper then first_dropper = id end
end end
end end
-- update mesecons for removed nodes ( has to be done after all nodes have been removed ) -- update mesecons for removed nodes ( has to be done after all nodes have been removed )
for id, n in ipairs(nodes) do for id, n in ipairs(all_nodes) do
if first_dropper and id >= first_dropper then if first_dropper and id >= first_dropper then
break break
end end
@ -287,7 +316,7 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, player_name,
end end
-- add nodes -- add nodes
for id, n in ipairs(nodes) do for id, n in ipairs(all_nodes) do
if first_dropper and id >= first_dropper then if first_dropper and id >= first_dropper then
break break
end end
@ -394,6 +423,7 @@ mesecon.register_mvps_stopper("mcl_core:realm_barrier")
mesecon.register_mvps_stopper("mcl_core:void") mesecon.register_mvps_stopper("mcl_core:void")
mesecon.register_mvps_stopper("mcl_core:bedrock") mesecon.register_mvps_stopper("mcl_core:bedrock")
mesecon.register_mvps_stopper("mcl_core:obsidian") mesecon.register_mvps_stopper("mcl_core:obsidian")
mesecon.register_mvps_stopper("mcl_core:crying_obsidian")
mesecon.register_mvps_stopper("mcl_chests:ender_chest") mesecon.register_mvps_stopper("mcl_chests:ender_chest")
mesecon.register_mvps_stopper("mcl_chests:ender_chest_small") mesecon.register_mvps_stopper("mcl_chests:ender_chest_small")
mesecon.register_mvps_stopper("mcl_mobspawners:spawner") mesecon.register_mvps_stopper("mcl_mobspawners:spawner")
@ -411,10 +441,9 @@ mesecon.register_mvps_stopper("mesecons_solarpanel:solar_panel_inverted_on")
mesecon.register_mvps_stopper("mesecons_solarpanel:solar_panel_inverted_off") mesecon.register_mvps_stopper("mesecons_solarpanel:solar_panel_inverted_off")
mesecon.register_mvps_stopper("mcl_banners:hanging_banner") mesecon.register_mvps_stopper("mcl_banners:hanging_banner")
mesecon.register_mvps_stopper("mcl_banners:standing_banner") mesecon.register_mvps_stopper("mcl_banners:standing_banner")
mesecon.register_mvps_stopper("mcl_campfires:campfire") mesecon.register_mvps_stopper("mcl_beehives:bee_nest")
mesecon.register_mvps_stopper("mcl_campfires:campfire_lit") mesecon.register_mvps_stopper("mcl_beehives:beehive")
mesecon.register_mvps_stopper("mcl_campfires:soul_campfire") mesecon.register_mvps_stopper("mcl_compass:lodestone")
mesecon.register_mvps_stopper("mcl_campfires:soul_campfire_lit")
-- Unmovable by technical restrictions. -- Unmovable by technical restrictions.
-- Open formspec would screw up if node is destroyed (minor problem) -- Open formspec would screw up if node is destroyed (minor problem)
@ -445,13 +474,14 @@ mesecon.register_mvps_stopper("mcl_chests:trapped_chest")
mesecon.register_mvps_stopper("mcl_chests:trapped_chest_small") mesecon.register_mvps_stopper("mcl_chests:trapped_chest_small")
mesecon.register_mvps_stopper("mcl_chests:trapped_chest_left") mesecon.register_mvps_stopper("mcl_chests:trapped_chest_left")
mesecon.register_mvps_stopper("mcl_chests:trapped_chest_right") mesecon.register_mvps_stopper("mcl_chests:trapped_chest_right")
mesecon.register_mvps_stopper("mcl_signs:wall_sign")
mesecon.register_mvps_stopper("mcl_signs:standing_sign")
mesecon.register_mvps_stopper("mcl_signs:standing_sign22_5")
mesecon.register_mvps_stopper("mcl_signs:standing_sign45")
mesecon.register_mvps_stopper("mcl_signs:standing_sign67_5")
mesecon.register_mvps_stopper("mcl_barrels:barrel_open") mesecon.register_mvps_stopper("mcl_barrels:barrel_open")
mesecon.register_mvps_stopper("mcl_barrels:barrel_closed") mesecon.register_mvps_stopper("mcl_barrels:barrel_closed")
mesecon.register_mvps_stopper("mcl_campfires:campfire")
mesecon.register_mvps_stopper("mcl_campfires:campfire_lit")
mesecon.register_mvps_stopper("mcl_campfires:soul_campfire")
mesecon.register_mvps_stopper("mcl_campfires:soul_campfire_lit")
mesecon.register_mvps_stopper("mcl_lectern:lectern")
mesecon.register_mvps_stopper("mcl_grindstone:grindstone")
-- Unmovable by design: objects -- Unmovable by design: objects
@ -495,8 +525,6 @@ mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_2")
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_3") mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_3")
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_door") mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_door")
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_trapdoor")
mesecon.register_mvps_unsticky("mcl_signs:wall_sign_bamboo")
mesecon.register_mvps_unsticky("mcl_bamboo:scaffolding") mesecon.register_mvps_unsticky("mcl_bamboo:scaffolding")
-- Beds -- Beds
@ -532,21 +560,6 @@ mesecon.register_mvps_unsticky("mcl_beds:bed_white_top")
mesecon.register_mvps_unsticky("mcl_beds:bed_white_bottom") mesecon.register_mvps_unsticky("mcl_beds:bed_white_bottom")
mesecon.register_mvps_unsticky("mcl_beds:bed_yellow_top") mesecon.register_mvps_unsticky("mcl_beds:bed_yellow_top")
mesecon.register_mvps_unsticky("mcl_beds:bed_yellow_bottom") mesecon.register_mvps_unsticky("mcl_beds:bed_yellow_bottom")
-- Buttons
mesecon.register_mvps_unsticky("mesecons_button:button_stone_off")
mesecon.register_mvps_unsticky("mesecons_button:button_stone_on")
mesecon.register_mvps_unsticky("mesecons_button:button_wood_off")
mesecon.register_mvps_unsticky("mesecons_button:button_wood_on")
mesecon.register_mvps_unsticky("mesecons_button:button_acaciawood_off")
mesecon.register_mvps_unsticky("mesecons_button:button_acaciawood_on")
mesecon.register_mvps_unsticky("mesecons_button:button_birchwood_off")
mesecon.register_mvps_unsticky("mesecons_button:button_birchwood_on")
mesecon.register_mvps_unsticky("mesecons_button:button_darkwood_off")
mesecon.register_mvps_unsticky("mesecons_button:button_darkwood_on")
mesecon.register_mvps_unsticky("mesecons_button:button_sprucewood_off")
mesecon.register_mvps_unsticky("mesecons_button:button_sprucewood_on")
mesecon.register_mvps_unsticky("mesecons_button:button_junglewood_off")
mesecon.register_mvps_unsticky("mesecons_button:button_junglewood_on")
-- Cactus, Sugarcane & Vines -- Cactus, Sugarcane & Vines
mesecon.register_mvps_unsticky("mcl_core:cactus") mesecon.register_mvps_unsticky("mcl_core:cactus")
mesecon.register_mvps_unsticky("mcl_core:reeds") mesecon.register_mvps_unsticky("mcl_core:reeds")
@ -559,23 +572,6 @@ mesecon.register_mvps_unsticky("mcl_cake:cake_4")
mesecon.register_mvps_unsticky("mcl_cake:cake_5") mesecon.register_mvps_unsticky("mcl_cake:cake_5")
mesecon.register_mvps_unsticky("mcl_cake:cake_6") mesecon.register_mvps_unsticky("mcl_cake:cake_6")
mesecon.register_mvps_unsticky("mcl_cake:cake") mesecon.register_mvps_unsticky("mcl_cake:cake")
-- Carpet
mesecon.register_mvps_unsticky("mcl_wool:black_carpet")
mesecon.register_mvps_unsticky("mcl_wool:blue_carpet")
mesecon.register_mvps_unsticky("mcl_wool:brown_carpet")
mesecon.register_mvps_unsticky("mcl_wool:cyan_carpet")
mesecon.register_mvps_unsticky("mcl_wool:green_carpet")
mesecon.register_mvps_unsticky("mcl_wool:grey_carpet")
mesecon.register_mvps_unsticky("mcl_wool:light_blue_carpet")
mesecon.register_mvps_unsticky("mcl_wool:lime_carpet")
mesecon.register_mvps_unsticky("mcl_wool:orange_carpet")
mesecon.register_mvps_unsticky("mcl_wool:magenta_carpet")
mesecon.register_mvps_unsticky("mcl_wool:pink_carpet")
mesecon.register_mvps_unsticky("mcl_wool:purple_carpet")
mesecon.register_mvps_unsticky("mcl_wool:red_carpet")
mesecon.register_mvps_unsticky("mcl_wool:silver_carpet")
mesecon.register_mvps_unsticky("mcl_wool:white_carpet")
mesecon.register_mvps_unsticky("mcl_wool:yellow_carpet")
-- Carved & Jack O'Lantern Pumpkins, Pumpkin & Melon -- Carved & Jack O'Lantern Pumpkins, Pumpkin & Melon
mesecon.register_mvps_unsticky("mcl_farming:pumpkin_face") mesecon.register_mvps_unsticky("mcl_farming:pumpkin_face")
mesecon.register_mvps_unsticky("mcl_farming:pumpkin_face_light") mesecon.register_mvps_unsticky("mcl_farming:pumpkin_face_light")
@ -907,16 +903,16 @@ mesecon.register_mvps_unsticky("mcl_chests:black_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:blue_shulker_box_small") mesecon.register_mvps_unsticky("mcl_chests:blue_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:brown_shulker_box_small") mesecon.register_mvps_unsticky("mcl_chests:brown_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:cyan_shulker_box_small") mesecon.register_mvps_unsticky("mcl_chests:cyan_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:dark_green_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:dark_grey_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:lightblue_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:green_shulker_box_small") mesecon.register_mvps_unsticky("mcl_chests:green_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:grey_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:light_blue_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:lime_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:orange_shulker_box_small") mesecon.register_mvps_unsticky("mcl_chests:orange_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:magenta_shulker_box_small") mesecon.register_mvps_unsticky("mcl_chests:magenta_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:pink_shulker_box_small") mesecon.register_mvps_unsticky("mcl_chests:pink_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:purple_shulker_box_small") mesecon.register_mvps_unsticky("mcl_chests:violet_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:red_shulker_box_small") mesecon.register_mvps_unsticky("mcl_chests:red_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:silver_shulker_box_small") mesecon.register_mvps_unsticky("mcl_chests:grey_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:white_shulker_box_small") mesecon.register_mvps_unsticky("mcl_chests:white_shulker_box_small")
mesecon.register_mvps_unsticky("mcl_chests:yellow_shulker_box_small") mesecon.register_mvps_unsticky("mcl_chests:yellow_shulker_box_small")
-- Snow -- Snow

View File

@ -138,8 +138,6 @@ local function piston_off(pos, node)
end end
local function piston_orientate(pos, placer) local function piston_orientate(pos, placer)
mesecon.mvps_set_owner(pos, placer)
-- not placed by player -- not placed by player
if not placer then return end if not placer then return end
@ -153,6 +151,9 @@ local function piston_orientate(pos, placer)
elseif pitch < -55 then elseif pitch < -55 then
minetest.add_node(pos, {name=pistonspec.piston_down}) minetest.add_node(pos, {name=pistonspec.piston_down})
end end
-- set owner meta after setting node, or it will not keep
mesecon.mvps_set_owner(pos, placer)
end end
@ -217,7 +218,7 @@ minetest.register_node("mesecons_pistons:piston_normal_off", {
}, },
}, },
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 1.5, _mcl_hardness = 0.5,
on_rotate = function(pos, node, user, mode) on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_AXIS then if mode == screwdriver.ROTATE_AXIS then
minetest.set_node(pos, {name="mesecons_pistons:piston_up_normal_off"}) minetest.set_node(pos, {name="mesecons_pistons:piston_up_normal_off"})
@ -254,7 +255,7 @@ minetest.register_node("mesecons_pistons:piston_normal_on", {
}, },
}, },
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 1.5, _mcl_hardness = 0.5,
on_rotate = false, on_rotate = false,
}) })
@ -325,7 +326,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", {
}, },
}, },
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 1.5, _mcl_hardness = 0.5,
on_rotate = function(pos, node, user, mode) on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_AXIS then if mode == screwdriver.ROTATE_AXIS then
minetest.set_node(pos, {name="mesecons_pistons:piston_up_sticky_off"}) minetest.set_node(pos, {name="mesecons_pistons:piston_up_sticky_off"})
@ -362,7 +363,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_on", {
}, },
}, },
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 1.5, _mcl_hardness = 0.5,
on_rotate = false, on_rotate = false,
}) })
@ -448,7 +449,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_off", {
footstep = mcl_sounds.node_sound_wood_defaults().footstep footstep = mcl_sounds.node_sound_wood_defaults().footstep
}), }),
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 1.5, _mcl_hardness = 0.5,
on_rotate = function(pos, node, user, mode) on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_AXIS then if mode == screwdriver.ROTATE_AXIS then
minetest.set_node(pos, {name="mesecons_pistons:piston_down_normal_off"}) minetest.set_node(pos, {name="mesecons_pistons:piston_down_normal_off"})
@ -486,7 +487,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_on", {
}, },
}, },
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 1.5, _mcl_hardness = 0.5,
on_rotate = false, on_rotate = false,
}) })
@ -555,7 +556,7 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_off", {
}, },
}, },
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 1.5, _mcl_hardness = 0.5,
on_rotate = function(pos, node, user, mode) on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_AXIS then if mode == screwdriver.ROTATE_AXIS then
minetest.set_node(pos, {name="mesecons_pistons:piston_down_sticky_off"}) minetest.set_node(pos, {name="mesecons_pistons:piston_down_sticky_off"})
@ -593,7 +594,7 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_on", {
}, },
}, },
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 1.5, _mcl_hardness = 0.5,
on_rotate = false, on_rotate = false,
}) })
@ -679,7 +680,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal_off", {
}, },
}, },
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 1.5, _mcl_hardness = 0.5,
on_rotate = function(pos, node, user, mode) on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_AXIS then if mode == screwdriver.ROTATE_AXIS then
minetest.set_node(pos, {name="mesecons_pistons:piston_normal_off"}) minetest.set_node(pos, {name="mesecons_pistons:piston_normal_off"})
@ -717,7 +718,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal_on", {
}, },
}, },
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 1.5, _mcl_hardness = 0.5,
on_rotate = false, on_rotate = false,
}) })
@ -781,7 +782,7 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_off", {
}, },
}, },
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 1.5, _mcl_hardness = 0.5,
on_rotate = function(pos, node, user, mode) on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_AXIS then if mode == screwdriver.ROTATE_AXIS then
minetest.set_node(pos, {name="mesecons_pistons:piston_sticky_off"}) minetest.set_node(pos, {name="mesecons_pistons:piston_sticky_off"})
@ -819,7 +820,7 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_on", {
}, },
}, },
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 1.5, _mcl_hardness = 0.5,
on_rotate = false, on_rotate = false,
}) })

85
mods/ITEMS/mcl_armor/api.lua Normal file → Executable file
View File

@ -85,6 +85,31 @@ function mcl_armor.equip_on_use(itemstack, player, pointed_thing)
return mcl_armor.equip(itemstack, player) return mcl_armor.equip(itemstack, player)
end end
local function get_armor_texture(textures, name, modname, itemname, itemstring)
local core_texture = textures[name] or modname .. "_" .. itemname .. ".png"
if type(core_texture) == "function" then return core_texture end
mcl_armor.trims.core_textures[itemstring] = core_texture
local func = function(obj, itemstack)
local overlay = itemstack:get_meta():get_string("mcl_armor:trim_overlay")
local core_armor_texture
local stack_name = mcl_grindstone.remove_enchant_name(itemstack) -- gets original itemstring if enchanted, no need to store (nearly) identical values
local core_armor_texture = mcl_armor.trims.core_textures[stack_name]
if mcl_enchanting.is_enchanted(itemstack:get_name()) then -- working with the original stack to know wether to apply enchanting overlay or not
-- Far, Far in the future we may no longer _enchanted itemstrings...
-- To fix this code, simply put the unmodified itemstring in stack_name's place
-- DO NOT REMOVE THIS if UNLESS YOU KNOW WHAT YOU'RE TRYING TO ACHIEVE!
core_armor_texture = core_armor_texture .. mcl_enchanting.overlay
end
if overlay == "" then return core_armor_texture end -- key not present; armor not trimmed
return core_armor_texture .. overlay
end
return func
end
function mcl_armor.register_set(def) function mcl_armor.register_set(def)
local modname = minetest.get_current_modname() local modname = minetest.get_current_modname()
local S = minetest.get_translator(modname) local S = minetest.get_translator(modname)
@ -136,7 +161,7 @@ function mcl_armor.register_set(def)
_on_unequip = on_unequip_callbacks[name] or def.on_unequip, _on_unequip = on_unequip_callbacks[name] or def.on_unequip,
_on_break = on_break_callbacks[name] or def.on_break, _on_break = on_break_callbacks[name] or def.on_break,
_mcl_armor_element = name, _mcl_armor_element = name,
_mcl_armor_texture = textures[name] or modname .. "_" .. itemname .. ".png", _mcl_armor_texture = get_armor_texture(textures, name, modname, itemname, itemstring),
_mcl_upgradable = def._mcl_upgradable, _mcl_upgradable = def._mcl_upgradable,
_mcl_upgrade_item = upgrade_item _mcl_upgrade_item = upgrade_item
}) })
@ -257,3 +282,61 @@ function mcl_armor.update(obj)
end end
end end
function mcl_armor.trim(itemstack, overlay, color_string)
local def = itemstack:get_definition()
if not def._mcl_armor_texture and not mcl_armor.trims.blacklisted[itemstack:get_name()] then return end
local meta = itemstack:get_meta()
local piece_overlay = overlay
local inv_overlay = ""
local piece_type = def._mcl_armor_element
if piece_type == "head" then --helmet
inv_overlay = "^(helmet_trim.png"
piece_overlay = piece_overlay .. "_helmet"
elseif piece_type == "torso" then --chestplate
inv_overlay = "^(chestplate_trim.png"
piece_overlay = piece_overlay .. "_chestplate"
elseif piece_type == "legs" then --leggings
inv_overlay = "^(leggings_trim.png"
piece_overlay = piece_overlay .. "_leggings"
elseif piece_type == "feet" then --boots
inv_overlay = "^(boots_trim.png"
piece_overlay = piece_overlay .. "_boots"
end
local color = mcl_armor.trims.colors[color_string]
inv_overlay = inv_overlay .. "^[colorize:" .. color .. ":150)"
piece_overlay = piece_overlay .. ".png"
piece_overlay = "^(" .. piece_overlay .. "^[colorize:" .. color .. ":150)"
meta:set_string("mcl_armor:trim_overlay" , piece_overlay) -- set textures to render on the player, will work for clients below 5.8 as well
meta:set_string("mcl_armor:inv", inv_overlay) -- make 5.8+ clients display the fancy inv image, older ones will see no change in the *inventory* image
meta:set_string("inventory_image", def.inventory_image .. inv_overlay) -- dont use reload_inv_image as it's a one liner in this enviorment
end
function mcl_armor.reload_trim_inv_image(itemstack)
local meta = itemstack:get_meta()
local inv_overlay = meta:get_string("mcl_armor:inv")
local def = itemstack:get_definition()
if inv_overlay == "" then return end
meta:set_string("inventory_image", def.inventory_image .. inv_overlay)
end
tt.register_snippet(function(itemstring, toolcaps, stack)
if not stack then return nil end
local meta = stack:get_meta()
if not mcl_armor.is_trimmed(stack) then return nil end
-- we need to get the part of the overlay image between the overlay begin ( and the trim name end _
-- we COULD easily store this info in meta, but that would bloat the meta storage, as the same few values would be stored over and over again on every trimmed item
-- this is fine here as this code gets only executed when you put armor and a trim in a smithing table
local full_overlay = meta:get_string("mcl_armor:trim_overlay")
local trim_name = full_overlay:match("%((.-)%_")
return "Upgrade:\n " .. trim_name:gsub("^%l", string.upper) .. " Armor Trim"
end)
function mcl_armor.is_trimmed(itemstack)
-- this meta value will be there for every trimmed armor piece
-- remember, get_string returns "" if the key doesn't exist
return itemstack:get_meta():get_string("mcl_armor:trim_overlay") ~= ""
end

View File

@ -57,6 +57,12 @@ mcl_armor = {
} }
}, },
player_view_range_factors = {}, player_view_range_factors = {},
trims = {
core_textures = {},
blacklisted = {["mcl_armor:elytra"]=true, ["mcl_armor:elytra_enchanted"]=true},
overlays = {"sentry","dune","coast","wild","tide","ward","vex","rib","snout","eye","spire","silence","wayfinder"},
colors = {["amethyst"]="#8246a5",["gold"]="#ce9627",["emerald"]="#1b9958",["copper"]="#c36447",["diamond"]="#5faed8",["iron"]="#938e88",["lapis"]="#1c306b",["netherite"]="#302a26",["quartz"]="#c9bcb9",["redstone"]="#af2c23"},
},
} }
local modpath = minetest.get_modpath("mcl_armor") local modpath = minetest.get_modpath("mcl_armor")
@ -66,3 +72,4 @@ dofile(modpath .. "/player.lua")
dofile(modpath .. "/damage.lua") dofile(modpath .. "/damage.lua")
dofile(modpath .. "/register.lua") dofile(modpath .. "/register.lua")
dofile(modpath .. "/alias.lua") dofile(modpath .. "/alias.lua")
dofile(modpath .. "/trims.lua")

View File

@ -21,3 +21,6 @@ Iron Boots=Eisenstiefel
Golden Boots=Goldstiefel Golden Boots=Goldstiefel
Diamond Boots=Diamantstiefel Diamond Boots=Diamantstiefel
Chain Boots=Kettenstiefel Chain Boots=Kettenstiefel
Smithing Template '@1'=Schiedevorlage '@1'

View File

@ -46,3 +46,6 @@ Reduces most types of damage by 4% for each level.=
Thorns= Thorns=
Reflects some of the damage taken when hit, at the cost of reducing durability with each proc.= Reflects some of the damage taken when hit, at the cost of reducing durability with each proc.=
Aqua Affinity= Aqua Affinity=
#Translations for armor trims
Smithing Template '@1'=

View File

@ -1,5 +1,5 @@
name = mcl_armor name = mcl_armor
author = stu author = stu
description = Adds craftable armor that is visible to other players. description = Adds craftable armor that is visible to other players.
depends = mcl_core, mcl_player, mcl_enchanting, mcl_damage depends = mcl_core, mcl_player, mcl_enchanting, mcl_damage, mcl_grindstone
optional_depends = mcl_fire, ethereal, bakedclay optional_depends = mcl_fire, ethereal, bakedclay

View File

@ -0,0 +1,64 @@
local mod_registername = minetest.get_current_modname() .. ":"
local S = minetest.get_translator(minetest.get_current_modname())
for _, template_name in pairs(mcl_armor.trims.overlays) do
minetest.register_craftitem(mod_registername .. template_name, {
description = S("Smithing Template '@1'", template_name),
inventory_image = template_name .. "_armor_trim_smithing_template.png",
})
minetest.register_craft({
output = mod_registername .. template_name .. " 2",
recipe = {
{"mcl_core:diamond",mod_registername .. template_name,"mcl_core:diamond"},
{"mcl_core:diamond","mcl_core:cobble","mcl_core:diamond"},
{"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"},
}
})
end
--temp craft recipies, missing structures
minetest.register_craft({
output = mod_registername .. "eye",
recipe = {
{"mcl_core:diamond","mcl_end:ender_eye","mcl_core:diamond"},
{"mcl_core:diamond","mcl_end:ender_eye","mcl_core:diamond"},
{"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"},
}
})
minetest.register_craft({
output = mod_registername .. "ward",
recipe = {
{"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"},
{"mcl_core:diamond","mcl_core:apple_gold_enchanted","mcl_core:diamond"},
{"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"},
}
})
minetest.register_craft({
output = mod_registername .. "snout",
recipe = {
{"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"},
{"mcl_core:diamond","mcl_core:goldblock","mcl_core:diamond"},
{"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"},
}
})
minetest.register_craft({
output = mod_registername .. "silence",
recipe = {
{"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"},
{"mcl_core:diamond", mod_registername.."ward","mcl_core:diamond"},
{"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"},
}
})
minetest.register_craft({
output = mod_registername .. "wayfinder",
recipe = {
{"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"},
{"mcl_core:diamond", "mcl_maps:empty_map","mcl_core:diamond"},
{"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"},
}
})

View File

@ -3,7 +3,7 @@ mcl_bamboo
This mod adds working, familiar bamboo nodes to your Mineclone 2 world. This mod adds working, familiar bamboo nodes to your Mineclone 2 world.
Code: MineClone2 dev team. Original (basic) bamboo code by: Small Joker. Code: Michieal. Original (basic, used as inspiration) bamboo code by: Small Joker. Updates to the code: Mineclone Dev Team, Michieal.
License for code: GPLv3. License for code: GPLv3.
License for images / textures: CC-BY-SA except where noted. License for images / textures: CC-BY-SA except where noted.

View File

@ -62,7 +62,7 @@ local bamboo_def = {
inventory_image = "mcl_bamboo_bamboo_shoot.png", inventory_image = "mcl_bamboo_bamboo_shoot.png",
wield_image = "mcl_bamboo_bamboo_shoot.png", wield_image = "mcl_bamboo_bamboo_shoot.png",
_mcl_blast_resistance = 1, _mcl_blast_resistance = 1,
_mcl_hardness = 1, _mcl_hardness = 1.5,
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
@ -86,6 +86,11 @@ local bamboo_def = {
on_rotate = on_rotate, on_rotate = on_rotate,
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
if not pointed_thing then
return itemstack
end
if pointed_thing.type ~= "node" then if pointed_thing.type ~= "node" then
return itemstack return itemstack
end end
@ -246,7 +251,7 @@ local bamboo_def = {
minetest.register_node(BAMBOO, bamboo_def) minetest.register_node(BAMBOO, bamboo_def)
local bamboo_top = table.copy(bamboo_def) local bamboo_top = table.copy(bamboo_def)
bamboo_top.groups = {not_in_creative_inventory = 1, handy = 1, axey = 1, choppy = 1, flammable = 3} bamboo_top.groups = {not_in_creative_inventory = 1, handy = 1, axey = 1, choppy = 1, dig_by_piston = 1, plant = 1, non_mycelium_plant = 1, flammable = 3}
bamboo_top.tiles = {"mcl_bamboo_endcap.png"} bamboo_top.tiles = {"mcl_bamboo_endcap.png"}
bamboo_top.drawtype = "plantlike_rooted" --"plantlike" bamboo_top.drawtype = "plantlike_rooted" --"plantlike"
--bamboo_top.paramtype2 = "meshoptions" --bamboo_top.paramtype2 = "meshoptions"
@ -272,10 +277,17 @@ local bamboo_block_def = {
sounds = node_sound, sounds = node_sound,
paramtype2 = "facedir", paramtype2 = "facedir",
drops = "mcl_bamboo:bamboo_block", drops = "mcl_bamboo:bamboo_block",
_mcl_blast_resistance = 2, _mcl_blast_resistance = 3,
_mcl_hardness = 2, _mcl_hardness = 2,
_mcl_stripped_variant = "mcl_bamboo:bamboo_block_stripped", -- this allows us to use the built in Axe's strip block. _mcl_stripped_variant = "mcl_bamboo:bamboo_block_stripped", -- this allows us to use the built in Axe's strip block.
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
if not pointed_thing then
return itemstack
end
if pointed_thing.type ~= "node" then -- make sure that pointed_thing is not null and is pointing at a node.
return itemstack
end
local pos = pointed_thing.under local pos = pointed_thing.under
@ -349,7 +361,7 @@ bamboo_one_def.selection_box = {
{-0.05, -0.5, 0.285, -0.275, 0.5, 0.06}, {-0.05, -0.5, 0.285, -0.275, 0.5, 0.06},
} }
} }
bamboo_one_def.groups = {not_in_creative_inventory = 1, handy = 1, axey = 1, choppy = 1, flammable = 3} bamboo_one_def.groups = {not_in_creative_inventory = 1, handy = 1, axey = 1, choppy = 1, dig_by_piston = 1, plant = 1, non_mycelium_plant = 1, flammable = 3}
mcl_bamboo.mcl_log(dump(mcl_bamboo.bamboo_index)) mcl_bamboo.mcl_log(dump(mcl_bamboo.bamboo_index))
minetest.register_node(mcl_bamboo.bamboo_index[2], bamboo_one_def) minetest.register_node(mcl_bamboo.bamboo_index[2], bamboo_one_def)
local bamboo_two_def = table.copy(bamboo_def) local bamboo_two_def = table.copy(bamboo_def)
@ -373,7 +385,7 @@ bamboo_two_def.selection_box = {
{0.25, -0.5, 0.325, 0.025, 0.5, 0.100}, {0.25, -0.5, 0.325, 0.025, 0.5, 0.100},
} }
} }
bamboo_two_def.groups = {not_in_creative_inventory = 1, handy = 1, axey = 1, choppy = 1, flammable = 3} bamboo_two_def.groups = {not_in_creative_inventory = 1, handy = 1, axey = 1, choppy = 1, dig_by_piston = 1, plant = 1, non_mycelium_plant = 1, flammable = 3}
minetest.register_node(mcl_bamboo.bamboo_index[3], bamboo_two_def) minetest.register_node(mcl_bamboo.bamboo_index[3], bamboo_two_def)
local bamboo_three_def = table.copy(bamboo_def) local bamboo_three_def = table.copy(bamboo_def)
@ -396,5 +408,5 @@ bamboo_three_def.selection_box = {
{-0.125, -0.5, 0.125, -0.3125, 0.5, 0.3125}, {-0.125, -0.5, 0.125, -0.3125, 0.5, 0.3125},
} }
} }
bamboo_three_def.groups = {not_in_creative_inventory = 1, handy = 1, axey = 1, choppy = 1, flammable = 3} bamboo_three_def.groups = {not_in_creative_inventory = 1, handy = 1, axey = 1, choppy = 1, dig_by_piston = 1, plant = 1, non_mycelium_plant = 1, flammable = 3}
minetest.register_node(mcl_bamboo.bamboo_index[4], bamboo_three_def) minetest.register_node(mcl_bamboo.bamboo_index[4], bamboo_three_def)

View File

@ -192,10 +192,23 @@ if minetest.get_modpath("mcl_fences") then
local wood_groups = { handy = 1, axey = 1, flammable = 2, fence_wood = 1, fire_encouragement = 5, fire_flammability = 20 } local wood_groups = { handy = 1, axey = 1, flammable = 2, fence_wood = 1, fire_encouragement = 5, fire_flammability = 20 }
local wood_connect = { "group:fence_wood" } local wood_connect = { "group:fence_wood" }
local fence_id = mcl_fences.register_fence(id, S("Bamboo Fence"), "mcl_bamboo_fence_bamboo.png", wood_groups, local fence_id = mcl_fences.register_fence(
2, 15, wood_connect, node_sound) id,
local gate_id = mcl_fences.register_fence_gate(id, S("Bamboo Fence Gate"), "mcl_bamboo_fence_gate_bamboo.png", S("Bamboo Fence"),
wood_groups, 2, 15, node_sound) -- note: about missing params.. will use defaults. "mcl_bamboo_fence_bamboo.png",
wood_groups,
minetest.registered_nodes["mcl_core:wood"]._mcl_hardness,
minetest.registered_nodes["mcl_core:wood"]._mcl_blast_resistance,
wood_connect, node_sound)
local gate_id = mcl_fences.register_fence_gate(
id,
S("Bamboo Fence Gate"),
"mcl_bamboo_fence_gate_bamboo.png",
wood_groups,
minetest.registered_nodes["mcl_core:wood"]._mcl_hardness,
minetest.registered_nodes["mcl_core:wood"]._mcl_blast_resistance,
node_sound) -- note: about missing params.. will use defaults.
mcl_bamboo.mcl_log(dump(fence_id)) mcl_bamboo.mcl_log(dump(fence_id))
mcl_bamboo.mcl_log(dump(gate_id)) mcl_bamboo.mcl_log(dump(gate_id))

View File

@ -67,7 +67,7 @@ end
local BAMBOO_ENDCAP_NAME = "mcl_bamboo:bamboo_endcap" local BAMBOO_ENDCAP_NAME = "mcl_bamboo:bamboo_endcap"
-- For when I learn more about the pistons... -- check if supporting block is broken. pistons now break the bamboo plant.
function mcl_bamboo.break_orphaned(pos) function mcl_bamboo.break_orphaned(pos)
mcl_bamboo.mcl_log("Break_Orphaned called.") mcl_bamboo.mcl_log("Break_Orphaned called.")
local node_below = minetest.get_node(vector.offset(pos, 0, -1, 0)) local node_below = minetest.get_node(vector.offset(pos, 0, -1, 0))

View File

@ -152,7 +152,7 @@ function mcl_beds.register_bed(name, def)
stack_max = 1, stack_max = 1,
groups = {handy=1, bed = 1, dig_by_piston=1, bouncy=66, fall_damage_add_percent=-50, deco_block = 1, flammable=-1}, groups = {handy=1, bed = 1, dig_by_piston=1, bouncy=66, fall_damage_add_percent=-50, deco_block = 1, flammable=-1},
_mcl_hardness = 0.2, _mcl_hardness = 0.2,
_mcl_blast_resistance = 0.2, _mcl_blast_resistance = 1,
sounds = def.sounds or default_sounds, sounds = def.sounds or default_sounds,
selection_box = common_box, selection_box = common_box,
collision_box = common_box, collision_box = common_box,
@ -237,7 +237,7 @@ function mcl_beds.register_bed(name, def)
-- FIXME: Should be bouncy=66, but this would be a higher bounciness than slime blocks! -- FIXME: Should be bouncy=66, but this would be a higher bounciness than slime blocks!
groups = {handy = 1, flammable = -1, bed = 2, dig_by_piston=1, bouncy=33, fall_damage_add_percent=-50, not_in_creative_inventory = 1}, groups = {handy = 1, flammable = -1, bed = 2, dig_by_piston=1, bouncy=33, fall_damage_add_percent=-50, not_in_creative_inventory = 1},
_mcl_hardness = 0.2, _mcl_hardness = 0.2,
_mcl_blast_resistance = 0.2, _mcl_blast_resistance = 1,
sounds = def.sounds or default_sounds, sounds = def.sounds or default_sounds,
drop = def.recipe and name or "", drop = def.recipe and name or "",
selection_box = common_box, selection_box = common_box,

View File

@ -33,7 +33,7 @@ minetest.register_node("mcl_bells:bell", {
"mcl_bells_bell_side.png", "mcl_bells_bell_side.png",
}, },
is_ground_content = false, is_ground_content = false,
groups = {pickaxey=2, deco_block=1 }, groups = {pickaxey=2, deco_block=1, dig_by_piston=1 },
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 5, _mcl_blast_resistance = 5,
_mcl_hardness = 5, _mcl_hardness = 5,

View File

@ -34,7 +34,7 @@ minetest.register_node("mcl_blackstone:blackstone_gilded", {
} }
}, },
_mcl_blast_resistance = 2, _mcl_blast_resistance = 2,
_mcl_hardness = 1.5, _mcl_hardness = 2,
_mcl_silk_touch_drop = true, _mcl_silk_touch_drop = true,
_mcl_fortune_drop = { _mcl_fortune_drop = {
discrete_uniform_distribution = true, discrete_uniform_distribution = true,
@ -199,7 +199,11 @@ mcl_stairs.register_stair_and_slab_simple("blackstone_chiseled_polished", "mcl_b
mcl_stairs.register_stair_and_slab_simple("blackstone_brick_polished", "mcl_blackstone:blackstone_brick_polished", S("Polished Blackstone Brick Stair"), S("Polished Blackstone Brick Slab"), S("Double Polished Blackstone Brick Slab")) mcl_stairs.register_stair_and_slab_simple("blackstone_brick_polished", "mcl_blackstone:blackstone_brick_polished", S("Polished Blackstone Brick Stair"), S("Polished Blackstone Brick Slab"), S("Double Polished Blackstone Brick Slab"))
--Wall --Wall
mcl_walls.register_wall("mcl_blackstone:wall", S("Blackstone Wall"), "mcl_blackstone:blackstone") mcl_walls.register_wall(
"mcl_blackstone:wall",
S("Blackstone Wall"),
"mcl_blackstone:blackstone"
)
--lavacooling --lavacooling

View File

@ -416,8 +416,8 @@ minetest.register_node("mcl_brewing:stand_000", {
} }
}, },
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 1,
_mcl_hardness = 0.5, _mcl_hardness = 1,
on_destruct = on_destruct, on_destruct = on_destruct,
allow_metadata_inventory_take = allow_take, allow_metadata_inventory_take = allow_take,
allow_metadata_inventory_put = allow_put, allow_metadata_inventory_put = allow_put,
@ -489,8 +489,8 @@ minetest.register_node("mcl_brewing:stand_100", {
} }
}, },
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 1,
_mcl_hardness = 0.5, _mcl_hardness = 1,
on_destruct = on_destruct, on_destruct = on_destruct,
allow_metadata_inventory_take = allow_take, allow_metadata_inventory_take = allow_take,
allow_metadata_inventory_put = allow_put, allow_metadata_inventory_put = allow_put,
@ -561,8 +561,8 @@ minetest.register_node("mcl_brewing:stand_010", {
} }
}, },
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 1,
_mcl_hardness = 0.5, _mcl_hardness = 1,
on_destruct = on_destruct, on_destruct = on_destruct,
allow_metadata_inventory_take = allow_take, allow_metadata_inventory_take = allow_take,
allow_metadata_inventory_put = allow_put, allow_metadata_inventory_put = allow_put,
@ -628,8 +628,8 @@ minetest.register_node("mcl_brewing:stand_001", {
} }
}, },
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 1,
_mcl_hardness = 0.5, _mcl_hardness = 1,
on_destruct = on_destruct, on_destruct = on_destruct,
allow_metadata_inventory_take = allow_take, allow_metadata_inventory_take = allow_take,
allow_metadata_inventory_put = allow_put, allow_metadata_inventory_put = allow_put,
@ -705,8 +705,8 @@ minetest.register_node("mcl_brewing:stand_110", {
} }
}, },
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 1,
_mcl_hardness = 0.5, _mcl_hardness = 1,
on_destruct = on_destruct, on_destruct = on_destruct,
allow_metadata_inventory_take = allow_take, allow_metadata_inventory_take = allow_take,
allow_metadata_inventory_put = allow_put, allow_metadata_inventory_put = allow_put,
@ -778,8 +778,8 @@ minetest.register_node("mcl_brewing:stand_101", {
} }
}, },
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 1,
_mcl_hardness = 0.5, _mcl_hardness = 1,
on_destruct = on_destruct, on_destruct = on_destruct,
allow_metadata_inventory_take = allow_take, allow_metadata_inventory_take = allow_take,
allow_metadata_inventory_put = allow_put, allow_metadata_inventory_put = allow_put,
@ -851,8 +851,8 @@ minetest.register_node("mcl_brewing:stand_011", {
} }
}, },
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 1,
_mcl_hardness = 0.5, _mcl_hardness = 1,
on_destruct = on_destruct, on_destruct = on_destruct,
allow_metadata_inventory_take = allow_take, allow_metadata_inventory_take = allow_take,
allow_metadata_inventory_put = allow_put, allow_metadata_inventory_put = allow_put,
@ -931,8 +931,8 @@ minetest.register_node("mcl_brewing:stand_111", {
} }
}, },
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 1,
_mcl_hardness = 0.5, _mcl_hardness = 1,
on_destruct = on_destruct, on_destruct = on_destruct,
allow_metadata_inventory_take = allow_take, allow_metadata_inventory_take = allow_take,
allow_metadata_inventory_put = allow_put, allow_metadata_inventory_put = allow_put,

View File

@ -18,13 +18,21 @@ local function on_place_fish(itemstack, placer, pointed_thing)
return new_stack return new_stack
end end
local pos = pointed_thing.above or pointed_thing.under if pointed_thing.type ~= "node" then return end
if not pos then return end
local n = minetest.get_node_or_nil(pos) local pos = pointed_thing.above
if n.name and minetest.registered_nodes[n.name].buildable_to or n.name == "mcl_portals:portal" then local n = minetest.get_node(pointed_thing.above)
local fish = itemstack:get_name():gsub(fishbucket_prefix,"") local def = minetest.registered_nodes[minetest.get_node(pointed_thing.under).name]
if ( def and def.buildable_to ) or n.name == "mcl_portals:portal" then
pos = pointed_thing.under
n = minetest.get_node(pointed_thing.under)
end
local fish = itemstack:get_definition()._mcl_buckets_fish
if fish_names[fish] then if fish_names[fish] then
local o = minetest.add_entity(pos, "mobs_mc:" .. fish) local o = minetest.add_entity(pos, "mobs_mc:" .. fish)
if o and o:get_pos() then
local props = itemstack:get_meta():get_string("properties") local props = itemstack:get_meta():get_string("properties")
if props ~= "" then if props ~= "" then
o:set_properties(minetest.deserialize(props)) o:set_properties(minetest.deserialize(props))
@ -60,6 +68,7 @@ for techname, fishname in pairs(fish_names) do
stack_max = 1, stack_max = 1,
groups = {bucket = 1, fish_bucket = 1}, groups = {bucket = 1, fish_bucket = 1},
liquids_pointable = false, liquids_pointable = false,
_mcl_buckets_fish = techname,
on_place = on_place_fish, on_place = on_place_fish,
on_secondary_use = on_place_fish, on_secondary_use = on_place_fish,
_on_dispense = function(stack, pos, droppos, dropnode, dropdir) _on_dispense = function(stack, pos, droppos, dropnode, dropdir)

View File

@ -9,9 +9,10 @@ Authors:
Gerold55 - Code Start + Models? Gerold55 - Code Start + Models?
PrairieWind - Improved and Cleaned Up Code, and added the soul campfire and crafting recipes. PrairieWind - Improved and Cleaned Up Code, and added the soul campfire and crafting recipes.
cora - Added burning damage. cora - Added burning damage.
DinoNuggies4665 - Cooking logic implemented DinoNuggies4665 - Cooking logic implemented.
thunder1035 - Redesigned model and texture tweaks thunder1035 - Redesigned model and texture tweaks.
AncientMariner - Changed smoke to particle spawner and tweaked particle configuration. AncientMariner - Changed smoke to particle spawner and tweaked particle configuration.
Michieal - Fixed misc. errors.
License of media License of media
---------------- ----------------

View File

@ -332,6 +332,9 @@ function mcl_campfires.register_campfire(name, def)
elseif minetest.get_item_group(itemstack:get_name(), "campfire_cookable") ~= 0 then elseif minetest.get_item_group(itemstack:get_name(), "campfire_cookable") ~= 0 then
mcl_campfires.take_item(pos, node, player, itemstack) mcl_campfires.take_item(pos, node, player, itemstack)
else else
if not pointed_thing then
return itemstack
end
minetest.item_place_node(itemstack, player, pointed_thing) minetest.item_place_node(itemstack, player, pointed_thing)
end end
end, end,

View File

@ -67,12 +67,12 @@ local function register_filled_cauldron(water_level, description, liquid)
local water_tex local water_tex
if liquid == "river_water" then if liquid == "river_water" then
id = id .. "r" id = id .. "r"
water_tex = "default_water_source_animated.png^[verticalframe:16:0^[multiply:#0084FF" water_tex = "mcl_core_water_source_animation.png^[verticalframe:16:0^[multiply:#0084FF"
elseif liquid == "lava" then elseif liquid == "lava" then
id = id .. "_lava" id = id .. "_lava"
water_tex = "default_lava_source_animated.png^[verticalframe:16:0" water_tex = "mcl_core_lava_source_animation.png^[verticalframe:16:0"
else else
water_tex = "default_water_source_animated.png^[verticalframe:16:0^[multiply:#3F76E4" water_tex = "mcl_core_water_source_animation.png^[verticalframe:16:0^[multiply:#3F76E4"
end end
minetest.register_node(id, { minetest.register_node(id, {
description = description, description = description,

View File

@ -51,13 +51,13 @@ mcl_stairs.register_stair("cherrywood", "mcl_cherry_blossom:cherrywood",
{handy=1,axey=1, flammable=3,wood_stairs=1, material_wood=1, fire_encouragement=5, fire_flammability=20}, {handy=1,axey=1, flammable=3,wood_stairs=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
{"mcl_cherry_blossom_planks.png"}, {"mcl_cherry_blossom_planks.png"},
S("Cherry Stairs"), S("Cherry Stairs"),
mcl_sounds.node_sound_wood_defaults(), nil, nil, mcl_sounds.node_sound_wood_defaults(), 3, 2,
"woodlike") "woodlike")
mcl_stairs.register_slab("cherrywood", "mcl_cherry_blossom:cherrywood", mcl_stairs.register_slab("cherrywood", "mcl_cherry_blossom:cherrywood",
{handy=1,axey=1, flammable=3,wood_slab=1, material_wood=1, fire_encouragement=5, fire_flammability=20}, {handy=1,axey=1, flammable=3,wood_slab=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
{"mcl_cherry_blossom_planks.png"}, {"mcl_cherry_blossom_planks.png"},
S("Cherry Slab"), S("Cherry Slab"),
mcl_sounds.node_sound_wood_defaults(), nil, nil, mcl_sounds.node_sound_wood_defaults(), 3, 2,
S("Double Cherry Slab")) S("Double Cherry Slab"))
-- Signs -- Signs
@ -66,9 +66,16 @@ mcl_signs.register_sign_custom("mcl_cherry_blossom", "_cherrywood",
"mcl_cherry_blossom_sign_inv.png", "mcl_cherry_blossom_sign_inv.png", S("Cherry Sign")) "mcl_cherry_blossom_sign_inv.png", "mcl_cherry_blossom_sign_inv.png", S("Cherry Sign"))
-- Fences & Gates -- Fences & Gates
mcl_fences.register_fence_and_fence_gate("cherry_fence", S("Cherry Fence"), S("Cherry Gate"), mcl_fences.register_fence_and_fence_gate(
"mcl_cherry_blossom_planks.png", {handy=1, axey=1, flammable=2, fence_wood=1, fire_encouragement=5, fire_flammability=20}, 2, 15, "cherry_fence",
{"group:fence_wood"}, mcl_sounds.node_sound_wood_defaults()) S("Cherry Fence"),
S("Cherry Gate"),
"mcl_cherry_blossom_planks.png",
{handy=1, axey=1, flammable=2, fence_wood=1, fire_encouragement=5, fire_flammability=20},
minetest.registered_nodes["mcl_core:wood"]._mcl_hardness,
minetest.registered_nodes["mcl_core:wood"]._mcl_blast_resistance,
{"group:fence_wood"},
mcl_sounds.node_sound_wood_defaults())
-- Redstone -- Redstone
mesecon.register_pressure_plate( mesecon.register_pressure_plate(

View File

@ -532,10 +532,13 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile
_mcl_hardness = 2.5, _mcl_hardness = 2.5,
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
if minetest.registered_nodes[minetest.get_node({ x = pos.x, y = pos.y + 1, z = pos.z }).name].groups.opaque == 1 then local topnode = minetest.get_node({ x = pos.x, y = pos.y + 1, z = pos.z })
if topnode and topnode.name and minetest.registered_nodes[topnode.name] then
if minetest.registered_nodes[topnode.name].groups.opaque == 1 then
-- won't open if there is no space from the top -- won't open if there is no space from the top
return false return false
end end
end
local name = minetest.get_meta(pos):get_string("name") local name = minetest.get_meta(pos):get_string("name")
if name == "" then if name == "" then
name = S("Chest") name = S("Chest")
@ -1164,7 +1167,7 @@ minetest.register_node("mcl_chests:ender_chest_small", {
player_chest_close(sender) player_chest_close(sender)
end end
end, end,
_mcl_blast_resistance = 600, _mcl_blast_resistance = 3000,
_mcl_hardness = 22.5, _mcl_hardness = 22.5,
_mcl_silk_touch_drop = { "mcl_chests:ender_chest" }, _mcl_silk_touch_drop = { "mcl_chests:ender_chest" },
on_rotate = simple_rotate, on_rotate = simple_rotate,
@ -1466,7 +1469,7 @@ for color, desc in pairs(boxtypes) do
return 0 return 0
end end
end, end,
_mcl_blast_resistance = 2, _mcl_blast_resistance = 6,
_mcl_hardness = 2, _mcl_hardness = 2,
}) })

View File

@ -158,7 +158,7 @@ for _, row in ipairs(block.dyes) do
stack_max = 64, stack_max = 64,
is_ground_content = false, is_ground_content = false,
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 1.4, _mcl_blast_resistance = 4.2,
_mcl_hardness = 1.4, _mcl_hardness = 1.4,
on_rotate = on_rotate, on_rotate = on_rotate,
}) })

View File

@ -312,8 +312,8 @@ minetest.register_node("mcl_compass:lodestone",{
"lodestone_side4.png" "lodestone_side4.png"
}, },
groups = {pickaxey=1, material_stone=1}, groups = {pickaxey=1, material_stone=1},
_mcl_hardness = 3.5, _mcl_hardness = 1.5,
_mcl_blast_resistance = 3.5, _mcl_blast_resistance = 6,
sounds = mcl_sounds.node_sound_stone_defaults() sounds = mcl_sounds.node_sound_stone_defaults()
}) })

View File

@ -58,7 +58,7 @@ minetest.register_node("mcl_copper:block_exposed", {
groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, groups = {pickaxey = 2, building_block = 1, oxidizable = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_oxidized_variant = "mcl_copper:block_weathered", _mcl_oxidized_variant = "mcl_copper:block_weathered",
_mcl_waxed_variant = "mcl_copper:waxed_block_exposed", _mcl_waxed_variant = "mcl_copper:waxed_block_exposed",
_mcl_stripped_variant = "mcl_copper:block", _mcl_stripped_variant = "mcl_copper:block",
@ -72,7 +72,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed", {
groups = {pickaxey = 2, building_block = 1, waxed = 1}, groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_stripped_variant = "mcl_copper:block_exposed", _mcl_stripped_variant = "mcl_copper:block_exposed",
}) })
@ -84,7 +84,7 @@ minetest.register_node("mcl_copper:block_weathered", {
groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, groups = {pickaxey = 2, building_block = 1, oxidizable = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_oxidized_variant = "mcl_copper:block_oxidized", _mcl_oxidized_variant = "mcl_copper:block_oxidized",
_mcl_waxed_variant = "mcl_copper:waxed_block_weathered", _mcl_waxed_variant = "mcl_copper:waxed_block_weathered",
_mcl_stripped_variant = "mcl_copper:block_exposed", _mcl_stripped_variant = "mcl_copper:block_exposed",
@ -98,7 +98,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered", {
groups = {pickaxey = 2, building_block = 1, waxed = 1}, groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_stripped_variant = "mcl_copper:block_weathered", _mcl_stripped_variant = "mcl_copper:block_weathered",
}) })
@ -110,7 +110,7 @@ minetest.register_node("mcl_copper:block_oxidized", {
groups = {pickaxey = 2, building_block = 1}, groups = {pickaxey = 2, building_block = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_waxed_variant = "mcl_copper:waxed_block_oxidized", _mcl_waxed_variant = "mcl_copper:waxed_block_oxidized",
_mcl_stripped_variant = "mcl_copper:block_weathered", _mcl_stripped_variant = "mcl_copper:block_weathered",
}) })
@ -123,7 +123,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized", {
groups = {pickaxey = 2, building_block = 1, waxed = 1}, groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_stripped_variant = "mcl_copper:block_oxidized", _mcl_stripped_variant = "mcl_copper:block_oxidized",
}) })
@ -135,7 +135,7 @@ minetest.register_node("mcl_copper:block_cut", {
groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, groups = {pickaxey = 2, building_block = 1, oxidizable = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_oxidized_variant = "mcl_copper:block_exposed_cut", _mcl_oxidized_variant = "mcl_copper:block_exposed_cut",
_mcl_waxed_variant = "mcl_copper:waxed_block_cut", _mcl_waxed_variant = "mcl_copper:waxed_block_cut",
}) })
@ -148,7 +148,7 @@ minetest.register_node("mcl_copper:waxed_block_cut", {
groups = {pickaxey = 2, building_block = 1, waxed = 1}, groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_stripped_variant = "mcl_copper:block_cut", _mcl_stripped_variant = "mcl_copper:block_cut",
}) })
@ -160,7 +160,7 @@ minetest.register_node("mcl_copper:block_exposed_cut", {
groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, groups = {pickaxey = 2, building_block = 1, oxidizable = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_waxed_variant = "mcl_copper:waxed_block_exposed_cut", _mcl_waxed_variant = "mcl_copper:waxed_block_exposed_cut",
_mcl_oxidized_variant = "mcl_copper:block_weathered_cut", _mcl_oxidized_variant = "mcl_copper:block_weathered_cut",
_mcl_stripped_variant = "mcl_copper:block_cut", _mcl_stripped_variant = "mcl_copper:block_cut",
@ -174,7 +174,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed_cut", {
groups = {pickaxey = 2, building_block = 1, waxed = 1}, groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_stripped_variant = "mcl_copper:block_exposed_cut", _mcl_stripped_variant = "mcl_copper:block_exposed_cut",
}) })
@ -186,7 +186,7 @@ minetest.register_node("mcl_copper:block_weathered_cut", {
groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, groups = {pickaxey = 2, building_block = 1, oxidizable = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_stripped_variant = "mcl_copper:block_exposed_cut", _mcl_stripped_variant = "mcl_copper:block_exposed_cut",
_mcl_oxidized_variant = "mcl_copper:block_oxidized_cut", _mcl_oxidized_variant = "mcl_copper:block_oxidized_cut",
_mcl_waxed_variant = "mcl_copper:waxed_block_weathered_cut", _mcl_waxed_variant = "mcl_copper:waxed_block_weathered_cut",
@ -200,7 +200,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered_cut", {
groups = {pickaxey = 2, building_block = 1, waxed = 1}, groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_stripped_variant = "mcl_copper:block_weathered_cut", _mcl_stripped_variant = "mcl_copper:block_weathered_cut",
}) })
@ -212,7 +212,7 @@ minetest.register_node("mcl_copper:block_oxidized_cut", {
groups = {pickaxey = 2, building_block = 1}, groups = {pickaxey = 2, building_block = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_stripped_variant = "mcl_copper:block_weathered_cut", _mcl_stripped_variant = "mcl_copper:block_weathered_cut",
_mcl_waxed_variant = "mcl_copper:waxed_block_oxidized_cut", _mcl_waxed_variant = "mcl_copper:waxed_block_oxidized_cut",
}) })
@ -225,7 +225,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized_cut", {
groups = {pickaxey = 2, building_block = 1, waxed = 1}, groups = {pickaxey = 2, building_block = 1, waxed = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 5,
_mcl_stripped_variant = "mcl_copper:block_oxidized_cut", _mcl_stripped_variant = "mcl_copper:block_oxidized_cut",
}) })
@ -289,54 +289,54 @@ mcl_stairs.register_stair("copper_cut", "mcl_copper:block_cut",
{pickaxey = 2, oxidizable = 1}, {pickaxey = 2, oxidizable = 1},
{"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"}, {"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"},
S("Stairs of Cut Copper"), S("Stairs of Cut Copper"),
nil, nil, nil, nil, 6, nil,
"woodlike") "woodlike")
mcl_stairs.register_stair("waxed_copper_cut", "mcl_copper:waxed_block_cut", mcl_stairs.register_stair("waxed_copper_cut", "mcl_copper:waxed_block_cut",
{pickaxey = 2, waxed = 1}, {pickaxey = 2, waxed = 1},
{"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"}, {"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"},
S("Waxed Stairs of Cut Copper"), S("Waxed Stairs of Cut Copper"),
nil, nil, nil, nil, 6, nil,
"woodlike") "woodlike")
mcl_stairs.register_stair("copper_exposed_cut", "mcl_copper:block_exposed_cut", mcl_stairs.register_stair("copper_exposed_cut", "mcl_copper:block_exposed_cut",
{pickaxey = 2, oxidizable = 1}, {pickaxey = 2, oxidizable = 1},
{"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"},
S("Stairs of Exposed Cut Copper"), S("Stairs of Exposed Cut Copper"),
nil, nil, nil, nil, 6, nil,
"woodlike") "woodlike")
mcl_stairs.register_stair("waxed_copper_exposed_cut", "mcl_copper:waxed_block_exposed_cut", mcl_stairs.register_stair("waxed_copper_exposed_cut", "mcl_copper:waxed_block_exposed_cut",
{pickaxey = 2, waxed = 1}, {pickaxey = 2, waxed = 1},
{"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"},
S("Waxed Stairs of Exposed Cut Copper"), S("Waxed Stairs of Exposed Cut Copper"),
nil, nil, nil, nil, 6, nil,
"woodlike") "woodlike")
mcl_stairs.register_stair("copper_weathered_cut", "mcl_copper:block_weathered_cut", mcl_stairs.register_stair("copper_weathered_cut", "mcl_copper:block_weathered_cut",
{pickaxey = 2, oxidizable = 1}, {pickaxey = 2, oxidizable = 1},
{"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"}, {"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"},
S("Stairs of Weathered Cut Copper"), S("Stairs of Weathered Cut Copper"),
nil, nil, nil, nil, 6, nil,
"woodlike") "woodlike")
mcl_stairs.register_stair("waxed_copper_weathered_cut", "mcl_copper:waxed_block_weathered_cut", mcl_stairs.register_stair("waxed_copper_weathered_cut", "mcl_copper:waxed_block_weathered_cut",
{pickaxey = 2, waxed = 1}, {pickaxey = 2, waxed = 1},
{"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"}, {"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"},
S("Waxed Stairs of Weathered Cut Copper"), S("Waxed Stairs of Weathered Cut Copper"),
nil, nil, nil, nil, 6, nil,
"woodlike") "woodlike")
mcl_stairs.register_stair("copper_oxidized_cut", "mcl_copper:block_oxidized_cut", mcl_stairs.register_stair("copper_oxidized_cut", "mcl_copper:block_oxidized_cut",
{pickaxey = 2}, {pickaxey = 2},
{"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"}, {"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"},
S("Stairs of Oxidized Cut Copper"), S("Stairs of Oxidized Cut Copper"),
nil, nil, nil, nil, 6, nil,
"woodlike") "woodlike")
mcl_stairs.register_stair("waxed_copper_oxidized_cut", "mcl_copper:waxed_block_oxidized_cut", mcl_stairs.register_stair("waxed_copper_oxidized_cut", "mcl_copper:waxed_block_oxidized_cut",
{pickaxey = 2, waxed = 1}, {pickaxey = 2, waxed = 1},
{"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"}, {"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"},
S("Waxed Stairs of Oxidized Cut Copper"), S("Waxed Stairs of Oxidized Cut Copper"),
nil, nil, nil, nil, 6, nil,
"woodlike") "woodlike")

View File

@ -1581,7 +1581,7 @@ end
-- MUST NOT be called if there is a snow cover node above pos. -- MUST NOT be called if there is a snow cover node above pos.
function mcl_core.clear_snow_dirt(pos, node) function mcl_core.clear_snow_dirt(pos, node)
local def = minetest.registered_nodes[node.name] local def = minetest.registered_nodes[node.name]
if def._mcl_snowless then if def and def._mcl_snowless then
minetest.swap_node(pos, {name = def._mcl_snowless, param2=node.param2}) minetest.swap_node(pos, {name = def._mcl_snowless, param2=node.param2})
end end
end end
@ -1602,7 +1602,7 @@ function mcl_core.on_snowable_construct(pos)
-- Make snowed if needed -- Make snowed if needed
if minetest.get_item_group(anode.name, "snow_cover") == 1 then if minetest.get_item_group(anode.name, "snow_cover") == 1 then
local def = minetest.registered_nodes[node.name] local def = minetest.registered_nodes[node.name]
if def._mcl_snowed then if def and def._mcl_snowed then
minetest.swap_node(pos, {name = def._mcl_snowed, param2=node.param2}) minetest.swap_node(pos, {name = def._mcl_snowed, param2=node.param2})
end end
end end
@ -1623,7 +1623,7 @@ function mcl_core.on_snow_construct(pos)
local npos = {x=pos.x, y=pos.y-1, z=pos.z} local npos = {x=pos.x, y=pos.y-1, z=pos.z}
local node = minetest.get_node(npos) local node = minetest.get_node(npos)
local def = minetest.registered_nodes[node.name] local def = minetest.registered_nodes[node.name]
if def._mcl_snowed then if def and def._mcl_snowed then
minetest.swap_node(npos, {name = def._mcl_snowed, param2=node.param2}) minetest.swap_node(npos, {name = def._mcl_snowed, param2=node.param2})
end end
end end

View File

@ -288,7 +288,7 @@ minetest.register_node("mcl_core:stone_smooth", {
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
is_ground_content = false, is_ground_content = false,
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 2, _mcl_hardness = 1.5,
}) })
minetest.register_node("mcl_core:granite", { minetest.register_node("mcl_core:granite", {
@ -406,7 +406,7 @@ mcl_core.register_snowed_node("mcl_core:dirt_with_grass_snow", "mcl_core:dirt_wi
minetest.register_node("mcl_core:grass_path", { minetest.register_node("mcl_core:grass_path", {
tiles = {"mcl_core_grass_path_top.png", "default_dirt.png", "mcl_core_grass_path_side.png"}, tiles = {"mcl_core_grass_path_top.png", "default_dirt.png", "mcl_core_grass_path_side.png"},
description = S("Grass Path"), description = S("Grass Path"),
_doc_items_longdesc = S("Grass paths are a decorative variant of grass blocks. Their top has a different color and they are a bit lower than grass blocks, making them useful to build footpaths. Grass paths can be created with a shovel. A grass path turns into dirt when it is below a solid block."), _doc_items_longdesc = S("Grass paths are a decorative variant of grass blocks. Their top has a different color and they are a bit lower than grass blocks, making them useful to build footpaths. Grass paths can be created by right clicking with a shovel. A grass path turns into dirt when it is below a solid block or when shift+right clicked with a shovel."),
drop = "mcl_core:dirt", drop = "mcl_core:dirt",
is_ground_content = true, is_ground_content = true,
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
@ -419,12 +419,12 @@ minetest.register_node("mcl_core:grass_path", {
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5}, {-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
} }
}, },
groups = {handy=1,shovely=1, cultivatable=2, dirtifies_below_solid=1, dirtifier=1, deco_block=1 }, groups = {handy=1,shovely=1, cultivatable=2, dirtifies_below_solid=1, dirtifier=1, deco_block=1, path_remove_possible=1 },
sounds = mcl_sounds.node_sound_dirt_defaults({ sounds = mcl_sounds.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.1}, footstep = {name="default_grass_footstep", gain=0.1},
}), }),
_mcl_blast_resistance = 0.65, _mcl_blast_resistance = 0.65,
_mcl_hardness = 0.65, _mcl_hardness = 0.6,
}) })
-- TODO: Add particles -- TODO: Add particles
@ -497,8 +497,8 @@ minetest.register_node("mcl_core:podzol", {
sounds = mcl_sounds.node_sound_dirt_defaults(), sounds = mcl_sounds.node_sound_dirt_defaults(),
on_construct = mcl_core.on_snowable_construct, on_construct = mcl_core.on_snowable_construct,
_mcl_snowed = "mcl_core:podzol_snow", _mcl_snowed = "mcl_core:podzol_snow",
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.8,
_mcl_hardness = 0.5, _mcl_hardness = 0.8,
_mcl_silk_touch_drop = true, _mcl_silk_touch_drop = true,
}) })
mcl_core.register_snowed_node("mcl_core:podzol_snow", "mcl_core:podzol", nil, nil, false, S("Podzol with Snow")) mcl_core.register_snowed_node("mcl_core:podzol_snow", "mcl_core:podzol", nil, nil, false, S("Podzol with Snow"))
@ -600,8 +600,8 @@ minetest.register_node("mcl_core:sandstonesmooth", {
stack_max = 64, stack_max = 64,
groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1},
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 0.8, _mcl_blast_resistance = 6,
_mcl_hardness = 0.8, _mcl_hardness = 2,
}) })
minetest.register_node("mcl_core:sandstonecarved", { minetest.register_node("mcl_core:sandstonecarved", {
@ -687,8 +687,8 @@ minetest.register_node("mcl_core:redsandstonesmooth2", {
stack_max = 64, stack_max = 64,
groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1}, groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1},
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 0.8,
_mcl_hardness = 2, _mcl_hardness = 0.8,
}) })
--- ---
@ -1038,7 +1038,7 @@ for i=1,8 do
-- Get position where snow would be placed -- Get position where snow would be placed
local target local target
if minetest.registered_nodes[unode.name].buildable_to then if def and def.buildable_to then
target = under target = under
else else
target = above target = above
@ -1119,8 +1119,8 @@ minetest.register_node("mcl_core:snowblock", {
on_construct = mcl_core.on_snow_construct, on_construct = mcl_core.on_snow_construct,
after_destruct = mcl_core.after_snow_destruct, after_destruct = mcl_core.after_snow_destruct,
drop = "mcl_throwing:snowball 4", drop = "mcl_throwing:snowball 4",
_mcl_blast_resistance = 0.2, _mcl_blast_resistance = 0.1,
_mcl_hardness = 0.2, _mcl_hardness = 0.1,
_mcl_silk_touch_drop = true, _mcl_silk_touch_drop = true,
}) })

View File

@ -11,9 +11,36 @@ local function rotate_climbable(pos, node, user, mode)
return false return false
end end
---Updates the trapdoor above (if any).
---
---@param pos mt.Vector The position of the ladder.
---@param event "place" | "destruct" The place or destruct event.
function mcl_core.update_trapdoor(pos, event)
local top_pos = vector.offset(pos, 0, 1, 0)
local top_node = minetest.get_node_or_nil(top_pos)
if top_node and minetest.get_item_group(top_node.name, "trapdoor") == 2 then
local new_name = top_node.name
if event == "place" then
new_name = string.gsub(new_name, "open$", "ladder")
elseif event == "destruct" then
new_name = string.gsub(new_name, "ladder$", "open")
end
-- If node above is an opened trapdoor
minetest.swap_node(top_pos, {
name = new_name,
param1 = top_node.param1,
param2 = top_node.param2,
})
end
end
-- TODO: Move ladders into their own API.
minetest.register_node("mcl_core:ladder", { minetest.register_node("mcl_core:ladder", {
description = S("Ladder"), description = S("Ladder"),
_doc_items_longdesc = S("A piece of ladder which allows you to climb vertically. Ladders can only be placed on the side of solid blocks and not on glass, leaves, ice, slabs, glowstone, nor sea lanterns."), _doc_items_longdesc = S(
"A piece of ladder which allows you to climb vertically. Ladders can only be placed on the side of solid blocks and not on glass, leaves, ice, slabs, glowstone, nor sea lanterns."),
drawtype = "signlike", drawtype = "signlike",
is_ground_content = false, is_ground_content = false,
tiles = { "default_ladder.png" }, tiles = { "default_ladder.png" },
@ -33,7 +60,14 @@ minetest.register_node("mcl_core:ladder", {
wall_side = { -0.5, -0.5, -0.5, -7 / 16, 0.5, 0.5 }, wall_side = { -0.5, -0.5, -0.5, -7 / 16, 0.5, 0.5 },
}, },
stack_max = 64, stack_max = 64,
groups = {handy=1,axey=1, attached_node=1, deco_block=1, dig_by_piston=1}, groups = {
handy = 1,
axey = 1,
attached_node = 1,
deco_block = 1,
dig_by_piston = 1,
ladder = 1
},
sounds = mcl_sounds.node_sound_wood_defaults(), sounds = mcl_sounds.node_sound_wood_defaults(),
node_placement_prediction = "", node_placement_prediction = "",
-- Restrict placement of ladders -- Restrict placement of ladders
@ -80,7 +114,12 @@ minetest.register_node("mcl_core:ladder", {
end end
return itemstack return itemstack
end, end,
after_destruct = function(pos, old)
mcl_core.update_trapdoor(pos, "destruct")
end,
after_place_node = function(pos)
mcl_core.update_trapdoor(pos, "place")
end,
_mcl_blast_resistance = 0.4, _mcl_blast_resistance = 0.4,
_mcl_hardness = 0.4, _mcl_hardness = 0.4,
on_rotate = rotate_climbable, on_rotate = rotate_climbable,
@ -89,7 +128,8 @@ minetest.register_node("mcl_core:ladder", {
minetest.register_node("mcl_core:vine", { minetest.register_node("mcl_core:vine", {
description = S("Vines"), description = S("Vines"),
_doc_items_longdesc = S("Vines are climbable blocks which can be placed on the sides of solid full-cube blocks. Vines slowly grow and spread."), _doc_items_longdesc = S(
"Vines are climbable blocks which can be placed on the sides of solid full-cube blocks. Vines slowly grow and spread."),
drawtype = "signlike", drawtype = "signlike",
tiles = { "mcl_core_vine.png" }, tiles = { "mcl_core_vine.png" },
color = "#48B518", color = "#48B518",
@ -107,9 +147,19 @@ minetest.register_node("mcl_core:vine", {
}, },
stack_max = 64, stack_max = 64,
groups = { groups = {
handy = 1, axey = 1, shearsy = 1, swordy = 1, deco_block = 1, handy = 1,
dig_by_piston = 1, destroy_by_lava_flow = 1, compostability = 50, axey = 1,
flammable = 2, fire_encouragement = 15, fire_flammability = 100, foliage_palette_wallmounted = 1 shearsy = 1,
swordy = 1,
deco_block = 1,
dig_by_piston = 1,
destroy_by_lava_flow = 1,
compostability = 50,
flammable = 2,
fire_encouragement = 15,
fire_flammability = 100,
foliage_palette_wallmounted = 1,
ladder = 1
}, },
sounds = mcl_sounds.node_sound_leaves_defaults(), sounds = mcl_sounds.node_sound_leaves_defaults(),
drop = "", drop = "",
@ -181,6 +231,12 @@ minetest.register_node("mcl_core:vine", {
minetest.registered_nodes[node.name].on_dig(below, node, digger) minetest.registered_nodes[node.name].on_dig(below, node, digger)
end end
end, end,
after_destruct = function(pos, old)
mcl_core.update_trapdoor(pos, "destruct")
end,
after_place_node = function(pos)
mcl_core.update_trapdoor(pos, "place")
end,
_mcl_blast_resistance = 0.2, _mcl_blast_resistance = 0.2,

View File

@ -18,17 +18,17 @@ end
minetest.register_node("mcl_core:water_flowing", { minetest.register_node("mcl_core:water_flowing", {
description = S("Flowing Water"), description = S("Flowing Water"),
_doc_items_create_entry = false, _doc_items_create_entry = false,
wield_image = "default_water_flowing_animated.png^[verticalframe:64:0", wield_image = "mcl_core_water_flow_animation.png^[verticalframe:64:0",
drawtype = "flowingliquid", drawtype = "flowingliquid",
tiles = {"default_water_flowing_animated.png^[verticalframe:64:0"}, tiles = {"mcl_core_water_flow_animation.png^[verticalframe:64:0"},
special_tiles = { special_tiles = {
{ {
image="default_water_flowing_animated.png", image="mcl_core_water_flow_animation.png",
backface_culling=false, backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.5} animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.5}
}, },
{ {
image="default_water_flowing_animated.png", image="mcl_core_water_flow_animation.png",
backface_culling=false, backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.5} animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.5}
}, },
@ -71,12 +71,12 @@ S("• When water is directly below lava, the water turns into stone."),
drawtype = "liquid", drawtype = "liquid",
waving = 3, waving = 3,
tiles = { tiles = {
{name="default_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}} {name="mcl_core_water_source_animation.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}}
}, },
special_tiles = { special_tiles = {
-- New-style water source material (mostly unused) -- New-style water source material (mostly unused)
{ {
name="default_water_source_animated.png", name="mcl_core_water_source_animation.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}, animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0},
backface_culling = false, backface_culling = false,
} }
@ -119,17 +119,17 @@ S("• When water is directly below lava, the water turns into stone."),
minetest.register_node("mcl_core:lava_flowing", { minetest.register_node("mcl_core:lava_flowing", {
description = S("Flowing Lava"), description = S("Flowing Lava"),
_doc_items_create_entry = false, _doc_items_create_entry = false,
wield_image = "default_lava_flowing_animated.png^[verticalframe:64:0", wield_image = "mcl_core_lava_flow_animation.png^[verticalframe:64:0",
drawtype = "flowingliquid", drawtype = "flowingliquid",
tiles = {"default_lava_flowing_animated.png^[verticalframe:64:0"}, tiles = {"mcl_core_lava_flow_animation.png^[verticalframe:64:0"},
special_tiles = { special_tiles = {
{ {
image="default_lava_flowing_animated.png", image="mcl_core_lava_flow_animation.png",
backface_culling=false, backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=6.6} animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=6.6}
}, },
{ {
image="default_lava_flowing_animated.png", image="mcl_core_lava_flow_animation.png",
backface_culling=false, backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=6.6} animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=6.6}
}, },
@ -182,12 +182,12 @@ S("• When flowing water touches flowing lava either from above or horizontally
S("• When lava is directly above water, the water turns into stone."), S("• When lava is directly above water, the water turns into stone."),
drawtype = "liquid", drawtype = "liquid",
tiles = { tiles = {
{name="default_lava_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}} {name="mcl_core_lava_source_animation.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}}
}, },
special_tiles = { special_tiles = {
-- New-style lava source material (mostly unused) -- New-style lava source material (mostly unused)
{ {
name="default_lava_source_animated.png", name="mcl_core_lava_source_animation.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}, animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0},
backface_culling = false, backface_culling = false,
} }

View File

@ -139,8 +139,8 @@ minetest.register_node("mcl_core:deadbush", {
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
buildable_to = true, buildable_to = true,
groups = {handy = 1, shearsy = 1, flammable = 3, attached_node = 1, plant = 1, non_mycelium_plant = 1, dig_by_water = 1, groups = {handy = 1, shearsy = 1, flammable = 3, attached_node = 1, plant = 1, non_mycelium_plant = 1, dig_by_piston = 1,
destroy_by_lava_flow = 1, deco_block = 1, fire_encouragement = 60, fire_flammability = 100}, dig_by_water = 1, destroy_by_lava_flow = 1, deco_block = 1, fire_encouragement = 60, fire_flammability = 100},
drop = { drop = {
max_items = 1, max_items = 1,
items = { items = {

View File

@ -175,7 +175,8 @@ minetest.register_node("mcl_crimson:twisting_vines", {
"mcl_crimson:twisting_vines", "mcl_crimson:twisting_vines",
"mcl_crimson:twisting_vines", "mcl_crimson:twisting_vines",
}, },
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0.2,
_mcl_hardness = 0.2,
}) })
minetest.register_node("mcl_crimson:weeping_vines", { minetest.register_node("mcl_crimson:weeping_vines", {
@ -249,7 +250,8 @@ minetest.register_node("mcl_crimson:weeping_vines", {
"mcl_crimson:weeping_vines", "mcl_crimson:weeping_vines",
"mcl_crimson:weeping_vines", "mcl_crimson:weeping_vines",
}, },
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0.2,
_mcl_hardness = 0.2,
}) })
minetest.register_node("mcl_crimson:nether_sprouts", { minetest.register_node("mcl_crimson:nether_sprouts", {

View File

@ -38,8 +38,8 @@ minetest.register_node("mcl_deepslate:infested_deepslate", {
drop = "", drop = "",
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
after_dig_node = spawn_silverfish, after_dig_node = spawn_silverfish,
_mcl_hardness = 1.5, _mcl_hardness = 0,
_mcl_blast_resistance = 0.75, _mcl_blast_resistance = 0.5,
}) })
minetest.register_node("mcl_deepslate:tuff", { minetest.register_node("mcl_deepslate:tuff", {
@ -218,7 +218,10 @@ local function register_deepslate_variant(item, desc, longdesc)
end end
if item ~= "chiseled" then if item ~= "chiseled" then
mcl_stairs.register_stair_and_slab_simple("deepslate_"..item, "mcl_deepslate:deepslate_"..item, S(desc.." Stairs"), S(desc.." Slab"), S("Double "..desc.." Slab")) mcl_stairs.register_stair_and_slab_simple("deepslate_"..item, "mcl_deepslate:deepslate_"..item, S(desc.." Stairs"), S(desc.." Slab"), S("Double "..desc.." Slab"))
mcl_walls.register_wall("mcl_deepslate:deepslate"..item.."wall", S(desc.." Wall"), "mcl_deepslate:deepslate_"..item) mcl_walls.register_wall(
"mcl_deepslate:deepslate"..item.."wall",
S(desc.." Wall"),
"mcl_deepslate:deepslate_"..item)
end end
end end

View File

@ -72,7 +72,18 @@ function mcl_doors:register_trapdoor(name, def)
-- Open -- Open
else else
minetest.sound_play(def.sound_open, { pos = pos, gain = 0.3, max_hear_distance = 16 }, true) minetest.sound_play(def.sound_open, { pos = pos, gain = 0.3, max_hear_distance = 16 }, true)
tmp_node = {name=name.."_open", param1=me.param1, param2=me.param2}
local bottom_node = minetest.get_node_or_nil(vector.offset(pos, 0, -1, 0))
local name_end = "_open"
-- Checking if there is something underneath the trapdoor
if bottom_node then
local is_ladder = minetest.get_item_group(bottom_node.name, "ladder")
if is_ladder > 0 then
name_end = "_ladder"
end
end
tmp_node = { name = name .. name_end, param1 = me.param1, param2 = me.param2 }
end end
minetest.set_node(pos, tmp_node) minetest.set_node(pos, tmp_node)
end end
@ -89,9 +100,11 @@ function mcl_doors:register_trapdoor(name, def)
longdesc = def._doc_items_longdesc longdesc = def._doc_items_longdesc
if not longdesc then if not longdesc then
if def.only_redstone_can_open then if def.only_redstone_can_open then
longdesc = S("Trapdoors are horizontal barriers which can be opened or closed and climbed like a ladder when open. They occupy the upper or lower part of a block, depending on how they have been placed. This trapdoor can only be opened or closed by redstone power.") longdesc = S(
"Trapdoors are horizontal barriers which can be opened or closed and climbed like a ladder when open. They occupy the upper or lower part of a block, depending on how they have been placed. This trapdoor can only be opened or closed by redstone power.")
else else
longdesc = S("Trapdoors are horizontal barriers which can be opened or closed and climbed like a ladder when open. They occupy the upper or lower part of a block, depending on how they have been placed. This trapdoor can be opened or closed by hand or redstone power.") longdesc = S(
"Trapdoors are horizontal barriers which can be opened or closed and climbed like a ladder when open. They occupy the upper or lower part of a block, depending on how they have been placed. This trapdoor can be opened or closed by hand or redstone power.")
end end
end end
usagehelp = def._doc_items_usagehelp usagehelp = def._doc_items_usagehelp
@ -128,7 +141,7 @@ function mcl_doors:register_trapdoor(name, def)
_doc_items_usagehelp = usagehelp, _doc_items_usagehelp = usagehelp,
drawtype = "nodebox", drawtype = "nodebox",
tiles = tiles_closed, tiles = tiles_closed,
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true, use_texture_alpha = "clip",
inventory_image = def.inventory_image, inventory_image = def.inventory_image,
wield_image = def.wield_image, wield_image = def.wield_image,
is_ground_content = false, is_ground_content = false,
@ -145,11 +158,13 @@ function mcl_doors:register_trapdoor(name, def)
fixed = { fixed = {
{ -8 / 16, -8 / 16, -8 / 16, 8 / 16, -5 / 16, 8 / 16 }, }, { -8 / 16, -8 / 16, -8 / 16, 8 / 16, -5 / 16, 8 / 16 }, },
}, },
mesecons = {effector = { mesecons = {
effector = {
action_on = (function(pos, node) action_on = (function(pos, node)
punch(pos) punch(pos)
end), end),
}}, }
},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
local p0 = pointed_thing.under local p0 = pointed_thing.under
local p1 = pointed_thing.above local p1 = pointed_thing.above
@ -193,16 +208,44 @@ function mcl_doors:register_trapdoor(name, def)
groups_open.trapdoor = 2 groups_open.trapdoor = 2
groups_open.not_in_creative_inventory = 1 groups_open.not_in_creative_inventory = 1
-- Non-climbable opened
minetest.register_node(name .. "_open", { minetest.register_node(name .. "_open", {
drawtype = "nodebox", drawtype = "nodebox",
tiles = tiles_open, tiles = tiles_open,
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true, use_texture_alpha = "clip",
is_ground_content = false,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
pointable = true,
groups = groups_open,
_mcl_hardness = def._mcl_hardness,
_mcl_blast_resistance = def._mcl_blast_resistance,
sounds = def.sounds,
drop = name,
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, 5 / 16, 0.5, 0.5, 0.5 }
},
on_rightclick = on_rightclick,
mesecons = {
effector = {
action_off = (function(pos, node)
punch(pos)
end),
}
},
on_rotate = on_rotate,
})
-- Climbable opened
minetest.register_node(name .. "_ladder", {
drawtype = "nodebox",
tiles = tiles_open,
use_texture_alpha = "clip",
is_ground_content = false, is_ground_content = false,
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
-- TODO: Implement Minecraft behaviour: Climbable if directly above
-- ladder w/ matching orientation.
-- Current behavour: Always climbable
climbable = true, climbable = true,
sunlight_propagates = true, sunlight_propagates = true,
pointable = true, pointable = true,
@ -216,16 +259,17 @@ function mcl_doors:register_trapdoor(name, def)
fixed = { -0.5, -0.5, 5 / 16, 0.5, 0.5, 0.5 } fixed = { -0.5, -0.5, 5 / 16, 0.5, 0.5, 0.5 }
}, },
on_rightclick = on_rightclick, on_rightclick = on_rightclick,
mesecons = {effector = { mesecons = {
effector = {
action_off = (function(pos, node) action_off = (function(pos, node)
punch(pos) punch(pos)
end), end),
}}, }
},
on_rotate = on_rotate, on_rotate = on_rotate,
}) })
if minetest.get_modpath("doc") then if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", name, "nodes", name .. "_open") doc.add_entry_alias("nodes", name, "nodes", name .. "_open")
end end
end end

View File

@ -180,16 +180,18 @@ function mcl_enchanting.combine(itemstack, combine_with)
return false return false
end end
local enchantments = mcl_enchanting.get_enchantments(itemstack) local enchantments = mcl_enchanting.get_enchantments(itemstack)
local any_new_enchantment = false
for enchantment, combine_level in pairs(mcl_enchanting.get_enchantments(combine_with)) do for enchantment, combine_level in pairs(mcl_enchanting.get_enchantments(combine_with)) do
local enchantment_def = mcl_enchanting.enchantments[enchantment] local enchantment_def = mcl_enchanting.enchantments[enchantment]
local enchantment_level = enchantments[enchantment] local enchantment_level = enchantments[enchantment]
if enchantment_level then if enchantment_level then -- The enchantment already exist in the provided item
if enchantment_level == combine_level then if enchantment_level == combine_level then
enchantment_level = math.min(enchantment_level + 1, enchantment_def.max_level) enchantment_level = math.min(enchantment_level + 1, enchantment_def.max_level)
else else
enchantment_level = math.max(enchantment_level, combine_level) enchantment_level = math.max(enchantment_level, combine_level)
end end
elseif mcl_enchanting.item_supports_enchantment(itemname, enchantment) then any_new_enchantment = any_new_enchantment or ( enchantment_level ~= enchantments[enchantment] )
elseif mcl_enchanting.item_supports_enchantment(itemname, enchantment) then -- this is a new enchantement to try to add
local supported = true local supported = true
for incompatible in pairs(enchantment_def.incompatible) do for incompatible in pairs(enchantment_def.incompatible) do
if enchantments[incompatible] then if enchantments[incompatible] then
@ -199,24 +201,18 @@ function mcl_enchanting.combine(itemstack, combine_with)
end end
if supported then if supported then
enchantment_level = combine_level enchantment_level = combine_level
any_new_enchantment = true
end end
end end
if enchantment_level and enchantment_level > 0 then if enchantment_level and enchantment_level > 0 then
enchantments[enchantment] = enchantment_level enchantments[enchantment] = enchantment_level
end end
end end
local any_enchantment = false if any_new_enchantment then
for enchantment, enchantment_level in pairs(enchantments) do
if enchantment_level > 0 then
any_enchantment = true
break
end
end
if any_enchantment then
itemstack:set_name(enchanted_itemname) itemstack:set_name(enchanted_itemname)
end
mcl_enchanting.set_enchantments(itemstack, enchantments) mcl_enchanting.set_enchantments(itemstack, enchantments)
return true end
return any_new_enchantment
end end
function mcl_enchanting.enchantments_snippet(_, _, itemstack) function mcl_enchanting.enchantments_snippet(_, _, itemstack)

View File

@ -155,7 +155,8 @@ minetest.register_node("mcl_end:chorus_flower", {
1) On top of end stone or chorus plant 1) On top of end stone or chorus plant
2) On top of air and horizontally adjacent to exactly 1 chorus plant ]] 2) On top of air and horizontally adjacent to exactly 1 chorus plant ]]
local pos local pos
if minetest.registered_nodes[node_under.name].buildable_to then local def = minetest.registered_nodes[node_under.name]
if def and def.buildable_to then
pos = pointed_thing.under pos = pointed_thing.under
else else
pos = pointed_thing.above pos = pointed_thing.above
@ -229,7 +230,7 @@ minetest.register_node("mcl_end:chorus_flower_dead", {
groups = {handy=1,axey=1, deco_block = 1, dig_by_piston = 1, destroy_by_lava_flow = 1,chorus_plant = 1, not_in_creative_inventory=1}, groups = {handy=1,axey=1, deco_block = 1, dig_by_piston = 1, destroy_by_lava_flow = 1,chorus_plant = 1, not_in_creative_inventory=1},
after_dig_node = mcl_end.check_detach_chorus_plant, after_dig_node = mcl_end.check_detach_chorus_plant,
on_blast = mcl_end.check_blast_chorus_plant, on_blast = mcl_end.check_blast_chorus_plant,
_mcl_blast_resistance = 0.4, _mcl_blast_resistance = 2,
_mcl_hardness = 0.4, _mcl_hardness = 0.4,
}) })
@ -283,7 +284,8 @@ minetest.register_node("mcl_end:chorus_plant", {
condition is met: condition is met:
- placed on end stone or any chorus node ]] - placed on end stone or any chorus node ]]
local pos_place, node_check local pos_place, node_check
if minetest.registered_nodes[node_under.name].buildable_to then local def = minetest.registered_nodes[node_under.name]
if def and def.buildable_to then
pos_place = pointed_thing.under pos_place = pointed_thing.under
node_check = node_above node_check = node_above
else else
@ -307,7 +309,7 @@ minetest.register_node("mcl_end:chorus_plant", {
end, end,
after_dig_node = mcl_end.check_detach_chorus_plant, after_dig_node = mcl_end.check_detach_chorus_plant,
on_blast = mcl_end.check_blast_chorus_plant, on_blast = mcl_end.check_blast_chorus_plant,
_mcl_blast_resistance = 0.4, _mcl_blast_resistance = 2,
_mcl_hardness = 0.4, _mcl_hardness = 0.4,
}) })

View File

@ -44,7 +44,7 @@ minetest.register_node("mcl_farming:soil_wet", {
end, end,
groups = {handy=1,shovely=1, not_in_creative_inventory=1, dirtifies_below_solid=1, dirtifier=1, soil=3, soil_sapling=1 }, groups = {handy=1,shovely=1, not_in_creative_inventory=1, dirtifies_below_solid=1, dirtifier=1, soil=3, soil_sapling=1 },
sounds = mcl_sounds.node_sound_dirt_defaults(), sounds = mcl_sounds.node_sound_dirt_defaults(),
_mcl_blast_resistance = 0.6, _mcl_blast_resistance = 0.5,
_mcl_hardness = 0.6, _mcl_hardness = 0.6,
}) })

View File

@ -269,7 +269,16 @@ for w=1, #woods do
id = wood[1].."_fence" id = wood[1].."_fence"
id_gate = wood[1].."_fence_gate" id_gate = wood[1].."_fence_gate"
end end
mcl_fences.register_fence_and_fence_gate(id, wood[2], wood[3], wood[4], wood_groups, 2, 15, wood_connect, wood_sounds) mcl_fences.register_fence_and_fence_gate(
id,
wood[2],
wood[3],
wood[4],
wood_groups,
minetest.registered_nodes["mcl_core:wood"]._mcl_hardness,
minetest.registered_nodes["mcl_core:wood"]._mcl_blast_resistance,
wood_connect,
wood_sounds)
minetest.register_craft({ minetest.register_craft({
output = "mcl_fences:"..id.." 3", output = "mcl_fences:"..id.." 3",
@ -289,7 +298,15 @@ end
-- Nether Brick Fence (without fence gate!) -- Nether Brick Fence (without fence gate!)
mcl_fences.register_fence("nether_brick_fence", S("Nether Brick Fence"), "mcl_fences_fence_nether_brick.png", {pickaxey=1, deco_block=1, fence_nether_brick=1}, 2, 30, {"group:fence_nether_brick"}, mcl_sounds.node_sound_stone_defaults()) mcl_fences.register_fence(
"nether_brick_fence",
S("Nether Brick Fence"),
"mcl_fences_fence_nether_brick.png",
{pickaxey=1, deco_block=1, fence_nether_brick=1},
minetest.registered_nodes["mcl_nether:nether_brick"]._mcl_hardness,
minetest.registered_nodes["mcl_nether:nether_brick"]._mcl_blast_resistance,
{"group:fence_nether_brick"},
mcl_sounds.node_sound_stone_defaults())
minetest.register_craft({ minetest.register_craft({
output = "mcl_fences:nether_brick_fence 6", output = "mcl_fences:nether_brick_fence 6",

View File

@ -128,8 +128,6 @@ local fortune_wheat_seed_drop = {
overwrite = true, overwrite = true,
} }
-- CHECKME: How does tall grass behave when pushed by a piston?
--- Tall Grass --- --- Tall Grass ---
local def_tallgrass = { local def_tallgrass = {
description = S("Tall Grass"), description = S("Tall Grass"),
@ -155,7 +153,7 @@ local def_tallgrass = {
groups = { groups = {
handy = 1, shearsy = 1, attached_node = 1, deco_block = 1, handy = 1, shearsy = 1, attached_node = 1, deco_block = 1,
plant = 1, place_flowerlike = 2, non_mycelium_plant = 1, plant = 1, place_flowerlike = 2, non_mycelium_plant = 1,
flammable = 3, fire_encouragement = 60, fire_flammability = 100, flammable = 3, fire_encouragement = 60, fire_flammability = 10, dig_by_piston = 1,
dig_by_water = 1, destroy_by_lava_flow = 1, compostability = 30, grass_palette = 1 dig_by_water = 1, destroy_by_lava_flow = 1, compostability = 30, grass_palette = 1
}, },
sounds = mcl_sounds.node_sound_leaves_defaults(), sounds = mcl_sounds.node_sound_leaves_defaults(),
@ -252,7 +250,7 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
paramtype2 = paramtype2, paramtype2 = paramtype2,
palette = palette, palette = palette,
walkable = false, walkable = false,
buildable_to = true, buildable_to = false,
drop = drop_bottom, drop = drop_bottom,
_mcl_shears_drop = shears_drop, _mcl_shears_drop = shears_drop,
_mcl_fortune_drop = fortune_drop, _mcl_fortune_drop = fortune_drop,
@ -354,7 +352,7 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
paramtype2 = paramtype2, paramtype2 = paramtype2,
palette = palette, palette = palette,
walkable = false, walkable = false,
buildable_to = true, buildable_to = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -selbox_radius, -0.5, -selbox_radius, selbox_radius, selbox_top_height, selbox_radius }, fixed = { -selbox_radius, -0.5, -selbox_radius, selbox_radius, selbox_top_height, selbox_radius },

View File

@ -1,5 +1,7 @@
-- Code based from mcl_anvils -- Code based from mcl_anvils
mcl_grindstone = {}
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
local F = minetest.formspec_escape local F = minetest.formspec_escape
local C = minetest.colorize local C = minetest.colorize
@ -55,7 +57,7 @@ local function create_new_item(name_item, meta, wear)
end end
-- If an item has an enchanment then remove "_enchanted" from the name -- If an item has an enchanment then remove "_enchanted" from the name
local function remove_enchant_name(stack) function mcl_grindstone.remove_enchant_name(stack)
if mcl_enchanting.is_enchanted(stack:get_name()) then if mcl_enchanting.is_enchanted(stack:get_name()) then
local name = stack:get_name() local name = stack:get_name()
return name.sub(name, 1, -11) return name.sub(name, 1, -11)
@ -116,8 +118,8 @@ local function update_grindstone_slots(meta)
local def1 = input1:get_definition() local def1 = input1:get_definition()
local def2 = input2:get_definition() local def2 = input2:get_definition()
-- Remove enchant name if they have one -- Remove enchant name if they have one
local name1 = remove_enchant_name(input1) local name1 = mcl_grindstone.remove_enchant_name(input1)
local name2 = remove_enchant_name(input2) local name2 = mcl_grindstone.remove_enchant_name(input2)
-- Calculate repair -- Calculate repair
local function calculate_repair(dur1, dur2) local function calculate_repair(dur1, dur2)
@ -143,7 +145,7 @@ local function update_grindstone_slots(meta)
local def1 = input1:get_definition() local def1 = input1:get_definition()
local meta = input1:get_meta() local meta = input1:get_meta()
if def1.type == "tool" and mcl_enchanting.is_enchanted(input1:get_name()) then if def1.type == "tool" and mcl_enchanting.is_enchanted(input1:get_name()) then
local name = remove_enchant_name(input1) local name = mcl_grindstone.remove_enchant_name(input1)
local wear = input1:get_wear() local wear = input1:get_wear()
local new_item = create_new_item(name, meta, wear) local new_item = create_new_item(name, meta, wear)
new_output = transfer_curse(input1, new_item) new_output = transfer_curse(input1, new_item)
@ -157,7 +159,7 @@ local function update_grindstone_slots(meta)
local def2 = input2:get_definition() local def2 = input2:get_definition()
local meta = input2:get_meta() local meta = input2:get_meta()
if def2.type == "tool" and mcl_enchanting.is_enchanted(input2:get_name()) then if def2.type == "tool" and mcl_enchanting.is_enchanted(input2:get_name()) then
local name = remove_enchant_name(input2) local name = mcl_grindstone.remove_enchant_name(input2)
local wear = input2:get_wear() local wear = input2:get_wear()
local new_item = create_new_item(name, meta, wear) local new_item = create_new_item(name, meta, wear)
new_output = transfer_curse(input2, new_item) new_output = transfer_curse(input2, new_item)

View File

@ -118,7 +118,7 @@ function mcl_lanterns.register_lantern(name, def)
node_placement_prediction = "", node_placement_prediction = "",
sunlight_propagates = true, sunlight_propagates = true,
light_source = def.light_level, light_source = def.light_level,
groups = {pickaxey = 1, attached_node = 1, deco_block = 1, lantern = 1}, groups = {pickaxey = 1, attached_node = 1, deco_block = 1, lantern = 1, dig_by_piston=1},
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {

View File

@ -31,8 +31,8 @@ local lectern_def = {
walkable = true, walkable = true,
is_ground_content = false, is_ground_content = false,
node_placement_prediction = "", node_placement_prediction = "",
_mcl_blast_resistance = 2.5, _mcl_blast_resistance = 3,
_mcl_hardness = 2.5, _mcl_hardness = 2,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {

View File

@ -60,8 +60,7 @@ local rod_def = {
return minetest.item_place(itemstack, placer, pointed_thing, param2) return minetest.item_place(itemstack, placer, pointed_thing, param2)
end, end,
_mcl_blast_resistance = 6, _mcl_blast_resistance = 0,
_mcl_hardness = 3,
} }
minetest.register_node("mcl_lightning_rods:rod", rod_def) minetest.register_node("mcl_lightning_rods:rod", rod_def)

View File

@ -183,7 +183,7 @@ mcl_flowerpots.register_potted_flower("mcl_mangrove:propagule", {
image = "mcl_mangrove_propagule.png", image = "mcl_mangrove_propagule.png",
}) })
local water_tex = "default_water_source_animated.png^[verticalframe:16:0^[multiply:#3F76E4" local water_tex = "mcl_core_water_source_animation.png^[verticalframe:16:0^[multiply:#3F76E4"
local wlroots = { local wlroots = {
description = S("water logged mangrove roots"), description = S("water logged mangrove roots"),
@ -194,12 +194,12 @@ local wlroots = {
S("These cannot be crafted yet only occure when get in contact of water."), S("These cannot be crafted yet only occure when get in contact of water."),
_doc_items_hidden = false, _doc_items_hidden = false,
tiles = { tiles = {
{name="default_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0}} {name="mcl_core_water_source_animation.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0}}
}, },
special_tiles = { special_tiles = {
-- New-style water source material (mostly unused) -- New-style water source material (mostly unused)
{ {
name="default_water_source_animated.png", name="mcl_core_water_source_animation.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0}, animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0},
backface_culling = false, backface_culling = false,
} }
@ -221,7 +221,7 @@ local wlroots = {
liquids_pointable = true, liquids_pointable = true,
drop = "mcl_mangrove:mangrove_roots", drop = "mcl_mangrove:mangrove_roots",
groups = { groups = {
handy = 1, hoey = 1, water=3, liquid=3, puts_out_fire=1, dig_by_piston = 1, deco_block = 1, not_in_creative_inventory=1 }, handy = 1, hoey = 1, water=3, liquid=3, puts_out_fire=1, dig_by_piston = 1, deco_block = 1, waterlogged = 1, not_in_creative_inventory=1 },
_mcl_blast_resistance = 100, _mcl_blast_resistance = 100,
_mcl_hardness = -1, -- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode _mcl_hardness = -1, -- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
on_construct = function(pos) on_construct = function(pos)
@ -245,7 +245,7 @@ local rwlroots = table.copy(wlroots)
-- FIXME luacheck complains that this is a repeated definition of water_tex. -- FIXME luacheck complains that this is a repeated definition of water_tex.
-- Maybe the tiles definition below should be replaced with the animated tile -- Maybe the tiles definition below should be replaced with the animated tile
-- definition as per above? -- definition as per above?
water_tex = "default_water_source_animated.png^[verticalframe:16:0^[multiply:#0084FF" water_tex = "mcl_core_water_source_animation.png^[verticalframe:16:0^[multiply:#0084FF"
rwlroots.tiles = { rwlroots.tiles = {
"("..water_tex..")^mcl_mangrove_roots_top.png", "("..water_tex..")^mcl_mangrove_roots_top.png",
"("..water_tex..")^mcl_mangrove_roots_side.png", "("..water_tex..")^mcl_mangrove_roots_side.png",
@ -322,14 +322,14 @@ mcl_stairs.register_stair("mangrove_wood", "mcl_mangrove:mangrove_wood",
{handy=1,axey=1, flammable=3,wood_stairs=1, material_wood=1, fire_encouragement=5, fire_flammability=20}, {handy=1,axey=1, flammable=3,wood_stairs=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
{"mcl_mangrove_planks.png"}, {"mcl_mangrove_planks.png"},
S("Mangrove Wood Stairs"), S("Mangrove Wood Stairs"),
mcl_sounds.node_sound_wood_defaults(), nil, nil, mcl_sounds.node_sound_wood_defaults(), 3, 2,
"woodlike") "woodlike")
mcl_stairs.register_slab("mangrove_wood", "mcl_mangrove:mangrove_wood", mcl_stairs.register_slab("mangrove_wood", "mcl_mangrove:mangrove_wood",
{handy=1,axey=1, flammable=3,wood_slab=1, material_wood=1, fire_encouragement=5, fire_flammability=20}, {handy=1,axey=1, flammable=3,wood_slab=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
{"mcl_mangrove_planks.png"}, {"mcl_mangrove_planks.png"},
S("Mangrove Wood Slab"), S("Mangrove Wood Slab"),
mcl_sounds.node_sound_wood_defaults(), nil, nil, mcl_sounds.node_sound_wood_defaults(), 3, 2,
S("Double Mangrove Wood Slab")) S("Double Mangrove Wood Slab"))
minetest.register_craft({ minetest.register_craft({

View File

@ -4664,7 +4664,7 @@
126, 126,
164 164
], ],
"default_water_source_animated.png": [ "mcl_core_water_source_animation.png": [
37, 37,
98, 98,
129 129
@ -4984,7 +4984,7 @@
79, 79,
64 64
], ],
"default_water_flowing_animated.png": [ "mcl_core_water_flow_animation.png": [
38, 38,
101, 101,
129 129
@ -5009,7 +5009,7 @@
89, 89,
86 86
], ],
"default_lava_flowing_animated.png": [ "mcl_core_lava_flow_animation.png": [
177, 177,
42, 42,
16 16
@ -5059,7 +5059,7 @@
142, 142,
123 123
], ],
"default_lava_source_animated.png": [ "mcl_core_lava_source_animation.png": [
180, 180,
45, 45,
17 17
@ -6604,16 +6604,6 @@
56, 56,
64 64
], ],
"default_river_water_flowing_animated.png": [
38,
123,
130
],
"default_river_water_source_animated.png": [
37,
120,
130
],
"mcl_armor_stand_item.png": [ "mcl_armor_stand_item.png": [
134, 134,
114, 114,
@ -9009,17 +8999,17 @@
127, 127,
113 113
], ],
"bucket_river_water.png": [ "mcl_buckets_river_water_bucket.png": [
139, 139,
152, 152,
155 155
], ],
"bucket_water.png": [ "mcl_buckets_water_bucket.png": [
139, 139,
147, 147,
155 155
], ],
"bucket.png": [ "mcl_buckets_bucket.png": [
147, 147,
143, 143,
139 139

View File

@ -301,7 +301,8 @@ minetest.register_node("mcl_mobspawners:spawner", {
local new_itemstack, success = minetest.item_place(itemstack, placer, pointed_thing) local new_itemstack, success = minetest.item_place(itemstack, placer, pointed_thing)
if success then if success then
local placepos local placepos
if minetest.registered_nodes[node_under.name].buildable_to then local def = minetest.registered_nodes[node_under.name]
if def and def.buildable_to then
placepos = pointed_thing.under placepos = pointed_thing.under
else else
placepos = pointed_thing.above placepos = pointed_thing.above

View File

@ -10,15 +10,10 @@ local function spawn_silverfish(pos, oldnode, oldmetadata, digger)
end end
-- Template function for registering monster egg blocks -- Template function for registering monster egg blocks
local function register_block(subname, description, tiles, is_ground_content, hardness_override) local function register_block(subname, description, tiles, is_ground_content)
if is_ground_content == nil then if is_ground_content == nil then
is_ground_content = false is_ground_content = false
end end
-- Default hardness matches for stone and stone brick variants; cobble has 1.0
local hardness = 0.75
if hardness_override then
hardness = hardness_override
end
minetest.register_node("mcl_monster_eggs:monster_egg_"..subname, { minetest.register_node("mcl_monster_eggs:monster_egg_"..subname, {
description = description, description = description,
tiles = tiles, tiles = tiles,
@ -29,14 +24,14 @@ local function register_block(subname, description, tiles, is_ground_content, ha
after_dig_node = spawn_silverfish, after_dig_node = spawn_silverfish,
_tt_help = S("Hides a silverfish"), _tt_help = S("Hides a silverfish"),
_doc_items_longdesc = S("An infested block is a block from which a silverfish will pop out when it is broken. It looks identical to its normal counterpart."), _doc_items_longdesc = S("An infested block is a block from which a silverfish will pop out when it is broken. It looks identical to its normal counterpart."),
_mcl_hardness = hardness, _mcl_hardness = 0,
_mcl_blast_resistance = 0.75, _mcl_blast_resistance = 0.5,
}) })
end end
-- Register all the monster egg blocks -- Register all the monster egg blocks
register_block("stone", S("Infested Stone"), {"default_stone.png"}, true) register_block("stone", S("Infested Stone"), {"default_stone.png"}, true)
register_block("cobble", S("Infested Cobblestone"), {"default_cobble.png"}, nil, 1.0) register_block("cobble", S("Infested Cobblestone"), {"default_cobble.png"})
register_block("stonebrick", S("Infested Stone Bricks"), {"default_stone_brick.png"}) register_block("stonebrick", S("Infested Stone Bricks"), {"default_stone_brick.png"})
register_block("stonebrickcracked", S("Infested Cracked Stone Bricks"), {"mcl_core_stonebrick_cracked.png"}) register_block("stonebrickcracked", S("Infested Cracked Stone Bricks"), {"mcl_core_stonebrick_cracked.png"})
register_block("stonebrickmossy", S("Infested Mossy Stone Bricks"), {"mcl_core_stonebrick_mossy.png"}) register_block("stonebrickmossy", S("Infested Mossy Stone Bricks"), {"mcl_core_stonebrick_mossy.png"})

View File

@ -259,8 +259,8 @@ minetest.register_node("mcl_nether:quartz_smooth", {
tiles = {"mcl_nether_quartz_block_bottom.png"}, tiles = {"mcl_nether_quartz_block_bottom.png"},
groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1}, groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1},
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 0.8,
_mcl_hardness = 2, _mcl_hardness = 0.8,
}) })
minetest.register_craftitem("mcl_nether:glowstone_dust", { minetest.register_craftitem("mcl_nether:glowstone_dust", {

View File

@ -267,7 +267,8 @@ function kelp.next_height(pos, node, pos_tip, node_tip, submerged, downward_flow
-- Flowing liquid: Grow 1 step, but also turn the tip node into a liquid source. -- Flowing liquid: Grow 1 step, but also turn the tip node into a liquid source.
if downward_flowing then if downward_flowing then
local alt_liq = mt_registered_nodes[node_tip.name].liquid_alternative_source local alt_liq = mt_registered_nodes[node_tip.name].liquid_alternative_source
if alt_liq then local alt_liq_accessible = mt_get_item_group(node_tip.name,"waterlogged") -- returns 0 if it isn't waterlogged.
if alt_liq and not alt_liq_accessible then
mt_set_node(pos_tip, {name=alt_liq}) mt_set_node(pos_tip, {name=alt_liq})
end end
end end

View File

@ -52,7 +52,7 @@ minetest.register_node("mcl_ocean:prismarine_brick", {
tiles = {"mcl_ocean_prismarine_bricks.png"}, tiles = {"mcl_ocean_prismarine_bricks.png"},
groups = {pickaxey=1, building_block=1, material_stone=1}, groups = {pickaxey=1, building_block=1, material_stone=1},
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 1.5, _mcl_blast_resistance = 6,
_mcl_hardness = 1.5, _mcl_hardness = 1.5,
}) })
@ -64,7 +64,7 @@ minetest.register_node("mcl_ocean:prismarine_dark", {
tiles = {"mcl_ocean_prismarine_dark.png"}, tiles = {"mcl_ocean_prismarine_dark.png"},
groups = {pickaxey=1, building_block=1, material_stone=1}, groups = {pickaxey=1, building_block=1, material_stone=1},
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 1.5, _mcl_blast_resistance = 6,
_mcl_hardness = 1.5, _mcl_hardness = 1.5,
}) })

View File

@ -20,6 +20,7 @@ get_chat_function["leaping"] = mcl_potions.leaping_func
get_chat_function["swiftness"] = mcl_potions.swiftness_func get_chat_function["swiftness"] = mcl_potions.swiftness_func
get_chat_function["heal"] = mcl_potions.healing_func get_chat_function["heal"] = mcl_potions.healing_func
get_chat_function["bad_omen"] = mcl_potions.bad_omen_func get_chat_function["bad_omen"] = mcl_potions.bad_omen_func
get_chat_function["withering"] = mcl_potions.withering_func
minetest.register_chatcommand("effect",{ minetest.register_chatcommand("effect",{
params = S("<effect> <duration> [<factor>]"), params = S("<effect> <duration> [<factor>]"),

View File

@ -10,6 +10,7 @@ EF.swift = {} -- for swiftness AND slowness
EF.night_vision = {} EF.night_vision = {}
EF.fire_proof = {} EF.fire_proof = {}
EF.bad_omen = {} EF.bad_omen = {}
EF.withering = {}
local EFFECT_TYPES = 0 local EFFECT_TYPES = 0
for _,_ in pairs(EF) do for _,_ in pairs(EF) do
@ -19,8 +20,11 @@ end
local icon_ids = {} local icon_ids = {}
local function potions_set_hudbar(player) local function potions_set_hudbar(player)
if EF.withering[player] and EF.regenerating[player] then
if EF.poisoned[player] and EF.regenerating[player] then hb.change_hudbar(player, "health", nil, nil, "mcl_potions_icon_regen_wither.png", nil, "hudbars_bar_health.png")
elseif EF.withering[player] then
hb.change_hudbar(player, "health", nil, nil, "mcl_potions_icon_wither.png", nil, "hudbars_bar_health.png")
elseif EF.poisoned[player] and EF.regenerating[player] then
hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_regen_poison.png", nil, "hudbars_bar_health.png") hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_regen_poison.png", nil, "hudbars_bar_health.png")
elseif EF.poisoned[player] then elseif EF.poisoned[player] then
hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hudbars_bar_health.png") hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hudbars_bar_health.png")
@ -123,6 +127,33 @@ minetest.register_globalstep(function(dtime)
end end
-- Check for withering players
for player, vals in pairs(EF.withering) do
is_player = player:is_player()
entity = player:get_luaentity()
EF.withering[player].timer = EF.withering[player].timer + dtime
EF.withering[player].hit_timer = (EF.withering[player].hit_timer or 0) + dtime
if player:get_pos() then mcl_potions._add_spawner(player, "#000000") end
if EF.withering[player].hit_timer >= EF.withering[player].step then
if is_player or entity then mcl_util.deal_damage(player, 1, {type = "magic"}) end
if EF.withering[player] then EF.withering[player].hit_timer = 0 end
end
if EF.withering[player] and EF.withering[player].timer >= EF.withering[player].dur then
EF.withering[player] = nil
if is_player then
meta = player:get_meta()
meta:set_string("_is_withering", minetest.serialize(EF.withering[player]))
potions_set_hud(player)
end
end
end
-- Check for poisoned players -- Check for poisoned players
for player, vals in pairs(EF.poisoned) do for player, vals in pairs(EF.poisoned) do
@ -152,7 +183,7 @@ minetest.register_globalstep(function(dtime)
end end
-- Check for regnerating players -- Check for regenerating players
for player, vals in pairs(EF.regenerating) do for player, vals in pairs(EF.regenerating) do
is_player = player:is_player() is_player = player:is_player()
@ -408,6 +439,7 @@ function mcl_potions._clear_cached_player_data(player)
EF.night_vision[player] = nil EF.night_vision[player] = nil
EF.fire_proof[player] = nil EF.fire_proof[player] = nil
EF.bad_omen[player] = nil EF.bad_omen[player] = nil
EF.withering[player] = nil
meta = player:get_meta() meta = player:get_meta()
meta:set_int("night_vision", 0) meta:set_int("night_vision", 0)
@ -452,6 +484,7 @@ function mcl_potions._save_player_effects(player)
meta:set_string("_is_cat", minetest.serialize(EF.night_vision[player])) meta:set_string("_is_cat", minetest.serialize(EF.night_vision[player]))
meta:set_string("_is_fire_proof", minetest.serialize(EF.fire_proof[player])) meta:set_string("_is_fire_proof", minetest.serialize(EF.fire_proof[player]))
meta:set_string("_has_bad_omen", minetest.serialize(EF.bad_omen[player])) meta:set_string("_has_bad_omen", minetest.serialize(EF.bad_omen[player]))
meta:set_string("_is_withering", minetest.serialize(EF.withering[player]))
end end
@ -507,6 +540,10 @@ function mcl_potions._load_player_effects(player)
EF.bad_omen[player] = minetest.deserialize(meta:get_string("_has_bad_omen")) EF.bad_omen[player] = minetest.deserialize(meta:get_string("_has_bad_omen"))
end end
if minetest.deserialize(meta:get_string("_is_withering")) then
EF.withering[player] = minetest.deserialize(meta:get_string("_is_withering"))
end
end end
-- Returns true if player has given effect -- Returns true if player has given effect
@ -693,11 +730,9 @@ end
function mcl_potions.healing_func(player, hp) function mcl_potions.healing_func(player, hp)
local obj = player:get_luaentity() if not player or player:get_hp() <= 0 then return false end
if player:get_hp() == 0 then local obj = player:get_luaentity()
return
end
if obj and obj.harmed_by_heal then hp = -hp end if obj and obj.harmed_by_heal then hp = -hp end
@ -725,6 +760,11 @@ end
function mcl_potions.swiftness_func(player, factor, duration) function mcl_potions.swiftness_func(player, factor, duration)
if not player or player:get_hp() <= 0 then return false end
local entity = player:get_luaentity()
if entity and entity.is_boss then return false end
if not player:get_meta() then if not player:get_meta() then
return false return false
end end
@ -753,6 +793,11 @@ end
function mcl_potions.leaping_func(player, factor, duration) function mcl_potions.leaping_func(player, factor, duration)
if not player or player:get_hp() <= 0 then return false end
local entity = player:get_luaentity()
if entity and entity.is_boss then return false end
if not player:get_meta() then if not player:get_meta() then
return false return false
end end
@ -781,6 +826,11 @@ end
function mcl_potions.weakness_func(player, factor, duration) function mcl_potions.weakness_func(player, factor, duration)
if not player or player:get_hp() <= 0 then return false end
local entity = player:get_luaentity()
if entity and entity.is_boss then return false end
if not EF.weak[player] then if not EF.weak[player] then
EF.weak[player] = {dur = duration, timer = 0, factor = factor} EF.weak[player] = {dur = duration, timer = 0, factor = factor}
@ -804,6 +854,11 @@ end
function mcl_potions.strength_func(player, factor, duration) function mcl_potions.strength_func(player, factor, duration)
if not player or player:get_hp() <= 0 then return false end
local entity = player:get_luaentity()
if entity and entity.is_boss then return false end
if not EF.strong[player] then if not EF.strong[player] then
EF.strong[player] = {dur = duration, timer = 0, factor = factor} EF.strong[player] = {dur = duration, timer = 0, factor = factor}
@ -825,8 +880,41 @@ function mcl_potions.strength_func(player, factor, duration)
end end
function mcl_potions.withering_func(player, factor, duration)
if not player or player:get_hp() <= 0 then return false end
local entity = player:get_luaentity()
if entity and (entity.is_boss or string.find(entity.name, "wither")) then return false end
if not EF.withering[player] then
EF.withering[player] = {step = factor, dur = duration, timer = 0}
else
local victim = EF.withering[player]
victim.step = math.min(victim.step, factor)
victim.dur = math.max(duration, victim.dur - victim.timer)
victim.timer = 0
end
if player:is_player() then
potions_set_hud(player)
end
end
function mcl_potions.poison_func(player, factor, duration) function mcl_potions.poison_func(player, factor, duration)
if not player or player:get_hp() <= 0 then return false end
local entity = player:get_luaentity()
if entity and (entity.is_boss or entity.harmed_by_heal or string.find(entity.name, "spider")) then return false end
if not EF.poisoned[player] then if not EF.poisoned[player] then
EF.poisoned[player] = {step = factor, dur = duration, timer = 0} EF.poisoned[player] = {step = factor, dur = duration, timer = 0}
@ -850,6 +938,11 @@ end
function mcl_potions.regeneration_func(player, factor, duration) function mcl_potions.regeneration_func(player, factor, duration)
if not player or player:get_hp() <= 0 then return false end
local entity = player:get_luaentity()
if entity and (entity.is_boss or entity.harmed_by_heal) then return false end
if not EF.regenerating[player] then if not EF.regenerating[player] then
EF.regenerating[player] = {step = factor, dur = duration, timer = 0} EF.regenerating[player] = {step = factor, dur = duration, timer = 0}
@ -873,6 +966,11 @@ end
function mcl_potions.invisiblility_func(player, null, duration) function mcl_potions.invisiblility_func(player, null, duration)
if not player or player:get_hp() <= 0 then return false end
local entity = player:get_luaentity()
if entity and entity.is_boss then return false end
if not EF.invisible[player] then if not EF.invisible[player] then
EF.invisible[player] = {dur = duration, timer = 0} EF.invisible[player] = {dur = duration, timer = 0}
@ -895,6 +993,11 @@ end
function mcl_potions.water_breathing_func(player, null, duration) function mcl_potions.water_breathing_func(player, null, duration)
if not player or player:get_hp() <= 0 then return false end
local entity = player:get_luaentity()
if entity and entity.is_boss then return false end
if not EF.water_breathing[player] then if not EF.water_breathing[player] then
EF.water_breathing[player] = {dur = duration, timer = 0} EF.water_breathing[player] = {dur = duration, timer = 0}
@ -917,6 +1020,11 @@ end
function mcl_potions.fire_resistance_func(player, null, duration) function mcl_potions.fire_resistance_func(player, null, duration)
if not player or player:get_hp() <= 0 then return false end
local entity = player:get_luaentity()
if entity and entity.is_boss then return false end
if not EF.fire_proof[player] then if not EF.fire_proof[player] then
EF.fire_proof[player] = {dur = duration, timer = 0} EF.fire_proof[player] = {dur = duration, timer = 0}
@ -938,6 +1046,11 @@ end
function mcl_potions.night_vision_func(player, null, duration) function mcl_potions.night_vision_func(player, null, duration)
if not player or player:get_hp() <= 0 then return false end
local entity = player:get_luaentity()
if entity and entity.is_boss then return false end
meta = player:get_meta() meta = player:get_meta()
if not EF.night_vision[player] then if not EF.night_vision[player] then

View File

@ -356,6 +356,7 @@ local awkward_table = {
["mcl_fishing:pufferfish_raw"] = "mcl_potions:water_breathing", ["mcl_fishing:pufferfish_raw"] = "mcl_potions:water_breathing",
["mcl_mobitems:ghast_tear"] = "mcl_potions:regeneration", ["mcl_mobitems:ghast_tear"] = "mcl_potions:regeneration",
["mcl_mobitems:spider_eye"] = "mcl_potions:poison", ["mcl_mobitems:spider_eye"] = "mcl_potions:poison",
["mcl_flowers:wither_rose"] = "mcl_potions:withering",
["mcl_mobitems:rabbit_foot"] = "mcl_potions:leaping", ["mcl_mobitems:rabbit_foot"] = "mcl_potions:leaping",
} }
@ -373,7 +374,7 @@ local potions = {}
for i, potion in ipairs({"healing","harming","swiftness","slowness", for i, potion in ipairs({"healing","harming","swiftness","slowness",
"leaping","poison","regeneration","invisibility","fire_resistance", "leaping","poison","regeneration","invisibility","fire_resistance",
-- "weakness","strength", -- "weakness","strength",
"water_breathing","night_vision"}) do "water_breathing","night_vision", "withering"}) do
table.insert(potions, potion) table.insert(potions, potion)
@ -461,6 +462,31 @@ function mcl_potions.get_alchemy(ingr, pot)
return false return false
end end
mcl_mobs.effect_functions["poison"] = mcl_potions.poison_func
mcl_mobs.effect_functions["regeneration"] = mcl_potions.regeneration_func
mcl_mobs.effect_functions["invisibility"] = mcl_potions.invisiblility_func
mcl_mobs.effect_functions["fire_resistance"] = mcl_potions.fire_resistance_func
mcl_mobs.effect_functions["night_vision"] = mcl_potions.night_vision_func
mcl_mobs.effect_functions["water_breathing"] = mcl_potions.water_breathing_func
mcl_mobs.effect_functions["leaping"] = mcl_potions.leaping_func
mcl_mobs.effect_functions["swiftness"] = mcl_potions.swiftness_func
mcl_mobs.effect_functions["heal"] = mcl_potions.healing_func
mcl_mobs.effect_functions["bad_omen"] = mcl_potions.bad_omen_func
mcl_mobs.effect_functions["withering"] = mcl_potions.withering_func
-- give withering to players in a wither rose
local etime = 0
minetest.register_globalstep(function(dtime)
etime = dtime + etime
if etime < 0.5 then return end
etime = 0
for _,pl in pairs(minetest.get_connected_players()) do
local npos = vector.offset(pl:get_pos(), 0, 0.2, 0)
local n = minetest.get_node(npos)
if n.name == "mcl_flowers:wither_rose" then mcl_potions.withering_func(pl, 1, 2) end
end
end)
mcl_wip.register_wip_item("mcl_potions:night_vision") mcl_wip.register_wip_item("mcl_potions:night_vision")
mcl_wip.register_wip_item("mcl_potions:night_vision_plus") mcl_wip.register_wip_item("mcl_potions:night_vision_plus")
mcl_wip.register_wip_item("mcl_potions:night_vision_splash") mcl_wip.register_wip_item("mcl_potions:night_vision_splash")

View File

@ -1,2 +1,2 @@
name = mcl_potions name = mcl_potions
depends = mcl_core, mcl_farming, mcl_mobitems, mcl_fishing, mcl_bows, mcl_end, mcl_weather, playerphysics, mcl_wip depends = mcl_core, mcl_farming, mcl_flowers, mcl_mobitems, mcl_mobs, mcl_fishing, mcl_bows, mcl_end, mcl_weather, playerphysics, mcl_wip

View File

@ -79,7 +79,7 @@ local function register_potion(def)
if def.is_inv then if def.is_inv then
dur = dur * mcl_potions.INV_FACTOR dur = dur * mcl_potions.INV_FACTOR
end end
if def.name == "poison" or def.name == "regeneration" then if def.name == "poison" or def.name == "regeneration" or def.name == "withering" then
dur = 45 dur = 45
end end
@ -93,7 +93,7 @@ local function register_potion(def)
local _tt local _tt
if effect and def.is_dur then if effect and def.is_dur then
_tt = perc_string(effect).." | "..time_string(dur) _tt = perc_string(effect).." | "..time_string(dur)
if def.name == "poison" or def.name == "regeneration" then if def.name == "poison" or def.name == "regeneration" or def.name == "withering" then
_tt = S("1 HP/@1s | @2", effect, time_string(dur)) _tt = S("1 HP/@1s | @2", effect, time_string(dur))
end end
elseif def.name == "healing" or def.name == "harming" then elseif def.name == "healing" or def.name == "harming" then
@ -235,6 +235,8 @@ local function register_potion(def)
effect_II = def.effect*mcl_potions.II_FACTOR effect_II = def.effect*mcl_potions.II_FACTOR
elseif def.name == "poison" or def.name == "regeneration" then elseif def.name == "poison" or def.name == "regeneration" then
effect_II = 1.2 effect_II = 1.2
elseif def.name == "withering" then
effect_II = 2
else else
effect_II = def.effect^mcl_potions.II_FACTOR effect_II = def.effect^mcl_potions.II_FACTOR
end end
@ -327,7 +329,7 @@ local function register_potion(def)
if def.is_plus then if def.is_plus then
local dur_pl = dur * mcl_potions.PLUS_FACTOR local dur_pl = dur * mcl_potions.PLUS_FACTOR
if def.name == "poison" or def.name == "regeneration" then if def.name == "poison" or def.name == "regeneration" or def.name == "withering" then
dur_pl = 90 dur_pl = 90
end end
@ -533,6 +535,20 @@ local leaping_def = {
is_plus = true, is_plus = true,
} }
local withering_def = {
name = "withering",
description = S("Withering"),
_tt = nil,
_longdesc = S("Applies the withering effect which deals damage at a regular interval and can kill."),
color = "#000000",
effect = 4,
is_dur = true,
on_use = mcl_potions.withering_func,
is_II = true,
is_plus = true,
is_inv = true,
}
local poison_def = { local poison_def = {
name = "poison", name = "poison",
description = S("Poison"), description = S("Poison"),
@ -597,7 +613,7 @@ local fire_resistance_def = {
local defs = { awkward_def, mundane_def, thick_def, dragon_breath_def, local defs = { awkward_def, mundane_def, thick_def, dragon_breath_def,
healing_def, harming_def, night_vision_def, swiftness_def, healing_def, harming_def, night_vision_def, swiftness_def,
slowness_def, leaping_def, poison_def, regeneration_def, slowness_def, leaping_def, withering_def, poison_def, regeneration_def,
invisibility_def, water_breathing_def, fire_resistance_def} invisibility_def, water_breathing_def, fire_resistance_def}
for _, def in ipairs(defs) do for _, def in ipairs(defs) do

View File

@ -110,7 +110,7 @@ function mcl_potions.register_splash(name, descr, color, def)
for _,obj in pairs(minetest.get_objects_inside_radius(pos, 4)) do for _,obj in pairs(minetest.get_objects_inside_radius(pos, 4)) do
local entity = obj:get_luaentity() local entity = obj:get_luaentity()
if obj:is_player() or entity.is_mob then if obj:is_player() or entity and entity.is_mob then
local pos2 = obj:get_pos() local pos2 = obj:get_pos()
local rad = math.floor(math.sqrt((pos2.x-pos.x)^2 + (pos2.y-pos.y)^2 + (pos2.z-pos.z)^2)) local rad = math.floor(math.sqrt((pos2.x-pos.x)^2 + (pos2.y-pos.y)^2 + (pos2.z-pos.z)^2))

Some files were not shown because too many files have changed in this diff Show More