From 24ab7ff8254b7eb7688bded408fbe0927f01536b Mon Sep 17 00:00:00 2001 From: TheRandomLegoBrick Date: Wed, 6 Jul 2022 11:33:25 -0700 Subject: [PATCH] Add mud block --- mods/ITEMS/mcl_core/nodes_base.lua | 13 ++++++ mods/ITEMS/mcl_core/textures/mcl_core_mud.png | Bin 0 -> 509 bytes mods/ITEMS/mcl_potions/init.lua | 37 ++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 mods/ITEMS/mcl_core/textures/mcl_core_mud.png diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index 957b1f24a..f25794bd1 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -457,6 +457,19 @@ minetest.register_node("mcl_core:podzol", { }) mcl_core.register_snowed_node("mcl_core:podzol_snow", "mcl_core:podzol", nil, nil, false, S("Podzol with Snow")) +minetest.register_node("mcl_core:mud", { + description = S("Mud"), + _doc_items_longdesc = S("Mud is a decorative block found in mangrove swamps. Mud can be obtained by using a watter bottle on a dirt or coarse dirt block."), + _doc_items_hidden = false, + tiles = {"mcl_core_mud.png"}, + is_ground_content = true, + stack_max = 64, + groups = {handy=1, shovely=1, enderman_takable=1, building_block=1}, + sounds = mcl_sounds.node_sound_dirt_defaults(), + _mcl_blast_resistance = 0.5, + _mcl_hardness = 0.5, +}) + minetest.register_node("mcl_core:dirt", { description = S("Dirt"), _doc_items_longdesc = S("Dirt acts as a soil for a few plants. When in light, this block may grow a grass or mycelium cover if such blocks are nearby."), diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_mud.png b/mods/ITEMS/mcl_core/textures/mcl_core_mud.png new file mode 100644 index 0000000000000000000000000000000000000000..060b8792aaa91e118ffdb8acf9ca152b2534a0c1 GIT binary patch literal 509 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0g_2XK~y+TO_6C* z!!Qhm6K_en(GCM#gy9eOzYer%v)W1dWEBRDiy0B6zvTd5ic{hyH zIF1~xG3>_L;QcsFa+qUms_JmqTjz-UkA7HLZt6M&k85H|P#SCIIqK`J>tl>o4SLWS z@O{3>1>DZrloleFWg!5CAP)N-J_+}`9RNiGFreU`W-$=lDgsp;@l#5?axd`&K&;#f zg?Q7{pvmLC@B4ljhA9VQB8eZ|DyA$8pkL<;zA;Ao=Dgo-H^;*sUo!APtQnP2z_u-k6C;n6fBU3Y?3qX#Hy+iOX>vIITNk(~66oNyVfj||>9k3?&D6LHzbX=Wgb zUUO2TGVlq|kugUtfSu6_>o59rd@`Vg>V9Wy>e^WgpYZ1-z}UG_G;|DDT0|e9Kez3z z>!9Qr3UCjpF#we1WPe*8^biTa*M-z-NI&o>QMN#|!?2Ji|P6OQe00000NkvXXu0mjf(cj)} literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 5b9f1fab3..1740f7f8d 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -214,6 +214,25 @@ minetest.register_craftitem("mcl_potions:water", { else return "mcl_potions:glass_bottle" end + + -- convert dirt to mud + elseif node.name == "mcl_core:dirt" or node.name == "mcl_core:coarse_dirt" then + + local pname = placer:get_player_name() + if minetest.is_protected(pointed_thing.under, pname) then + minetest.record_protection_violation(pointed_thing.under, pname) + return itemstack + end + + -- set the node to mud + minetest.set_node(pointed_thing.under, {name="mcl_core:mud"}) + minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) + + if minetest.is_creative_enabled(placer:get_player_name()) then + return itemstack + else + return "mcl_potions:glass_bottle" + end end end @@ -256,6 +275,24 @@ minetest.register_craftitem("mcl_potions:river_water", { -- Increase water level of cauldron by 1 minetest.set_node(pointed_thing.under, {name=cauldron}) minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) + if minetest.is_creative_enabled(placer:get_player_name()) then + return itemstack + else + return "mcl_potions:glass_bottle" + end + -- convert dirt to mud + elseif node.name == "mcl_core:dirt" or node.name == "mcl_core:coarse_dirt" then + + local pname = placer:get_player_name() + if minetest.is_protected(pointed_thing.under, pname) then + minetest.record_protection_violation(pointed_thing.under, pname) + return itemstack + end + + -- set the node to mud + minetest.set_node(pointed_thing.under, {name="mcl_core:mud"}) + minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) + if minetest.is_creative_enabled(placer:get_player_name()) then return itemstack else