master
Ginger88895 2015-10-23 08:24:41 +00:00
parent 0d36ac70e4
commit 65c7fe5734
1 changed files with 2 additions and 10 deletions

View File

@ -145,21 +145,14 @@ minetest.register_node("chemistry:extractor", {
inventory_image = "extractor.png",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,chemistry=1},
on_punch = function(pos)
minetest.env:set_node(pos,{name="chemistry:reactor"})
local node_name = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z}).name
for reaction in ipairs(chemistry.reactions) do
name = chemistry.reactions[reaction][1]
if name == node_name then
minetest.env:remove_node({x=pos.x-1, y=pos.y, z=pos.z})
for xx in ipairs(chemistry.reactions[reaction]) do
if xx > 1 then
for yy in ipairs(chemistry.reactions[reaction][xx]) do
minetest.env:add_node({x=pos.x+xx-1, y=pos.y+yy-1, z=pos.z},{name=chemistry.reactions[reaction][xx][yy]})
end
end
for i,str in ipairs(chemistry.reactions[reaction][2]) do
minetest.env:add_node({x=pos.x+i-1, y=pos.y, z=pos.z},{name=str})
end
return
@ -174,7 +167,6 @@ minetest.register_node("chemistry:reactor", {
inventory_image = "reactor.png",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,chemistry=1},
on_punch = function(pos)
minetest.set_node(pos,{name="chemistry:extractor"})
end,
})