diff --git a/depends.txt b/depends.txt index f21be6b..7f0ced9 100644 --- a/depends.txt +++ b/depends.txt @@ -4,6 +4,7 @@ farming ? darkage ? building_blocks ? teleport_potion ? +scaffolding ? moreores ? mobs_animal ? mobs_better_rat ? diff --git a/functions.lua b/functions.lua new file mode 100644 index 0000000..9c4d1c6 --- /dev/null +++ b/functions.lua @@ -0,0 +1,40 @@ +--[[ Nodestacking function by https://github.com/minetest-mods/gloopblocks ]] + +local nodes={"scaffolding:reinforced_iron_scaffolding", + "scaffolding:iron_scaffolding", + "scaffolding:scaffolding", + "scaffolding:reinforced_scaffolding" + } + +for i = 1, 4 do + local nodes = nodes[i] + minetest.override_item(nodes, { + on_rightclick = function(pos, node, clicker, itemstack) + if itemstack and itemstack:get_name() == node.name then + for i = 1,19 do + if minetest.get_node({x=pos.x,z=pos.z}).name == nodes and scafffound ~= 0 and scafffound ~= 1 then + local scafffound = 1 + return itemstack + else + break + end + end + for i = 1,19 do + if minetest.get_node({x=pos.x,y=pos.y+i,z=pos.z}).name == "air" and scaffworked ~= 1 and scaffworked ~= 0 then + minetest.set_node({x=pos.x,y=pos.y+i,z=pos.z}, {name=nodes}) + local scaffworked = 1 + return ItemStack(tostring(itemstack:get_name().." "..tostring(itemstack:get_count()-1))) + elseif minetest.get_node({x=pos.x,y=pos.y+i,z=pos.z}).name == nodes then + else + local scaffworked = 0 + end + end + if scaffworked == 1 then + return ItemStack(tostring(itemstack:get_name().." "..tostring(itemstack:get_count()-1))) + else + return itemstack + end + else return itemstack end + end, + }) +end diff --git a/init.lua b/init.lua index f10fd1f..0479607 100644 --- a/init.lua +++ b/init.lua @@ -5,12 +5,23 @@ dofile(minetest.get_modpath("illuna").."/crafting.lua") dofile(minetest.get_modpath("illuna").."/commands.lua") dofile(minetest.get_modpath("illuna").."/register.lua") dofile(minetest.get_modpath("illuna").."/aliases.lua") +dofile(minetest.get_modpath("illuna").."/functions.lua") dofile(minetest.get_modpath("illuna").."/craftitems.lua") dofile(minetest.get_modpath("illuna").."/shop.lua") if minetest.get_modpath("moreblocks") then dofile(minetest.get_modpath("illuna").."/moreblocks.lua") end - +--[[ +minetest.register_on_chat_message(function(name, message) + if message:sub(1,1) == "/" then + return false + else + minetest.chat_send_all(core.colorize("#A3B5CB", "<"..name.."> ") ..core.colorize("#66BEF5", message)) + return true + end + return "" +end) +]] -- Water mechanics from the ethereal mod -- -- If Crystal Spike, Crystal Dirt, Snow near Water, change Water to Ice