From 60c4fcff2d485fc32725f5236765d668bc87ac21 Mon Sep 17 00:00:00 2001 From: debiankaios Date: Sat, 17 Jul 2021 08:12:49 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=9Emods/ITEMS/mcl=5Fnether/init.lua?= =?UTF-8?q?=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you rightclick netherack and nylium is neigbour it go on the netherack. --- mods/ITEMS/mcl_nether/init.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index 37382be7e..6814b0ceb 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -120,6 +120,33 @@ minetest.register_node("mcl_nether:netherrack", { -- Eternal fire on top after_destruct = eternal_after_destruct, _on_ignite = eternal_on_ignite, + on_rightclick = function(pos, node, pointed_thing, player, itemstack) + if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then + local ni = 0 -- stand for neigbour item + for x = pos.x - 1,pos.x + 1 do + local node = minetest.get_node({x = x, y = pos.y, z = pos.z}) + if ni == 0 then + if node.name == "mcl_mushroom:warped_nylium" then ni = 1 + elseif node.name == "mcl_mushroom:crimson_nylium" then ni = 2 end + elseif (ni == 1) or (ni == 2) then + if (node.name == "mcl_mushroom:warped_nylium") or (node.name == "mcl_mushroom:crimson_nylium") then ni = 3 end + end + end + for z = pos.z - 1,pos.z + 1 do + local node = minetest.get_node({x = pos.x, y = pos.y, z = z}) + if ni == 0 then + if node.name == "mcl_mushroom:warped_nylium" then ni = 1 + elseif node.name == "mcl_mushroom:crimson_nylium" then ni = 2 end + elseif (ni == 1) or (ni == 2) then + if (node.name == "mcl_mushroom:warped_nylium") or (node.name == "mcl_mushroom:crimson_nylium") then ni = 3 end + end + end + if ni == 3 then ni = math.random(1, 2) end + + if ni == 1 then minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name="mcl_mushroom:warped_nylium"}) + elseif ni == 2 then minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name="mcl_mushroom:crimson_nylium"}) end + end + end, }) minetest.register_node("mcl_nether:magma", {