From c334970311ffc51065c540e9e2a09b0734ee7f9e Mon Sep 17 00:00:00 2001 From: adrido Date: Fri, 12 Jul 2013 17:26:24 +0200 Subject: [PATCH] removed sandstone_cobble and desert_stone_cobble because its in default removed sandstone_cobble and desert_stone_cobble because its in default the moreblocks mod is now only a option added alias for sandstone_cobble and desert_stone_cobble --- alias.lua | 2 + depends.txt | 3 +- init.lua | 129 ++++++++++++++++++++++++++----------------- stairs.lua | 146 +++++++++++++++++++++++++++++++++++++------------ stairsplus.lua | 20 +++---- 5 files changed, 204 insertions(+), 96 deletions(-) create mode 100644 alias.lua diff --git a/alias.lua b/alias.lua new file mode 100644 index 0000000..4daeedb --- /dev/null +++ b/alias.lua @@ -0,0 +1,2 @@ +minetest.register_alias("darkage:sandstone_cobble", "default:sandstonebrick") +minetest.register_alias("darkage:desert_stone_cobble", "default:desert_stonebrick") \ No newline at end of file diff --git a/depends.txt b/depends.txt index 9cf58c3..0a3cc0b 100644 --- a/depends.txt +++ b/depends.txt @@ -1,2 +1,3 @@ default -moreblocks \ No newline at end of file +farming? +moreblocks? \ No newline at end of file diff --git a/init.lua b/init.lua index aacaa6e..bf18816 100644 --- a/init.lua +++ b/init.lua @@ -3,8 +3,12 @@ print (" ---- Dark Age is Loading! ---- ") dofile(minetest.get_modpath("darkage").."/mapgen.lua") dofile(minetest.get_modpath("darkage").."/building.lua") dofile(minetest.get_modpath("darkage").."/furniture.lua") ---dofile(minetest.get_modpath("darkage").."/stairs.lua") -dofile(minetest.get_modpath("darkage").."/stairsplus.lua") +dofile(minetest.get_modpath("darkage").."/alias.lua") +if minetest.get_modpath("moreblocks") then +dofile(minetest.get_modpath("darkage").."/stairsplus.lua")--only if moreblocks installed +else +dofile(minetest.get_modpath("darkage").."/stairs.lua") +end ---------- -- Items ---------- @@ -54,13 +58,13 @@ minetest.register_node("darkage:cobble_with_plaster", { sounds = default.node_sound_stone_defaults(), }) -minetest.register_node("darkage:desert_stone_cobble", { - description = "Desert Stone Cobble", - tiles = {"darkage_desert_stone_cobble.png"}, - is_ground_content = true, - groups = {cracky=3}, - sounds = default.node_sound_stone_defaults() -}) +--minetest.register_node("darkage:desert_stone_cobble", { +-- description = "Desert Stone Cobble", +-- tiles = {"darkage_desert_stone_cobble.png"}, +-- is_ground_content = true, +-- groups = {cracky=3}, +-- sounds = default.node_sound_stone_defaults() +--}) minetest.register_node("darkage:desert_stone_with_iron", { description = "Desert Iron Ore", @@ -155,13 +159,15 @@ minetest.register_node("darkage:ors_cobble", { }) -minetest.register_node("darkage:sandstone_cobble", { - description = "Sandstone Cobble", - tiles = {"darkage_sandstone_cobble.png"}, - is_ground_content = true, - groups = {crumbly=2,cracky=2}, - sounds = default.node_sound_stone_defaults() -}) +--minetest.register_node("darkage:sandstone_cobble", { +-- description = "Sandstone Cobble", +-- tiles = {"darkage_sandstone_cobble.png"}, +-- is_ground_content = true, +-- groups = {crumbly=2,cracky=2}, +-- sounds = default.node_sound_stone_defaults() +--}) + + minetest.register_node("darkage:serpentine", { description = "Serpentine", @@ -267,19 +273,19 @@ minetest.register_node("darkage:marble", { --------------- -- Overrides --------------- -minetest.registered_nodes["default:desert_stone"].drop= { - max_items = 1, - items = { - { - -- player will get cobbles with 1/3 chance - items = {'darkage:desert_stone_cobble'}, - rarity = 2, - }, - { - items = {'default:desert_stone'}, - } - } -} +--minetest.registered_nodes["default:desert_stone"].drop= { +-- max_items = 1, +-- items = { +-- { +-- -- player will get cobbles with 1/3 chance +-- items = {'darkage:desert_stone_cobble'}, +-- rarity = 2, +-- }, +-- { +-- items = {'default:desert_stone'}, +-- } +-- } +--} --------------- @@ -337,6 +343,14 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = 'darkage:chalk 2', + recipe = { + {'darkage:chalk_powder','darkage:chalk_powder'}, + {'darkage:chalk_powder','darkage:chalk_powder'}, + } +}) + minetest.register_craft({ output = 'darkage:cobble_with_plaster 2', recipe = { @@ -377,13 +391,13 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = 'darkage:ors_cobble 4', - recipe = { - {'darkage:sandstone_cobble','darkage:sandstone_cobble'}, - {'default:iron_lump','darkage:sandstone_cobble'}, - } -}) +--minetest.register_craft({ +-- output = 'darkage:ors_cobble 4', +-- recipe = { +-- {'darkage:sandstone_cobble','darkage:sandstone_cobble'}, +-- {'default:iron_lump','darkage:sandstone_cobble'}, +-- } +--}) minetest.register_craft({ output = 'darkage:silt 3', @@ -434,6 +448,19 @@ minetest.register_craft({ } }) +if minetest.get_modpath("farming") then +--only if farming installed +minetest.register_craft({ + output = 'darkage:straw 4', + recipe = { + {'farming:wheat_harvested','farming:wheat_harvested'}, + {'farming:wheat_harvested','farming:wheat_harvested'}, + } +}) +else +--nothing else +end + minetest.register_craft({ output = 'darkage:straw_bale', recipe = { @@ -456,11 +483,11 @@ minetest.register_craft({ recipe = "darkage:basalt_cobble", }) -minetest.register_craft({ - type = "cooking", - output = "default:desert_stone", - recipe = "darkage:desert_stone_cobble", -}) +--minetest.register_craft({ +-- type = "cooking", +-- output = "default:desert_stone", +-- recipe = "darkage:desert_stone_cobble", +--}) minetest.register_craft({ type = "cooking", @@ -468,11 +495,11 @@ minetest.register_craft({ recipe = "default:leaves", }) -minetest.register_craft({ - type = "cooking", - output = "darkage:sandstone_cobble", - recipe = "default:sandstone", -}) +--minetest.register_craft({ +-- type = "cooking", +-- output = "darkage:sandstone_cobble", +-- recipe = "default:sandstone", +--}) minetest.register_craft({ type = "cooking", @@ -493,11 +520,11 @@ minetest.register_craft({ }) -minetest.register_craft({ - type = "cooking", - output = "darkage:sandstone_cobble", - recipe = "default:sandstone", -}) +--minetest.register_craft({ +-- type = "cooking", +-- output = "darkage:sandstone_cobble", +-- recipe = "default:sandstone", +--}) minetest.register_craft({ type = "cooking", diff --git a/stairs.lua b/stairs.lua index 1eddea2..068ffeb 100644 --- a/stairs.lua +++ b/stairs.lua @@ -1,17 +1,111 @@ -darkage = {}; -function darkage.register_stairs(modname, subname, groups, images, desc) -table.insert(circular_saw.known_stairs, modname..":"..subname); - recipeitem = modname..":"..subname; - desc_stair = desc.." stair"; - desc_slab = desc.." slab"; - desc_panel = desc.." panel"; - desc_micro = desc.." micro"; - drop = subname - register_stair(modname, subname, recipeitem, groups, images, desc_stair, drop) - register_slab(modname, subname, recipeitem, groups, images, desc_slab, drop) - register_panel(modname, subname, recipeitem, groups, images, desc_panel, drop) - register_micro(modname, subname, recipeitem, groups, images, desc_micro, drop) +darkage = {} + +function darkage.register_stairs(modname, item, groups, images, description) + local recipeitem = modname..":"..item + local itemname = modname..":stair_"..item + minetest.register_node(itemname, { + description = description.." stair", + drawtype = "nodebox", + tiles = images, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = true, + groups = groups, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0.5, 0.5, 0.5}, + }, + }, + }) + + minetest.register_craft({ + output = itemname .. ' 4', + recipe = { + {recipeitem, "", ""}, + {recipeitem, recipeitem, ""}, + {recipeitem, recipeitem, recipeitem}, + }, + }) + + -- Flipped recipe for the silly minecrafters + minetest.register_craft({ + output = itemname .. ' 4', + recipe = { + {"", "", recipeitem}, + {"", recipeitem, recipeitem}, + {recipeitem, recipeitem, recipeitem}, + }, + }) + + itemname=modname..":slab_" .. item + + minetest.register_node(itemname, { + description = description.." slab", + drawtype = "nodebox", + tiles = images, + paramtype = "light", + is_ground_content = true, + groups = groups, + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + }, + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + }, + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" then + return itemstack + end + + -- If it's being placed on an another similar one, replace it with + -- a full block + local slabpos = nil + local slabnode = nil + local p0 = pointed_thing.under + local p1 = pointed_thing.above + local n0 = minetest.env:get_node(p0) + local n1 = minetest.env:get_node(p1) + if n0.name == itemname then + slabpos = p0 + slabnode = n0 + elseif n1.name == itemname then + slabpos = p1 + slabnode = n1 + end + if slabpos then + -- Remove the slab at slabpos + minetest.env:remove_node(slabpos) + -- Make a fake stack of a single item and try to place it + local fakestack = ItemStack(recipeitem) + pointed_thing.above = slabpos + fakestack = minetest.item_place(fakestack, placer, pointed_thing) + -- If the item was taken from the fake stack, decrement original + if not fakestack or fakestack:is_empty() then + itemstack:take_item(1) + -- Else put old node back + else + minetest.env:set_node(slabpos, slabnode) + end + return itemstack + end + + -- Otherwise place regularly + return minetest.item_place(itemstack, placer, pointed_thing) + end, + }) + + minetest.register_craft({ + output = itemname .. ' 3', + recipe = { + {recipeitem, recipeitem, recipeitem}, + }, + }) end + darkage.register_stairs("darkage","basalt_cobble", {cracky=3}, {"darkage_basalt_cobble.png"}, @@ -42,25 +136,9 @@ darkage.register_stairs("darkage","ors_cobble", "Old Red Sandtone" ) -darkage.register_stairs("darkage","desert_stone_cobble", - {cracky=3}, - {"darkage_desert_stone_cobble.png"}, - "Desert Stone Cobble" -) +--darkage.register_stairs("darkage","desert_stone_cobble", +-- {cracky=3}, +-- {"darkage_desert_stone_cobble.png"}, +-- "Desert Stone Cobble" +--) -darkage.register_stairs("darkage","slate_cobble", - {cracky=3}, - {"darkage_slate_cobble.png"}, - "Slate Cobble" -) -darkage.register_stairs("darkage","sandstone_cobble", - {cracky=3}, - {"darkage_sandstone_cobble.png"}, - "Sandstone Cobble" -) - -darkage.register_stairs("darkage","gneiss_cobble", - {cracky=3}, - {"darkage_gneiss_cobble.png"}, - "Gneiss Cobble" -) \ No newline at end of file diff --git a/stairsplus.lua b/stairsplus.lua index 4f97c03..7c8557b 100644 --- a/stairsplus.lua +++ b/stairsplus.lua @@ -42,22 +42,22 @@ darkage.register_stairs("darkage","ors_cobble", "Old Red Sandtone" ) -darkage.register_stairs("darkage","desert_stone_cobble", - {cracky=3}, - {"darkage_desert_stone_cobble.png"}, - "Desert Stone Cobble" -) +--darkage.register_stairs("darkage","desert_stone_cobble", +-- {cracky=3}, +-- {"darkage_desert_stone_cobble.png"}, +-- "Desert Stone Cobble" +--) darkage.register_stairs("darkage","slate_cobble", {cracky=3}, {"darkage_slate_cobble.png"}, "Slate Cobble" ) -darkage.register_stairs("darkage","sandstone_cobble", - {cracky=3}, - {"darkage_sandstone_cobble.png"}, - "Sandstone Cobble" -) +--darkage.register_stairs("darkage","sandstone_cobble", +-- {cracky=3}, +-- {"darkage_sandstone_cobble.png"}, +-- "Sandstone Cobble" +--) darkage.register_stairs("darkage","gneiss_cobble", {cracky=3},