forked from MineClone5/MineClone5
parent
51e4b7876a
commit
10d2db72a7
|
@ -120,13 +120,13 @@ minetest.register_node("mcl_nether:netherrack", {
|
||||||
-- Eternal fire on top
|
-- Eternal fire on top
|
||||||
after_destruct = eternal_after_destruct,
|
after_destruct = eternal_after_destruct,
|
||||||
_on_ignite = eternal_on_ignite,
|
_on_ignite = eternal_on_ignite,
|
||||||
on_rightclick = function(pos, node, pointed_thing, itemstack)
|
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||||
if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then
|
if player:get_wielded_item():get_name() == "mcl_dye:white" then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
local ni = 0 -- stand for neigbour item
|
local ni = 0 -- stand for neigbour item
|
||||||
for x = pos.x - 1,pos.x + 1 do
|
for x = pos.x - 1,pos.x + 1 do
|
||||||
local node = minetest.get_node({x = x, y = pos.y, z = pos.z})
|
local node = minetest.get_node({x = x, y = pos.y, z = pos.z})
|
||||||
if ni == 0 then
|
if ni == 0 then
|
||||||
if node.name == "mcl_mushroom:warped_nylium" then ni = 1
|
if node.name == "mcl_mushroom:warped_nylium" then ni = 1
|
||||||
elseif node.name == "mcl_mushroom:crimson_nylium" then ni = 2 end
|
elseif node.name == "mcl_mushroom:crimson_nylium" then ni = 2 end
|
||||||
elseif (ni == 1) or (ni == 2) then
|
elseif (ni == 1) or (ni == 2) then
|
||||||
|
@ -135,7 +135,7 @@ minetest.register_node("mcl_nether:netherrack", {
|
||||||
end
|
end
|
||||||
for z = pos.z - 1,pos.z + 1 do
|
for z = pos.z - 1,pos.z + 1 do
|
||||||
local node = minetest.get_node({x = pos.x, y = pos.y, z = z})
|
local node = minetest.get_node({x = pos.x, y = pos.y, z = z})
|
||||||
if ni == 0 then
|
if ni == 0 then
|
||||||
if node.name == "mcl_mushroom:warped_nylium" then ni = 1
|
if node.name == "mcl_mushroom:warped_nylium" then ni = 1
|
||||||
elseif node.name == "mcl_mushroom:crimson_nylium" then ni = 2 end
|
elseif node.name == "mcl_mushroom:crimson_nylium" then ni = 2 end
|
||||||
elseif (ni == 1) or (ni == 2) then
|
elseif (ni == 1) or (ni == 2) then
|
||||||
|
@ -146,7 +146,15 @@ minetest.register_node("mcl_nether:netherrack", {
|
||||||
|
|
||||||
if ni == 1 then minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name="mcl_mushroom:warped_nylium"})
|
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
|
elseif ni == 2 then minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name="mcl_mushroom:crimson_nylium"}) end
|
||||||
end
|
else
|
||||||
|
if not (pointed_thing == nil) and pointed_thing.type == "node" then
|
||||||
|
--print(minetest.is_creative(player))
|
||||||
|
minetest.place_node(minetest.get_pointed_thing_position(pointed_thing, true), {name = player:get_wielded_item():get_name()})
|
||||||
|
if not (minetest.check_player_privs(player, {creative=true})) and not (minetest.settings:get_bool("creative_mode")) then
|
||||||
|
itemstack:take_item()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue