diff --git a/mods/anvil/init.lua b/mods/anvil/init.lua index c48db69..e3f2c84 100644 --- a/mods/anvil/init.lua +++ b/mods/anvil/init.lua @@ -25,7 +25,7 @@ function realtest.register_anvil_recipe(RecipeDef) end end ---Unshaped metals, buckets, double ingots, sheets and hammers +--Unshaped metals, buckets, double ingots, sheets, hammers and locks for i, metal in ipairs(metals.list) do realtest.register_anvil_recipe({ item1 = "metals:"..metal.."_unshaped", @@ -57,12 +57,19 @@ for i, metal in ipairs(metals.list) do output = "metals:"..metal.."_doublesheet", level = metals.levels[i] - 1, }) + realtest.register_anvil_recipe({ + item1 = "metals:"..metal.."_ingot", + item2 = "scribing_table:plan_lock", + rmitem2 = false, + output = "metals:"..metal.."_lock", + level = metals.levels[i] + }) end --Pig iron --> Wrought iron realtest.register_anvil_recipe({ item1 = "metals:pig_iron_ingot", output = "metals:wrought_iron_ingot", - level = 3, + level = 2, }) --Instruments local instruments = @@ -99,7 +106,7 @@ local anvils = { } minetest.register_craft({ - output = 'anvil:stone_anvil', + output = 'anvil:anvil_stone', recipe = { {'default:stone','default:stone','default:stone'}, {'','default:stone',''}, @@ -110,7 +117,7 @@ minetest.register_craft({ for _, anvil in ipairs(anvils) do if anvil[1] ~= "stone" then minetest.register_craft({ - output = "anvil:"..anvil[1].."_anvil", + output = "anvil:anvil_"..anvil[1], recipe = { {"metals:"..anvil[1].."_doubleingot","metals:"..anvil[1].."_doubleingot","metals:"..anvil[1].."_doubleingot"}, {"","metals:"..anvil[1].."_doubleingot",""}, @@ -121,7 +128,7 @@ for _, anvil in ipairs(anvils) do end for _, anvil in ipairs(anvils) do - minetest.register_node("anvil:"..anvil[1].."_anvil", { + minetest.register_node("anvil:anvil_"..anvil[1], { description = anvil[2] .. " Anvil", tiles = {"anvil_"..anvil[1].."_top.png","anvil_"..anvil[1].."_top.png","anvil_"..anvil[1].."_side.png"}, drawtype = "nodebox", @@ -145,7 +152,7 @@ for _, anvil in ipairs(anvils) do {-0.35,-0.1,-0.2,0.35,0.1,0.2}, }, }, - groups = {oddly_breakable_by_hand=2, cracky=3, dig_immediate=1}, + groups = {oddly_breakable_by_hand=2, dig_immediate=1}, sounds = default.node_sound_stone_defaults(), can_dig = function(pos,player) local meta = minetest.env:get_meta(pos); @@ -188,7 +195,7 @@ for _, anvil in ipairs(anvils) do for _, recipe in ipairs(realtest.registered_anvil_recipes) do if recipe.type == "forge" and recipe.item1 == src1:get_name() and recipe.item2 == src2:get_name() and anvil[3] >= recipe.level and - minetest.get_item_group(hammer:get_name(), "material_level") >= recipe.level then + minetest.get_item_group(hammer:get_name(), "material_level") >= recipe.level - 1 then if inv:room_for_item("output", recipe.output) then if recipe.rmitem1 then src1:take_item() diff --git a/mods/bonfire/init.lua b/mods/bonfire/init.lua index c8f0c29..bc78a20 100644 --- a/mods/bonfire/init.lua +++ b/mods/bonfire/init.lua @@ -8,6 +8,23 @@ bonfire.formspec = "list[current_name;dst;5,1;2,1;]".. "list[current_player;main;0,5;8,4;]" +realtest.bonfire_fuels = {} +function realtest.add_bonfire_fuel(fuel) + if fuel then + table.insert(realtest.bonfire_fuels, fuel) + end +end +realtest.add_bonfire_fuel("default:cactus") +realtest.add_bonfire_fuel("default:papyrus") +realtest.add_bonfire_fuel("default:bookshelf") +realtest.add_bonfire_fuel("default:fence_wood") +realtest.add_bonfire_fuel("default:ladder") +realtest.add_bonfire_fuel("default:torch") +realtest.add_bonfire_fuel("default:sign_wall") +realtest.add_bonfire_fuel("default:chest") +realtest.add_bonfire_fuel("default:chest_locked") +realtest.add_bonfire_fuel("ores:peat") + minetest.register_node("bonfire:self", { description = "Bonfire", tiles = {"bonfire_top.png", "bonfire_bottom.png", "bonfire_side.png"}, @@ -170,6 +187,9 @@ minetest.register_abm({ end if fuellist then fuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) + if fuel and not table.contains(realtest.bonfire_fuels, inv:get_stack("fuel", 1):get_name()) then + fuel.time = 0 + end end if fuel.time <= 0 then diff --git a/mods/creative/init.lua b/mods/creative/init.lua index 6b61c73..3bed826 100644 --- a/mods/creative/init.lua +++ b/mods/creative/init.lua @@ -73,10 +73,9 @@ creative_inventory.set_creative_formspec = function(player, start_i, pagenum) pagenum = math.floor(pagenum) local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1) player:set_inventory_formspec("size[13,7.5]".. - --"image[6,0.6;1,2;player.png]".. "list[current_player;main;5,3.5;8,4;]".. - "list[current_player;craft;8,0;3,3;]".. - "list[current_player;craftpreview;12,1;1,1;]".. + "list[current_player;craft;7,0;3,3;]".. + "list[current_player;craftpreview;11,1;1,1;]".. "list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]".. "label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]".. "button[0.3,6.5;1.6,1;creative_prev;<<]".. diff --git a/mods/decorations/depends.txt b/mods/decorations/depends.txt index 4ad96d5..80acf10 100644 --- a/mods/decorations/depends.txt +++ b/mods/decorations/depends.txt @@ -1 +1,2 @@ default +trees diff --git a/mods/decorations/init.lua b/mods/decorations/init.lua index 3b3142f..7af1bac 100644 --- a/mods/decorations/init.lua +++ b/mods/decorations/init.lua @@ -7,7 +7,8 @@ minetest.register_node("decorations:malachite_block", { tiles = {"decorations_malachite.png"}, particle_image = {"minerals_malachite.png"}, is_ground_content = true, - groups = {cracky=3}, + drop = "minerals:malachite 4", + groups = {cracky=3,drop_on_dig=1}, sounds = default.node_sound_stone_defaults(), }) @@ -32,31 +33,42 @@ minetest.register_node("decorations:malachite_pyramid", { sounds = default.node_sound_stone_defaults(), }) -minetest.register_node("decorations:malachite_table", { - description = "Malachite Table", - drawtype = "nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = { - {-0.5, 0.245, -0.5, 0.5, 0.4375, 0.5}, - {-0.4375, -0.5, -0.4375, -0.25, 0.25, -0.25}, - {-0.4375, -0.5, 0.25, -0.25, 0.25, 0.4375}, - {0.25, -0.5, -0.4375, 0.4375, 0.25, -0.25}, - {0.25, -0.5, 0.25, 0.4375, 0.25, 0.4375}, +for i, tree_name in ipairs(realtest.registered_trees_list) do + local tree = realtest.registered_trees[tree_name] + minetest.register_node("decorations:malachite_table_"..i, { + description = "Malachite Table", + drawtype = "nodebox", + paramtype = "light", + node_box = { + type = "fixed", + fixed = { + {-0.5, 0.245, -0.5, 0.5, 0.4375, 0.5}, + {-0.4375, -0.5, -0.4375, -0.25, 0.25, -0.25}, + {-0.4375, -0.5, 0.25, -0.25, 0.25, 0.4375}, + {0.25, -0.5, -0.4375, 0.4375, 0.25, -0.25}, + {0.25, -0.5, 0.25, 0.4375, 0.25, 0.4375}, + }, }, - }, - selection_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5}, + }, }, - }, - tiles = {"decorations_malachite.png", "default_wood.png^decorations_malachite_table_bottom.png", "default_wood.png^decorations_malachite_table_side.png"}, - is_ground_content = true, - groups = {cracky=3, oddly_breakable_by_hand = 2}, - sounds = default.node_sound_stone_defaults(), + tiles = {"decorations_malachite.png", tree.textures[3].."^decorations_malachite_table_bottom.png", + tree.textures[3].."^decorations_malachite_table_side.png"}, + groups = {cracky=3, oddly_breakable_by_hand = 2}, + sounds = default.node_sound_stone_defaults(), + }) + minetest.register_craft({ + output = "decorations:malachite_table_"..i, + recipe = { + {"minerals:malachite","minerals:malachite","minerals:malachite"}, + {tree.name.."_plank","",tree.name.."_plank"}, + {tree.name.."_plank","",tree.name.."_plank"}, + } }) +end minetest.register_node("decorations:casket", { description = "Casket", @@ -85,7 +97,7 @@ minetest.register_node("decorations:casket", { local meta = minetest.env:get_meta(pos) meta:set_string("formspec", "size[8,8]".. - "list[current_name;main;1,0;6,3;]".. + "list[current_name;main;1,0.5;6,3;]".. "list[current_player;main;0,4;8,4;]") meta:set_string("infotext", "Casket") local inv = meta:get_inventory() @@ -173,6 +185,24 @@ minetest.register_node("decorations:malachite_vase", { sounds = default.node_sound_stone_defaults(), }) +for i, tree_name in ipairs(realtest.registered_trees_list) do + local tree = realtest.registered_trees[tree_name] + minetest.register_node("decorations:bookshelf_"..tree.name:remove_modname_prefix(), { + description = tree.description.." Bookshelf", + tiles = {tree.textures[3], tree.textures[3], tree.textures[3].."^decorations_bookshelf.png"}, + groups = {bookshelf=1,snappy=2,choppy=3,oddly_breakable_by_hand=2,flammable=3}, + sounds = default.node_sound_wood_defaults(), + }) + minetest.register_craft({ + output = "decorations:bookshelf_"..tree.name:remove_modname_prefix(), + recipe = { + {tree.name.."_plank", tree.name.."_plank", tree.name.."_plank"}, + {"default:book", "default:book", tree.name.."_plank"}, + {tree.name.."_plank", tree.name.."_plank", tree.name.."_plank"}, + } + }) +end + ------CRAFT RECIPES------ minetest.register_craft({ @@ -199,12 +229,6 @@ minetest.register_craft({ {"minerals:malachite","minerals:malachite"}, } }) -minetest.register_craft({ - output = "minerals:malachite 4", - recipe = { - {"decorations:malachite_block"}, - } -}) minetest.register_craft({ output = "decorations:malachite_pyramid", @@ -214,15 +238,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "decorations:malachite_table", - recipe = { - {"minerals:malachite","minerals:malachite","minerals:malachite"}, - {"default:wood","","default:wood"}, - {"default:wood","","default:wood"}, - } -}) - minetest.register_craft({ output = "decorations:malachite_cylinder", recipe = { diff --git a/mods/decorations/textures/decorations_bookshelf.png b/mods/decorations/textures/decorations_bookshelf.png new file mode 100644 index 0000000..8bdd489 Binary files /dev/null and b/mods/decorations/textures/decorations_bookshelf.png differ diff --git a/mods/default/init.lua b/mods/default/init.lua index fc5c5e5..bae8596 100644 --- a/mods/default/init.lua +++ b/mods/default/init.lua @@ -14,7 +14,6 @@ realtest = {} -- Load other files dofile(minetest.get_modpath("default").."/mapgen.lua") -dofile(minetest.get_modpath("default").."/leafdecay.lua") -- -- Tool definition @@ -42,95 +41,42 @@ minetest.register_item(":", { -- minetest.register_craft({ - output = 'default:fence_wood 2', + output = "default:sandstone", recipe = { - {'default:stick', 'default:stick', 'default:stick'}, - {'default:stick', 'default:stick', 'default:stick'}, + {"default:sand", "default:sand"}, + {"default:sand", "default:sand"}, } }) minetest.register_craft({ - output = 'default:sign_wall', + output = "default:clay", recipe = { - {'default:wood', 'default:wood', 'default:wood'}, - {'default:wood', 'default:wood', 'default:wood'}, - {'', 'default:stick', ''}, + {"default:clay_lump", "default:clay_lump"}, + {"default:clay_lump", "default:clay_lump"}, } }) minetest.register_craft({ - output = 'default:chest', + output = "default:brick", recipe = { - {'default:wood', 'default:wood', 'default:wood'}, - {'default:wood', '', 'default:wood'}, - {'default:wood', 'default:wood', 'default:wood'}, + {"default:clay_brick", "default:clay_brick"}, + {"default:clay_brick", "default:clay_brick"}, } }) minetest.register_craft({ - output = 'default:chest_locked', + output = "default:paper", recipe = { - {'default:wood', 'default:wood', 'default:wood'}, - {'default:wood', 'default:cobble', 'default:wood'}, - {'default:wood', 'default:wood', 'default:wood'}, + {"default:papyrus", "default:papyrus", "default:papyrus"}, } }) minetest.register_craft({ - output = 'default:sandstone', + output = "default:book", recipe = { - {'default:sand', 'default:sand'}, - {'default:sand', 'default:sand'}, - } -}) - -minetest.register_craft({ - output = 'default:clay', - recipe = { - {'default:clay_lump', 'default:clay_lump'}, - {'default:clay_lump', 'default:clay_lump'}, - } -}) - -minetest.register_craft({ - output = 'default:brick', - recipe = { - {'default:clay_brick', 'default:clay_brick'}, - {'default:clay_brick', 'default:clay_brick'}, - } -}) - -minetest.register_craft({ - output = 'default:paper', - recipe = { - {'default:papyrus', 'default:papyrus', 'default:papyrus'}, - } -}) - -minetest.register_craft({ - output = 'default:book', - recipe = { - {'default:paper'}, - {'default:paper'}, - {'default:paper'}, - } -}) - -minetest.register_craft({ - output = 'default:bookshelf', - recipe = { - {'default:wood', 'default:wood', 'default:wood'}, - {'default:book', 'default:book', 'default:book'}, - {'default:wood', 'default:wood', 'default:wood'}, - } -}) - -minetest.register_craft({ - output = 'default:ladder', - recipe = { - {'default:stick', '', 'default:stick'}, - {'default:stick', 'default:stick', 'default:stick'}, - {'default:stick', '', 'default:stick'}, + {"default:paper"}, + {"default:paper"}, + {"default:paper"}, } }) @@ -168,18 +114,6 @@ minetest.register_craft({ -- Fuels -- -minetest.register_craft({ - type = "fuel", - recipe = "default:tree", - burntime = 20, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:leaves", - burntime = 3, -}) - minetest.register_craft({ type = "fuel", recipe = "default:cactus", @@ -204,24 +138,12 @@ minetest.register_craft({ burntime = 15, }) -minetest.register_craft({ - type = "fuel", - recipe = "default:stick", - burntime = 1, -}) - minetest.register_craft({ type = "fuel", recipe = "default:ladder", burntime = 15, }) -minetest.register_craft({ - type = "fuel", - recipe = "default:wood", - burntime = 7, -}) - minetest.register_craft({ type = "fuel", recipe = "default:torch", @@ -246,18 +168,6 @@ minetest.register_craft({ burntime = 40, }) -minetest.register_craft({ - type = "fuel", - recipe = "default:sapling", - burntime = 5, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:apple", - burntime = 1, -}) - minetest.register_craft({ type = "fuel", recipe = "default:coal_lump", @@ -346,23 +256,23 @@ minetest.register_node("default:stone", { tiles = {"default_stone.png"}, particle_image = {"default_cobble.png"}, is_ground_content = true, - groups = {cracky=3}, + groups = {cracky=3,drop_on_dig=1}, drop = { max_items = 1, items = { { - items = {'default:cobble', 'minerals:borax'}, + items = {"default:cobble", "minerals:borax"}, rarity = 50, }, { - items = {'default:cobble', 'default:cobble', 'default:cobble'}, + items = {"default:cobble", "default:cobble", "default:cobble"}, rarity = 5 }, { - items = {'default:cobble', 'default:cobble'} + items = {"default:cobble", "default:cobble"} }, { - items = {'default:cobble 1'}, + items = {"default:cobble"}, rarity = 5 }, }, @@ -375,8 +285,7 @@ minetest.register_node("default:desert_stone", { tiles = {"default_desert_stone.png"}, particle_image = {"default_desert_stone.png"}, is_ground_content = true, - groups = {cracky=3}, - drop = 'default:desert_stone', + groups = {cracky=3,drop_on_dig=1}, sounds = default.node_sound_stone_defaults(), }) @@ -385,7 +294,7 @@ minetest.register_node("default:stone_flat", { tiles = {"default_stone_flat.png"}, particle_image = {"default_stone_flat.png"}, is_ground_content = true, - groups = {cracky=3}, + groups = {cracky=3,drop_on_dig=1}, sounds = default.node_sound_stone_defaults(), }) @@ -394,7 +303,7 @@ minetest.register_node("default:desert_stone_flat", { tiles = {"default_desert_stone_flat.png"}, particle_image = {"default_desert_stone_flat.png"}, is_ground_content = true, - groups = {cracky=3}, + groups = {cracky=3,drop_on_dig=1}, sounds = default.node_sound_stone_defaults(), }) @@ -403,7 +312,7 @@ minetest.register_node("default:cobbleblock_flat", { tiles = {"default_cobbleblock_flat.png"}, particle_image = {"default_cobble.png"}, is_ground_content = true, - groups = {cracky=3}, + groups = {cracky=3,drop_on_dig=1}, sounds = default.node_sound_stone_defaults(), }) @@ -412,8 +321,8 @@ minetest.register_node("default:dirt_with_grass", { tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, particle_image = {"default_dirt.png"}, is_ground_content = true, - groups = {crumbly=3}, - drop = 'default:dirt', + groups = {crumbly=3,drop_on_dig=1}, + drop = "default:dirt", sounds = default.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, }), @@ -424,7 +333,7 @@ minetest.register_node("default:dirt", { tiles = {"default_dirt.png"}, particle_image = {"default_dirt.png"}, is_ground_content = true, - groups = {crumbly=3}, + groups = {crumbly=3,drop_on_dig=1, falling_node=1}, sounds = default.node_sound_dirt_defaults(), }) @@ -433,7 +342,7 @@ minetest.register_node("default:sand", { tiles = {"default_sand.png"}, particle_image = {"default_sand.png"}, is_ground_content = true, - groups = {crumbly=3, falling_node=1}, + groups = {crumbly=3, falling_node=1,drop_on_dig=1}, sounds = default.node_sound_sand_defaults(), }) @@ -442,7 +351,7 @@ minetest.register_node("default:desert_sand", { tiles = {"default_desert_sand.png"}, particle_image = {"default_desert_sand.png"}, is_ground_content = true, - groups = {sand=1, crumbly=3, falling_node=1}, + groups = {sand=1, crumbly=3, falling_node=1,drop_on_dig=1}, sounds = default.node_sound_sand_defaults(), }) @@ -451,7 +360,7 @@ minetest.register_node("default:gravel", { tiles = {"default_gravel.png"}, particle_image = {"default_gravel.png"}, is_ground_content = true, - groups = {crumbly=2, falling_node=1}, + groups = {crumbly=2, falling_node=1,drop_on_dig=1}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_gravel_footstep", gain=0.45}, }), @@ -462,8 +371,8 @@ minetest.register_node("default:sandstone", { tiles = {"default_sandstone.png"}, particle_image = {"default_sandstone.png"}, is_ground_content = true, - groups = {crumbly=2,cracky=2}, - drop = 'default:sand', + groups = {crumbly=2,cracky=2,drop_on_dig=1}, + drop = "default:sand", sounds = default.node_sound_stone_defaults(), }) @@ -472,8 +381,8 @@ minetest.register_node("default:sand_with_clay", { tiles = {"default_sand.png^default_clay.png"}, particle_image = {"default_clay_lump.png"}, is_ground_content = true, - groups = {crumbly=3}, - drop = 'default:clay_lump 4', + groups = {crumbly=3,drop_on_dig=1}, + drop = "default:clay_lump 4", sounds = default.node_sound_dirt_defaults({ footstep = "", }), @@ -484,8 +393,8 @@ minetest.register_node("default:dirt_with_clay", { tiles = {"default_dirt.png^default_clay.png"}, particle_image = {"default_clay_lump.png"}, is_ground_content = true, - groups = {crumbly=3}, - drop = 'default:clay_lump 4', + groups = {crumbly=3, drop_on_dig=1}, + drop = "default:clay_lump 4", sounds = default.node_sound_dirt_defaults({ footstep = "", }), @@ -496,8 +405,8 @@ minetest.register_node("default:dirt_with_grass_and_clay", { tiles = {"default_grass.png", "default_dirt.png^default_clay.png", "default_dirt.png^default_clay.png^default_grass_side.png"}, particle_image = {"default_clay_lump.png"}, is_ground_content = true, - groups = {crumbly=3}, - drop = 'default:clay_lump 4', + groups = {crumbly=3, drop_on_dig=1}, + drop = "default:clay_lump 4", sounds = default.node_sound_dirt_defaults({ footstep = "", }), @@ -509,50 +418,15 @@ minetest.register_node("default:brick", { tiles = {"default_brick.png"}, particle_image = {"default_clay_brick.png"}, is_ground_content = true, - groups = {cracky=3}, - drop = 'default:clay_brick 4', + groups = {cracky=3,drop_on_dig=1}, + drop = "default:clay_brick 4", sounds = default.node_sound_stone_defaults(), }) -minetest.register_node("default:tree", { - description = "Tree", - tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"}, - particle_image = {"default_tree.png"}, - is_ground_content = true, - groups = {tree=1,snappy=1,choppy=2,flammable=2}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("default:leaves", { - description = "Leaves", - drawtype = "allfaces_optional", - visual_scale = 1.3, - tiles = {"default_leaves.png"}, - particle_image = {"default_leaves.png"}, - paramtype = "light", - groups = {snappy=3, leafdecay=3, flammable=2}, - drop = { - max_items = 1, - items = { - { - -- player will get sapling with 1/20 chance - items = {'default:sapling'}, - rarity = 20, - }, - { - -- player will get leaves only if he get no saplings, - -- this is because max_items is 1 - items = {'default:leaves'}, - } - } - }, - sounds = default.node_sound_leaves_defaults(), -}) - minetest.register_node("default:cactus", { description = "Cactus", tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"}, - particle_image = {"default_cactus_side.png"}, + groups = {snappy=2,choppy=3,flammable=2,dropping_node=1,drop_on_dig=1}, drawtype = "nodebox", paramtype = "light", node_box = { @@ -567,7 +441,6 @@ minetest.register_node("default:cactus", { {-0.4, -0.5, -0.4, 0.4, 0.5, 0.4}, }, }, - groups = {snappy=2,choppy=3,flammable=2,dropping_node=1}, sounds = default.node_sound_wood_defaults(), }) @@ -581,18 +454,10 @@ minetest.register_node("default:papyrus", { paramtype = "light", is_ground_content = true, walkable = false, - groups = {snappy=3,flammable=2, dropping_node=1}, + groups = {snappy=3,flammable=2, dropping_node=1,drop_on_dig=1}, sounds = default.node_sound_leaves_defaults(), }) -minetest.register_node("default:bookshelf", { - description = "Bookshelf", - tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"}, - is_ground_content = true, - groups = {snappy=2,choppy=3,oddly_breakable_by_hand=2,flammable=3}, - sounds = default.node_sound_wood_defaults(), -}) - minetest.register_node("default:glass", { description = "Glass", drawtype = "glasslike", @@ -606,23 +471,6 @@ minetest.register_node("default:glass", { sounds = default.node_sound_glass_defaults(), }) -minetest.register_node("default:fence_wood", { - description = "Wooden Fence", - drawtype = "fencelike", - tiles = {"default_wood.png"}, - particle_image = {"default_wood.png"}, - inventory_image = "default_fence.png", - wield_image = "default_fence.png", - paramtype = "light", - is_ground_content = true, - selection_box = { - type = "fixed", - fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, - }, - groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2}, - sounds = default.node_sound_wood_defaults(), -}) - minetest.register_node("default:rail", { description = "Rail", drawtype = "raillike", @@ -641,37 +489,6 @@ minetest.register_node("default:rail", { groups = {bendy=2,snappy=1,dig_immediate=2}, }) -minetest.register_node("default:ladder", { - description = "Ladder", - drawtype = "signlike", - tiles = {"default_ladder.png"}, - particle_image = {"default_wood.png"}, - inventory_image = "default_ladder.png", - wield_image = "default_ladder.png", - paramtype = "light", - paramtype2 = "wallmounted", - is_ground_content = true, - walkable = false, - climbable = true, - selection_box = { - type = "wallmounted", - --wall_top = = - --wall_bottom = = - --wall_side = = - }, - groups = {snappy=1,choppy=2,oddly_breakable_by_hand=3,flammable=2}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("default:wood", { - description = "Wooden Planks", - tiles = {"default_wood.png"}, - particle_image = {"default_wood.png"}, - is_ground_content = true, - groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, - sounds = default.node_sound_wood_defaults(), -}) - minetest.register_node("default:water_flowing", { description = "Flowing Water", inventory_image = minetest.inventorycube("default_water.png"), @@ -833,7 +650,7 @@ minetest.register_node("default:sign_wall", { print((sender:get_player_name() or "").." wrote \""..fields.text.. "\" to sign at "..minetest.pos_to_string(pos)) meta:set_string("text", fields.text) - meta:set_string("infotext", '"'..fields.text..'"') + meta:set_string("infotext", "\""..fields.text.."\"") end, }) @@ -962,7 +779,7 @@ minetest.register_node("default:cobbleblock", { particle_image = {"default_cobble.png"}, is_ground_content = true, drop = "default:cobble 9", - groups = {crumbly=2, oddly_breakable_by_hand=1, falling_node=1}, + groups = {crumbly=2, oddly_breakable_by_hand=1, falling_node=1, drop_on_dig=1}, sounds = default.node_sound_stone_defaults(), }) @@ -971,43 +788,34 @@ minetest.register_craftitem("default:cobble", { inventory_image = "default_cobble.png", }) +minetest.register_node("default:cobble_node", { + description = "Stone", + tiles = {"default_stone.png"}, + paramtype = "light", + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = {-0.5+9/32, -0.5, -0.5+12/32, 0.5-9/32, -0.5+1/8, 0.5-12/32}, + }, + selection_box = { + type = "fixed", + fixed = {-0.5+9/32, -0.5, -0.5+12/32, 0.5-9/32, -0.5+1/8, 0.5-12/32}, + }, + drop = "default:cobble", + groups = {dig_immediate=2,dropping_node=1,drop_on_dig=1}, + sounds = default.node_sound_stone_defaults(), +}) + minetest.register_craft({ output = "default:cobbleblock", recipe = { {"default:cobble","default:cobble","default:cobble"}, {"default:cobble","default:cobble","default:cobble"}, - {"default:cobble","default:cobble","default:cobble"}, + {"default:cobble","default:cobble","default:cobble"}, }, }) -minetest.register_node("default:sapling", { - description = "Sapling", - drawtype = "plantlike", - visual_scale = 1.0, - tiles = {"default_sapling.png"}, - inventory_image = "default_sapling.png", - wield_image = "default_sapling.png", - paramtype = "light", - walkable = false, - groups = {snappy=2,dig_immediate=3,flammable=2}, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("default:apple", { - description = "Apple", - drawtype = "plantlike", - visual_scale = 1.0, - tiles = {"default_apple.png"}, - inventory_image = "default_apple.png", - wield_image = "default_apple.png", - paramtype = "light", - sunlight_propagates = true, - walkable = false, - groups = {fleshy=3,dig_immediate=3,flammable=2}, - on_use = minetest.item_eat(4), - sounds = default.node_sound_defaults(), -}) - minetest.register_node("default:dry_shrub", { description = "Dry Shrub", drawtype = "plantlike", @@ -1030,11 +838,6 @@ minetest.register_node("default:dry_shrub", { -- Crafting items -- -minetest.register_craftitem("default:stick", { - description = "Stick", - inventory_image = "default_stick.png", -}) - minetest.register_craftitem("default:paper", { description = "Paper", inventory_image = "default_paper.png", @@ -1060,11 +863,6 @@ minetest.register_craftitem("default:clay_brick", { inventory_image = "default_clay_brick.png", }) -minetest.register_craftitem("default:scorched_stuff", { - description = "Scorched Stuff", - inventory_image = "default_scorched_stuff.png", -}) - -- -- Falling stuff -- @@ -1123,10 +921,10 @@ minetest.register_entity("default:falling_node", { if minetest.registered_nodes[bcn.name] and minetest.registered_nodes[bcn.name].walkable then local np = {x=bcp.x, y=bcp.y+1, z=bcp.z} - -- Check what's here + -- Check what"s here local n2 = minetest.env:get_node(np) - -- If it's not air or liquid, remove node and replace it with - -- it's drops + -- If it"s not air or liquid, remove node and replace it with + -- it"s drops if n2.name ~= "air" and (not minetest.registered_nodes[n2.name] or minetest.registered_nodes[n2.name].liquidtype == "none") then local drops = minetest.get_node_drops(n2.name, "") @@ -1157,11 +955,11 @@ function default.spawn_falling_node(p, nodename) end -- Horrible crap to support old code --- Don't use this and never do what this does, it's completely wrong! --- (More specifically, the client and the C++ code doesn't get the group) +-- Don"t use this and never do what this does, it"s completely wrong! +-- (More specifically, the client and the C++ code doesn"t get the group) function default.register_falling_node(nodename, texture) minetest.log("error", debug.traceback()) - minetest.log('error', "WARNING: default.register_falling_node is deprecated") + minetest.log("error", "WARNING: default.register_falling_node is deprecated") if minetest.registered_nodes[nodename] then minetest.registered_nodes[nodename].groups.falling_node = 1 end @@ -1188,8 +986,18 @@ function nodeupdate_single(p) p_bottom = {x=p.x, y=p.y-1, z=p.z} n_bottom = minetest.env:get_node(p_bottom) if not minetest.registered_nodes[n_bottom.name].walkable and n_bottom.name ~= n.name then - minetest.env:remove_node(p) - minetest.env:add_item(p, n.name) + if not minetest.registered_nodes[n.name].drop_on_dropping then + minetest.env:dig_node(p) + else + minetest.env:remove_node(p) + local stack = ItemStack(minetest.registered_nodes[n.name].drop_on_dropping) + for i = 1,stack:get_count() do + local obj = minetest.env:add_item(p, stack:get_name()) + local x = math.random(-5,5) + local z = math.random(-5,5) + obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z}) + end + end nodeupdate(p) end end @@ -1253,6 +1061,18 @@ minetest.register_on_dignode(function(pos, oldnode, digger) end end) +minetest.register_abm({ + nodenames = {"default:dirt_with_grass"}, + interval = 2, + chance = 200, + action = function(pos, node) + if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "air" then + minetest.env:set_node(pos, {name="default:dirt"}) + nodeupdate_single(pos) + end + end +}) + minetest.register_abm({ nodenames = {"default:dirt_with_clay"}, interval = 2, @@ -1283,7 +1103,7 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"default:dirt_with_grass_and_clay"}, interval = 2, - chance = 20, + chance = 200, action = function(pos, node) pos.y = pos.y+1 local n = minetest.registered_nodes[minetest.env:get_node(pos).name] diff --git a/mods/default/leafdecay.lua b/mods/default/leafdecay.lua deleted file mode 100644 index 8f4ff97..0000000 --- a/mods/default/leafdecay.lua +++ /dev/null @@ -1,92 +0,0 @@ --- minetest/default/leafdecay.lua - --- To enable leaf decay for a node, add it to the "leafdecay" group. --- --- The rating of the group determines how far from a node in the group "tree" --- the node can be without decaying. --- --- If param2 of the node is ~= 0, the node will always be preserved. Thus, if --- the player places a node of that kind, you will want to set param2=1 or so. - -default.leafdecay_trunk_cache = {} -default.leafdecay_enable_cache = true --- Spread the load of finding trunks -default.leafdecay_trunk_find_allow_accumulator = 0 - -minetest.register_globalstep(function(dtime) - local finds_per_second = 5000 - default.leafdecay_trunk_find_allow_accumulator = - math.floor(dtime * finds_per_second) -end) - -minetest.register_abm({ - nodenames = {"group:leafdecay"}, - neighbors = {"air", "group:liquid"}, - -- A low interval and a high inverse chance spreads the load - interval = 2, - chance = 5, - - action = function(p0, node, _, _) - --print("leafdecay ABM at "..p0.x..", "..p0.y..", "..p0.z..")") - local do_preserve = false - local d = minetest.registered_nodes[node.name].groups.leafdecay - if not d or d == 0 then - --print("not groups.leafdecay") - return - end - local n0 = minetest.env:get_node(p0) - if n0.param2 ~= 0 then - --print("param2 ~= 0") - return - end - local p0_hash = nil - if default.leafdecay_enable_cache then - p0_hash = minetest.hash_node_position(p0) - local trunkp = default.leafdecay_trunk_cache[p0_hash] - if trunkp then - local n = minetest.env:get_node(trunkp) - local reg = minetest.registered_nodes[n.name] - -- Assume ignore is a trunk, to make the thing work at the border of the active area - if n.name == "ignore" or (reg.groups.tree and reg.groups.tree ~= 0) then - --print("cached trunk still exists") - return - end - --print("cached trunk is invalid") - -- Cache is invalid - table.remove(default.leafdecay_trunk_cache, p0_hash) - end - end - if default.leafdecay_trunk_find_allow_accumulator <= 0 then - return - end - default.leafdecay_trunk_find_allow_accumulator = - default.leafdecay_trunk_find_allow_accumulator - 1 - -- Assume ignore is a trunk, to make the thing work at the border of the active area - local p1 = minetest.env:find_node_near(p0, d, {"ignore", "group:tree"}) - if p1 then - do_preserve = true - if default.leafdecay_enable_cache then - --print("caching trunk") - -- Cache the trunk - default.leafdecay_trunk_cache[p0_hash] = p1 - end - end - if not do_preserve then - -- Drop stuff other than the node itself - itemstacks = minetest.get_node_drops(n0.name) - for _, itemname in ipairs(itemstacks) do - if itemname ~= n0.name then - local p_drop = { - x = p0.x - 0.5 + math.random(), - y = p0.y - 0.5 + math.random(), - z = p0.z - 0.5 + math.random(), - } - minetest.env:add_item(p_drop, itemname) - end - end - -- Remove node - minetest.env:remove_node(p0) - end - end -}) - diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua index acd7738..646f757 100644 --- a/mods/default/mapgen.lua +++ b/mods/default/mapgen.lua @@ -6,8 +6,6 @@ minetest.register_alias("mapgen_air", "air") minetest.register_alias("mapgen_stone", "default:stone") -minetest.register_alias("mapgen_tree", "default:tree") -minetest.register_alias("mapgen_leaves", "default:leaves") minetest.register_alias("mapgen_apple", "default:apple") minetest.register_alias("mapgen_water_source", "default:water_source") minetest.register_alias("mapgen_dirt", "default:dirt") @@ -18,9 +16,10 @@ minetest.register_alias("mapgen_lava_source", "default:lava_source") minetest.register_alias("mapgen_cobble", "default:cobble") minetest.register_alias("mapgen_mossycobble", "default:mossycobble") minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass") -minetest.register_alias("mapgen_junglegrass", "default:junglegrass") minetest.register_alias("mapgen_desert_sand", "default:desert_sand") minetest.register_alias("mapgen_desert_stone", "default:desert_stone") +minetest.register_alias("mapgen_tree", "air") +minetest.register_alias("mapgen_leaves", "air") function default.make_papyrus(pos, size) for y=0,size-1 do @@ -121,7 +120,7 @@ minetest.register_on_generated(function(minp, maxp, seed) end end if ground_y and minetest.env:get_node({x=x,y=ground_y,z=z}).name == "default:dirt_with_grass" then - minetest.env:add_item({x=x,y=ground_y+1,z=z}, "default:cobble") + minetest.env:add_node({x=x,y=ground_y+1,z=z}, {name = "default:cobble_node"}) end end end diff --git a/mods/default/textures/default_bookshelf.png b/mods/default/textures/default_bookshelf.png deleted file mode 100644 index c09e5e4..0000000 Binary files a/mods/default/textures/default_bookshelf.png and /dev/null differ diff --git a/mods/default/textures/default_fence.png b/mods/default/textures/default_fence.png deleted file mode 100644 index 0b99f0e..0000000 Binary files a/mods/default/textures/default_fence.png and /dev/null differ diff --git a/mods/default/textures/default_junglegrass.png b/mods/default/textures/default_junglegrass.png deleted file mode 100644 index eea87c0..0000000 Binary files a/mods/default/textures/default_junglegrass.png and /dev/null differ diff --git a/mods/default/textures/default_jungletree.png b/mods/default/textures/default_jungletree.png deleted file mode 100644 index d8c2635..0000000 Binary files a/mods/default/textures/default_jungletree.png and /dev/null differ diff --git a/mods/default/textures/default_jungletree_top.png b/mods/default/textures/default_jungletree_top.png deleted file mode 100644 index 805272a..0000000 Binary files a/mods/default/textures/default_jungletree_top.png and /dev/null differ diff --git a/mods/default/textures/default_scorched_stuff.png b/mods/default/textures/default_scorched_stuff.png deleted file mode 100644 index 9ced2fb..0000000 Binary files a/mods/default/textures/default_scorched_stuff.png and /dev/null differ diff --git a/mods/default/textures/default_stick.png b/mods/default/textures/default_stick.png deleted file mode 100644 index a195cf0..0000000 Binary files a/mods/default/textures/default_stick.png and /dev/null differ diff --git a/mods/default/textures/default_tree.png b/mods/default/textures/default_tree.png deleted file mode 100644 index ab12501..0000000 Binary files a/mods/default/textures/default_tree.png and /dev/null differ diff --git a/mods/default/textures/default_tree_top.png b/mods/default/textures/default_tree_top.png deleted file mode 100644 index 6d62006..0000000 Binary files a/mods/default/textures/default_tree_top.png and /dev/null differ diff --git a/mods/default/textures/default_wood.png b/mods/default/textures/default_wood.png deleted file mode 100644 index 66f2b72..0000000 Binary files a/mods/default/textures/default_wood.png and /dev/null differ diff --git a/mods/default/textures/treeprop.png b/mods/default/textures/treeprop.png deleted file mode 100644 index 72e831b..0000000 Binary files a/mods/default/textures/treeprop.png and /dev/null differ diff --git a/mods/dye/init.lua b/mods/dye/init.lua index 8e6dafd..72fbf86 100644 --- a/mods/dye/init.lua +++ b/mods/dye/init.lua @@ -133,8 +133,8 @@ dyelocal = nil minetest.register_craft({ type = "shapeless", - output = 'dye:dark_green', - recipe = {'default:cactus'}, + output = "dye:dark_green 4", + recipe = {"default:cactus"}, }) -- EOF diff --git a/mods/furnace/init.lua b/mods/furnace/init.lua index ef45a5d..12f8b04 100644 --- a/mods/furnace/init.lua +++ b/mods/furnace/init.lua @@ -4,7 +4,7 @@ function furnace.check_furnace_blocks(pos) local furnace_blocks = {{x=1,y=0,z=-1}, {x=1,y=0,z=0}, {x=1,y=0,z=1}, {x=0,y=0,z=-1}, {x=0,y=0,z=1}, {x=-1,y=0,z=-1}, {x=-1,y=0,z=0}, {x=-1,y=0,z=1}, {x=0,y=-1,z=0}, {x=1,y=-1,z=-1}, {x=1,y=-1,z=0}, {x=1,y=-1,z=1}, {x=0,y=-1,z=-1}, {x=0,y=-1,z=1}, {x=-1,y=-1,z=-1}, {x=-1,y=-1,z=0}, {x=-1,y=-1,z=1}} for n = 1,#furnace_blocks do local v = furnace_blocks[n] - if minetest.env:get_node({x=pos.x+v.x,y=pos.y+v.y,z=pos.z+v.z}).name ~= "default:cobbleblock" then + if minetest.env:get_node({x=pos.x+v.x,y=pos.y+v.y,z=pos.z+v.z}).name ~= "default:cobbleblock_flat" then return false end end diff --git a/mods/helper_functions/init.lua b/mods/helper_functions/init.lua index 555f943..db8f953 100644 --- a/mods/helper_functions/init.lua +++ b/mods/helper_functions/init.lua @@ -33,9 +33,10 @@ function string:capitalize() return self:sub(1,1):upper()..self:sub(2):lower() end -function minetest.get_item_group(name, group) - if not minetest.registered_items[name] or not minetest.registered_items[name].groups[group] then - return 0 +function string:remove_modname_prefix() + local i = self:find(":") + if i then + return self:sub(i+1) end - return minetest.registered_items[name].groups[group] + return nil end diff --git a/mods/icicles/init.lua b/mods/icicles/init.lua index fad4814..8b63d16 100644 --- a/mods/icicles/init.lua +++ b/mods/icicles/init.lua @@ -1,11 +1,19 @@ for i = 1,4 do minetest.register_node("icicles:icicle_"..i, { description = "Icicle "..i, - groups = {cracky=3, icicle=1, oddly_breakable_by_hand=4-i}, + groups = {cracky=3, icicle=1, oddly_breakable_by_hand=4-i, drop_on_dig=1}, tiles = {"default_stone.png"}, is_ground_content = true, sounds = default.node_sound_stone_defaults(), - drop = "", + drop = { + max_items = 1, + items = { + { + items = {"default:cobble"}, + rarity = 5 - i, + }, + }, + }, drawtype = "nodebox", paramtype = "light", node_box = { diff --git a/mods/instruments/buckets.lua b/mods/instruments/buckets.lua index 7096732..e647edf 100644 --- a/mods/instruments/buckets.lua +++ b/mods/instruments/buckets.lua @@ -1,21 +1,18 @@ buckets = {} buckets.liquids = {} -function buckets.register_liquid(name, source, flowing, itemname, inventory_image) - - buckets.liquids[source] = { - name = name, - source = source, - flowing = flowing, - itemname = itemname, - } - buckets.liquids[flowing] = buckets.liquids[source] - - if itemname ~= nil then - for i = 1,#metals.list do - minetest.register_craftitem(itemname.."_"..metals.list[i], { - description = metals.desc_list[i] .. " Bucket with " .. name, - inventory_image = "instruments_bucket_"..metals.list[i]..".png^"..inventory_image, +realtest.registered_liquids = {} +function realtest.register_liquid(name, LiquidDef) + if name and LiquidDef.source and LiquidDef.flowing and (LiquidDef.image_for_metal_bucket or LiquidDef.image_for_wood_bucket) then + LiquidDef.name = name + realtest.registered_liquids[LiquidDef.source] = LiquidDef + realtest.registered_liquids[LiquidDef.flowing] = LiquidDef + end + if LiquidDef.image_for_metal_bucket then + for i, metal in ipairs(metals.list) do + minetest.register_craftitem("instruments:bucket_"..metal.."_with_"..LiquidDef.name, { + description = metals.desc_list[i] .. " Bucket with " .. LiquidDef.description, + inventory_image = "instruments_bucket_"..metal..".png^"..LiquidDef.image_for_metal_bucket, stack_max = 1, liquids_pointable = true, on_use = function(itemstack, user, pointed_thing) @@ -25,26 +22,78 @@ function buckets.register_liquid(name, source, flowing, itemname, inventory_imag end n = minetest.env:get_node(pointed_thing.under) if minetest.registered_nodes[n.name].buildable_to then - minetest.env:add_node(pointed_thing.under, {name=source}) + minetest.env:add_node(pointed_thing.under, {name=LiquidDef.source}) else n = minetest.env:get_node(pointed_thing.above) if minetest.registered_nodes[n.name].buildable_to then - minetest.env:add_node(pointed_thing.above, {name=source}) + minetest.env:add_node(pointed_thing.above, {name=LiquidDef.source}) else return end end - return {name="instruments:bucket_empty_"..metals.list[i]} + return {name="instruments:bucket_"..metal} end }) end end + if LiquidDef.image_for_wood_bucket then + for i, tree in pairs(realtest.registered_trees) do + local wood = tree.name:remove_modname_prefix() + minetest.register_craftitem("instruments:bucket_"..wood.."_with_"..LiquidDef.name, { + description = "Empty " .. tree.description .. " Bucket with " .. LiquidDef.description, + inventory_image = "instruments_bucket_wood.png^"..LiquidDef.image_for_wood_bucket, + stack_max = 1, + liquids_pointable = true, + on_use = function(itemstack, user, pointed_thing) + -- Must be pointing to node + if pointed_thing.type ~= "node" then + return + end + n = minetest.env:get_node(pointed_thing.under) + if minetest.registered_nodes[n.name].buildable_to then + minetest.env:add_node(pointed_thing.under, {name=LiquidDef.source}) + else + n = minetest.env:get_node(pointed_thing.above) + if minetest.registered_nodes[n.name].buildable_to then + minetest.env:add_node(pointed_thing.above, {name=LiquidDef.source}) + else + return + end + end + return {name="instruments:bucket_"..wood} + end, + }) + end + end end -for i = 1,#metals.list do - minetest.register_craftitem("instruments:bucket_empty_"..metals.list[i], { +for i, metal in ipairs(metals.list) do + minetest.register_craftitem("instruments:bucket_"..metal, { description = "Empty " .. metals.desc_list[i] .. " Bucket", - inventory_image = "instruments_bucket_"..metals.list[i]..".png", + inventory_image = "instruments_bucket_"..metal..".png", + stack_max = 1, + liquids_pointable = true, + on_use = function(itemstack, user, pointed_thing) + -- Must be pointing to node + if pointed_thing.type ~= "node" then + return + end + -- Check if pointing to a liquid source + n = minetest.env:get_node(pointed_thing.under) + liquiddef = realtest.registered_liquids[n.name] + if liquiddef then + minetest.env:add_node(pointed_thing.under, {name="air"}) + return {name="instruments:bucket_"..wood} + end + end, + }) +end + +for i, tree in pairs(realtest.registered_trees) do + local wood = tree.name:remove_modname_prefix() + minetest.register_craftitem("instruments:bucket_"..wood, { + description = "Empty " .. tree.description .. " Bucket", + inventory_image = "instruments_bucket_wood.png", stack_max = 1, liquids_pointable = true, on_use = function(itemstack, user, pointed_thing) @@ -54,27 +103,35 @@ for i = 1,#metals.list do end -- Check if pointing to a liquid source n = minetest.env:get_node(pointed_thing.under) - liquiddef = buckets.liquids[n.name] - if liquiddef ~= nil and liquiddef.source == n.name and liquiddef.itemname ~= nil then + liquiddef = realtest.registered_liquids[n.name] + if liquiddef then minetest.env:add_node(pointed_thing.under, {name="air"}) - return {name=liquiddef.itemname.."_"..metals.list[i]} + return {name="instruments:bucket_"..wood.."_with_"..liquiddef.name} end end, }) + minetest.register_craft({ + output = "instruments:bucket_"..wood, + recipe = { + {tree.name.."_plank", "", tree.name.."_plank"}, + {tree.name.."_plank", "", tree.name.."_plank"}, + {"", tree.name.."_plank", ""}, + }, + }) end -buckets.register_liquid( - "Water", - "default:water_source", - "default:water_flowing", - "instruments:bucket_water", - "instruments_water.png" -) +realtest.register_liquid("water", { + description = "Water", + source = "default:water_source", + flowing = "default:water_flowing", + image_for_metal_bucket = "instruments_metal_water.png", + image_for_wood_bucket = "instruments_wood_water.png", +}) + +realtest.register_liquid("lava", { + description = "Lava", + source = "default:lava_source", + flowing = "default:lava_flowing", + image_for_metal_bucket = "instruments_lava.png", +}) -buckets.register_liquid( - "Lava", - "default:lava_source", - "default:lava_flowing", - "instruments:bucket_lava", - "instruments_lava.png" -) diff --git a/mods/instruments/depends.txt b/mods/instruments/depends.txt index 6ab474a..ff062cc 100644 --- a/mods/instruments/depends.txt +++ b/mods/instruments/depends.txt @@ -1,3 +1,4 @@ default metals helper_functions +trees diff --git a/mods/instruments/init.lua b/mods/instruments/init.lua index bf3e5ff..7745b48 100644 --- a/mods/instruments/init.lua +++ b/mods/instruments/init.lua @@ -82,7 +82,7 @@ instruments.spear.entity.on_step = function(self, dtime) if obj:get_hp()<=0 then obj:remove() end - minetest.env:add_item(self.lastpos, 'instruments:spear_'..self.object:get_luaentity().material) + minetest.env:add_item(self.lastpos, "instruments:spear_"..self.object:get_luaentity().material) self.object:remove() end end @@ -90,7 +90,7 @@ instruments.spear.entity.on_step = function(self, dtime) if self.lastpos.x~=nil then if node.name ~= "air" then - minetest.env:add_item(self.lastpos, 'instruments:spear_'..self.object:get_luaentity().material) + minetest.env:add_item(self.lastpos, "instruments:spear_"..self.object:get_luaentity().material) self.object:remove() end end @@ -116,7 +116,7 @@ for i, material in ipairs(instruments.materials) do obj:get_luaentity().material = material return "" end, - groups = {material_level=instruments.levels[i], durability=instruments.durability[i]}, + groups = {material_level=instruments.levels[i], durability=instruments.durability[i], spear=1}, }) --Chisels (stone chisels are not exist) if material ~= "stone" then @@ -139,7 +139,7 @@ for i, material in ipairs(instruments.materials) do item:add_wear(65535/instruments.durability[i]) return item end, - groups = {material_level=instruments.levels[i], durability=instruments.durability[i]}, + groups = {material_level=instruments.levels[i], durability=instruments.durability[i], chisel=1}, }) end --Heads @@ -159,7 +159,7 @@ for i, material in ipairs(instruments.materials) do output = "instruments:"..instrument.."_"..material, recipe = { {"instruments:"..instrument.."_"..material.."_head"}, - {'default:stick'}, + {"group:stick"}, }, }) end @@ -175,7 +175,7 @@ for i, material in ipairs(instruments.materials) do max_drop_level=1, groupcaps=instruments.groupcaps[j][i], }, - groups = {material_level=instruments.levels[i], durability=instruments.durability[i]}, + groups = {material_level=instruments.levels[i], durability=instruments.durability[i], [instrument] = 1}, }) end end @@ -185,7 +185,7 @@ minetest.register_craft({ output = "instruments:spear_stone", recipe = { {"default:cobble", "", ""}, - {"", "default:stick", ""}, - {"","","default:stick"}, + {"", "group:stick", ""}, + {"","","group:stick"}, }, }) diff --git a/mods/instruments/textures/instruments_bucket_wood.png b/mods/instruments/textures/instruments_bucket_wood.png new file mode 100644 index 0000000..da6fdc3 Binary files /dev/null and b/mods/instruments/textures/instruments_bucket_wood.png differ diff --git a/mods/instruments/textures/instruments_water.png b/mods/instruments/textures/instruments_metal_water.png similarity index 100% rename from mods/instruments/textures/instruments_water.png rename to mods/instruments/textures/instruments_metal_water.png diff --git a/mods/instruments/textures/instruments_wood_water.png b/mods/instruments/textures/instruments_wood_water.png new file mode 100644 index 0000000..b447e1e Binary files /dev/null and b/mods/instruments/textures/instruments_wood_water.png differ diff --git a/mods/item_drop/README.txt b/mods/item_drop/README.txt deleted file mode 100644 index fe43054..0000000 --- a/mods/item_drop/README.txt +++ /dev/null @@ -1,42 +0,0 @@ -===ITEM_DROP MOD for MINETEST-C55=== -by PilzAdam - -Introduction: -This mod adds Minecraft like drop/pick up of items to Minetest. - -How to install: -Unzip the archive an place it in minetest-base-directory/mods/minetest/ -if you have a windows client or a linux run-in-place client. If you have -a linux system-wide instalation place it in ~/.minetest/mods/minetest/. -If you want to install this mod only in one world create the folder -worldmods/ in your worlddirectory. -For further information or help see: -http://wiki.minetest.com/wiki/Installing_Mods - -How to use the mod: -Just install it an everything works. - -For developers: -You dont have to use get_drops() anymore because of changes in the -builtin files of minetest. - -License: -Sourcecode: WTFPL (see below) -Sound: WTFPL (see below) - -See also: -http://minetest.net/ - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 - - Copyright (C) 2004 Sam Hocevar - - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/mods/item_drop/init.lua b/mods/item_drop/init.lua index fb03807..65bcdd4 100644 --- a/mods/item_drop/init.lua +++ b/mods/item_drop/init.lua @@ -1,7 +1,7 @@ --Mod by PilzAdam function minetest.handle_node_drops(pos, drops, digger) - for _,item in ipairs(drops) do + local function drop(item) local count, name if type(item) == "string" then count = 1 @@ -30,4 +30,20 @@ function minetest.handle_node_drops(pos, drops, digger) end end end + local function drop_all() + for _, item in ipairs(drops) do + drop(item) + end + end + if minetest.get_node_group(minetest.env:get_node(pos).name, "drop_on_dig") == 1 then + drop_all() + elseif digger:get_inventory() then + for _, dropped_item in ipairs(drops) do + if digger:get_inventory():room_for_item("main", dropped_item) then + digger:get_inventory():add_item("main", dropped_item) + else + drop(dropped_item) + end + end + end end diff --git a/mods/metals/init.lua b/mods/metals/init.lua index 45abf6f..e6f54d3 100644 --- a/mods/metals/init.lua +++ b/mods/metals/init.lua @@ -94,6 +94,11 @@ for i=1, #metals.list do inventory_image = "metals_ceramic_mold.png^metals_"..metals.list[i].."_ingot.png", }) + minetest.register_craftitem("metals:"..metals.list[i].."_lock", { + description = metals.desc_list[i].." Lock", + inventory_image = "metals_"..metals.list[i].."_lock.png", + }) + -- -- Nodes -- @@ -103,7 +108,8 @@ for i=1, #metals.list do tiles = {"metals_"..metals.list[i].."_block.png"}, particle_image = {"metals_"..metals.list[i].."_block.png"}, is_ground_content = true, - groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2}, + drop = "metals:"..metals.list[i].."_doubleingot", + groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2,drop_on_dig=1}, sounds = default.node_sound_stone_defaults(), }) @@ -114,13 +120,13 @@ for i=1, #metals.list do minetest.register_craft({ output = "metals:"..metals.list[i].."_block", recipe = { - {"metals:"..metals.list[i].."_ingot", "metals:"..metals.list[i].."_ingot"}, - {"metals:"..metals.list[i].."_ingot", "metals:"..metals.list[i].."_ingot"}, + {"metals:"..metals.list[i].."_doubleingot", "metals:"..metals.list[i].."_doubleingot"}, + {"metals:"..metals.list[i].."_doubleingot", "metals:"..metals.list[i].."_doubleingot"}, } }) minetest.register_craft({ - output = "metals:"..metals.list[i].."_ingot 4", + output = "metals:"..metals.list[i].."_doubleingot 4", recipe = { {"metals:"..metals.list[i].."_block"}, } @@ -135,12 +141,9 @@ for i=1, #metals.list do }) minetest.register_craft({ - output = 'sawing_table:self', - recipe = { - {'default:tree',"metals:"..metals.list[i].."_ingot",'default:tree'}, - {'default:tree','','default:tree'}, - {'default:tree',"metals:"..metals.list[i].."_ingot",'default:tree'}, - } + output = "metals:"..metals.list[i].."_ingot", + recipe = {{"metals:ceramic_mold_"..metals.list[i]}}, + replacements = {{"metals:ceramic_mold_"..metals.list[i], "metals:ceramic_mold"}}, }) -- @@ -182,7 +185,9 @@ minetest.register_craft({ recipe = "metals:clay_mold", }) -MINERALS_LIST={ +minerals = {} + +minerals.list = { 'magnetite', 'hematite', 'limonite', @@ -200,25 +205,25 @@ MINERALS_LIST={ 'bauxite', } -MINERALS_DESC_LIST={ - 'magnetite', - 'hematite', - 'limonite', - 'bismuthinite', - 'cassiterite', - 'galena', - 'malachite', - 'native copper', - 'native gold', - 'native platinum', - 'native silver', - 'sphalerite', - 'tetrahedrite', - 'garnierite', - 'bauxite', +minerals.desc_list = { + 'Magnetite', + 'Hematite', + 'Limonite', + 'Bismuthinite', + 'Cassiterite', + 'Galena', + 'Malachite', + 'Native Copper', + 'Native Gold', + 'Native Platinum', + 'Native Silver', + 'Sphalerite', + 'Tetrahedrite', + 'Garnierite', + 'Bauxite', } -MINERALS_METALS_LIST={ +minerals.metals_list = { 'pig_iron', 'pig_iron', 'pig_iron', @@ -236,24 +241,30 @@ MINERALS_METALS_LIST={ 'aluminium', } -for i=1, #MINERALS_LIST do - minetest.register_craftitem("metals:ceramic_mold_"..MINERALS_LIST[i], { - description = "Ceramic mold with "..MINERALS_DESC_LIST[i], - inventory_image = "metals_ceramic_mold_"..MINERALS_LIST[i]..".png", +for i, mineral in ipairs(minerals.list) do + minetest.register_craftitem("metals:ceramic_mold_"..mineral, { + description = "Ceramic mold with "..minerals.desc_list[i], + inventory_image = "metals_ceramic_mold_"..mineral..".png", }) minetest.register_craft({ - output = "metals:ceramic_mold_"..MINERALS_LIST[i], + output = "metals:ceramic_mold_"..mineral, recipe = { - {"minerals:"..MINERALS_LIST[i]}, + {"minerals:"..mineral}, {"metals:ceramic_mold"}, } }) + + minetest.register_craft({ + output = "minerals:"..mineral, + recipe = {{"metals:ceramic_mold_"..mineral}}, + replacements = {{"metals:ceramic_mold_"..mineral, "metals:ceramic_mold"}}, + }) minetest.register_craft({ type = "cooking", - output = "metals:"..MINERALS_METALS_LIST[i].."_unshaped", - recipe = "metals:ceramic_mold_"..MINERALS_LIST[i], + output = "metals:"..minerals.metals_list[i].."_unshaped", + recipe = "metals:ceramic_mold_"..mineral, }) end diff --git a/mods/metals/textures/metals_aluminium_bucket.png b/mods/metals/textures/metals_aluminium_bucket.png new file mode 100644 index 0000000..b67f807 Binary files /dev/null and b/mods/metals/textures/metals_aluminium_bucket.png differ diff --git a/mods/metals/textures/metals_aluminium_lock.png b/mods/metals/textures/metals_aluminium_lock.png new file mode 100644 index 0000000..86c9107 Binary files /dev/null and b/mods/metals/textures/metals_aluminium_lock.png differ diff --git a/mods/metals/textures/metals_bismuth_bronze_bucket.png b/mods/metals/textures/metals_bismuth_bronze_bucket.png new file mode 100644 index 0000000..accf0c1 Binary files /dev/null and b/mods/metals/textures/metals_bismuth_bronze_bucket.png differ diff --git a/mods/metals/textures/metals_bismuth_bronze_lock.png b/mods/metals/textures/metals_bismuth_bronze_lock.png new file mode 100644 index 0000000..99f441a Binary files /dev/null and b/mods/metals/textures/metals_bismuth_bronze_lock.png differ diff --git a/mods/metals/textures/metals_bismuth_bucket.png b/mods/metals/textures/metals_bismuth_bucket.png new file mode 100644 index 0000000..1ecb8d4 Binary files /dev/null and b/mods/metals/textures/metals_bismuth_bucket.png differ diff --git a/mods/metals/textures/metals_bismuth_lock.png b/mods/metals/textures/metals_bismuth_lock.png new file mode 100644 index 0000000..2ac7feb Binary files /dev/null and b/mods/metals/textures/metals_bismuth_lock.png differ diff --git a/mods/metals/textures/metals_black_bronze_bucket.png b/mods/metals/textures/metals_black_bronze_bucket.png new file mode 100644 index 0000000..6114527 Binary files /dev/null and b/mods/metals/textures/metals_black_bronze_bucket.png differ diff --git a/mods/metals/textures/metals_black_bronze_lock.png b/mods/metals/textures/metals_black_bronze_lock.png new file mode 100644 index 0000000..f1a5c86 Binary files /dev/null and b/mods/metals/textures/metals_black_bronze_lock.png differ diff --git a/mods/metals/textures/metals_black_steel_bucket.png b/mods/metals/textures/metals_black_steel_bucket.png new file mode 100644 index 0000000..9e56232 Binary files /dev/null and b/mods/metals/textures/metals_black_steel_bucket.png differ diff --git a/mods/metals/textures/metals_black_steel_lock.png b/mods/metals/textures/metals_black_steel_lock.png new file mode 100644 index 0000000..1457a24 Binary files /dev/null and b/mods/metals/textures/metals_black_steel_lock.png differ diff --git a/mods/metals/textures/metals_brass_bucket.png b/mods/metals/textures/metals_brass_bucket.png new file mode 100644 index 0000000..daa5b3f Binary files /dev/null and b/mods/metals/textures/metals_brass_bucket.png differ diff --git a/mods/metals/textures/metals_brass_lock.png b/mods/metals/textures/metals_brass_lock.png new file mode 100644 index 0000000..674e397 Binary files /dev/null and b/mods/metals/textures/metals_brass_lock.png differ diff --git a/mods/metals/textures/metals_bronze_bucket.png b/mods/metals/textures/metals_bronze_bucket.png new file mode 100644 index 0000000..2d3988d Binary files /dev/null and b/mods/metals/textures/metals_bronze_bucket.png differ diff --git a/mods/metals/textures/metals_bronze_lock.png b/mods/metals/textures/metals_bronze_lock.png new file mode 100644 index 0000000..8245a7f Binary files /dev/null and b/mods/metals/textures/metals_bronze_lock.png differ diff --git a/mods/metals/textures/metals_copper_bucket.png b/mods/metals/textures/metals_copper_bucket.png new file mode 100644 index 0000000..bfa136b Binary files /dev/null and b/mods/metals/textures/metals_copper_bucket.png differ diff --git a/mods/metals/textures/metals_copper_lock.png b/mods/metals/textures/metals_copper_lock.png new file mode 100644 index 0000000..4611bc1 Binary files /dev/null and b/mods/metals/textures/metals_copper_lock.png differ diff --git a/mods/metals/textures/metals_gold_bucket.png b/mods/metals/textures/metals_gold_bucket.png new file mode 100644 index 0000000..f0a0cea Binary files /dev/null and b/mods/metals/textures/metals_gold_bucket.png differ diff --git a/mods/metals/textures/metals_gold_lock.png b/mods/metals/textures/metals_gold_lock.png new file mode 100644 index 0000000..862aced Binary files /dev/null and b/mods/metals/textures/metals_gold_lock.png differ diff --git a/mods/metals/textures/metals_lava.png b/mods/metals/textures/metals_lava.png new file mode 100644 index 0000000..51a3563 Binary files /dev/null and b/mods/metals/textures/metals_lava.png differ diff --git a/mods/metals/textures/metals_lead_bucket.png b/mods/metals/textures/metals_lead_bucket.png new file mode 100644 index 0000000..f456556 Binary files /dev/null and b/mods/metals/textures/metals_lead_bucket.png differ diff --git a/mods/metals/textures/metals_lead_lock.png b/mods/metals/textures/metals_lead_lock.png new file mode 100644 index 0000000..5a5ea14 Binary files /dev/null and b/mods/metals/textures/metals_lead_lock.png differ diff --git a/mods/metals/textures/metals_nickel_bucket.png b/mods/metals/textures/metals_nickel_bucket.png new file mode 100644 index 0000000..8853df7 Binary files /dev/null and b/mods/metals/textures/metals_nickel_bucket.png differ diff --git a/mods/metals/textures/metals_nickel_lock.png b/mods/metals/textures/metals_nickel_lock.png new file mode 100644 index 0000000..383d356 Binary files /dev/null and b/mods/metals/textures/metals_nickel_lock.png differ diff --git a/mods/metals/textures/metals_pig_iron_bucket.png b/mods/metals/textures/metals_pig_iron_bucket.png new file mode 100644 index 0000000..e557d14 Binary files /dev/null and b/mods/metals/textures/metals_pig_iron_bucket.png differ diff --git a/mods/metals/textures/metals_pig_iron_lock.png b/mods/metals/textures/metals_pig_iron_lock.png new file mode 100644 index 0000000..c1d4990 Binary files /dev/null and b/mods/metals/textures/metals_pig_iron_lock.png differ diff --git a/mods/metals/textures/metals_platinum_bucket.png b/mods/metals/textures/metals_platinum_bucket.png new file mode 100644 index 0000000..5061971 Binary files /dev/null and b/mods/metals/textures/metals_platinum_bucket.png differ diff --git a/mods/metals/textures/metals_platinum_lock.png b/mods/metals/textures/metals_platinum_lock.png new file mode 100644 index 0000000..3e52df2 Binary files /dev/null and b/mods/metals/textures/metals_platinum_lock.png differ diff --git a/mods/metals/textures/metals_rose_gold_bucket.png b/mods/metals/textures/metals_rose_gold_bucket.png new file mode 100644 index 0000000..a48108e Binary files /dev/null and b/mods/metals/textures/metals_rose_gold_bucket.png differ diff --git a/mods/metals/textures/metals_rose_gold_lock.png b/mods/metals/textures/metals_rose_gold_lock.png new file mode 100644 index 0000000..798825b Binary files /dev/null and b/mods/metals/textures/metals_rose_gold_lock.png differ diff --git a/mods/metals/textures/metals_silver_bucket.png b/mods/metals/textures/metals_silver_bucket.png new file mode 100644 index 0000000..748c86d Binary files /dev/null and b/mods/metals/textures/metals_silver_bucket.png differ diff --git a/mods/metals/textures/metals_silver_lock.png b/mods/metals/textures/metals_silver_lock.png new file mode 100644 index 0000000..45f2259 Binary files /dev/null and b/mods/metals/textures/metals_silver_lock.png differ diff --git a/mods/metals/textures/metals_steel_bucket.png b/mods/metals/textures/metals_steel_bucket.png new file mode 100644 index 0000000..a2db363 Binary files /dev/null and b/mods/metals/textures/metals_steel_bucket.png differ diff --git a/mods/metals/textures/metals_steel_lock.png b/mods/metals/textures/metals_steel_lock.png new file mode 100644 index 0000000..1c54a24 Binary files /dev/null and b/mods/metals/textures/metals_steel_lock.png differ diff --git a/mods/metals/textures/metals_sterling_silver_bucket.png b/mods/metals/textures/metals_sterling_silver_bucket.png new file mode 100644 index 0000000..00350c1 Binary files /dev/null and b/mods/metals/textures/metals_sterling_silver_bucket.png differ diff --git a/mods/metals/textures/metals_sterling_silver_lock.png b/mods/metals/textures/metals_sterling_silver_lock.png new file mode 100644 index 0000000..185e440 Binary files /dev/null and b/mods/metals/textures/metals_sterling_silver_lock.png differ diff --git a/mods/metals/textures/metals_tin_bucket.png b/mods/metals/textures/metals_tin_bucket.png new file mode 100644 index 0000000..8bb5f59 Binary files /dev/null and b/mods/metals/textures/metals_tin_bucket.png differ diff --git a/mods/metals/textures/metals_tin_lock.png b/mods/metals/textures/metals_tin_lock.png new file mode 100644 index 0000000..777dd9f Binary files /dev/null and b/mods/metals/textures/metals_tin_lock.png differ diff --git a/mods/metals/textures/metals_water.png b/mods/metals/textures/metals_water.png new file mode 100644 index 0000000..13da3cd Binary files /dev/null and b/mods/metals/textures/metals_water.png differ diff --git a/mods/metals/textures/metals_wrought_iron_bucket.png b/mods/metals/textures/metals_wrought_iron_bucket.png new file mode 100644 index 0000000..a57a3c0 Binary files /dev/null and b/mods/metals/textures/metals_wrought_iron_bucket.png differ diff --git a/mods/metals/textures/metals_wrought_iron_lock.png b/mods/metals/textures/metals_wrought_iron_lock.png new file mode 100644 index 0000000..6887132 Binary files /dev/null and b/mods/metals/textures/metals_wrought_iron_lock.png differ diff --git a/mods/metals/textures/metals_zinc_bucket.png b/mods/metals/textures/metals_zinc_bucket.png new file mode 100644 index 0000000..4c8be28 Binary files /dev/null and b/mods/metals/textures/metals_zinc_bucket.png differ diff --git a/mods/metals/textures/metals_zinc_lock.png b/mods/metals/textures/metals_zinc_lock.png new file mode 100644 index 0000000..6557cbc Binary files /dev/null and b/mods/metals/textures/metals_zinc_lock.png differ diff --git a/mods/minerals/init.lua b/mods/minerals/init.lua index abcb414..d000c24 100644 --- a/mods/minerals/init.lua +++ b/mods/minerals/init.lua @@ -92,15 +92,3 @@ minetest.register_craft({ recipe = "minerals:bituminous_coal", burntime = 25, }) - -minetest.register_craft({ - type="cooking", - output="default:coal_lump 4", - recipe="default:tree", -}) - -minetest.register_craft({ - type="cooking", - output="default:coal_lump", - recipe="default:wood", -}) diff --git a/mods/ores/init.lua b/mods/ores/init.lua index 9e361d8..d701b46 100644 --- a/mods/ores/init.lua +++ b/mods/ores/init.lua @@ -51,9 +51,9 @@ for i,ore in ipairs(ores.list) do minetest.register_node("ores:"..ore, { description = ores.desc_list[i], tile_images = {"default_stone.png^ores_"..ore..".png"}, - particle_image = {"ores_"..ore..".png"}, + particle_image = {"minerals_"..ore..".png"}, is_ground_content = true, - groups = {cracky=3}, + groups = {cracky=3,drop_on_dig=1}, drop = { max_items = 1, items = { @@ -75,7 +75,7 @@ minetest.register_node("ores:native_copper_desert", { tile_images = {"default_desert_stone.png^ores_native_copper.png"}, particle_image = {"ores_native_copper.png"}, is_ground_content = true, - groups = {cracky=3}, + groups = {cracky=3,drop_on_dig=1}, drop = { max_items = 1, items = { @@ -96,7 +96,7 @@ minetest.register_node("ores:native_gold_desert", { tile_images = {"default_desert_stone.png^ores_native_gold.png"}, particle_image = {"ores_native_gold.png"}, is_ground_content = true, - groups = {cracky=3}, + groups = {cracky=3,drop_on_dig=1}, drop = { max_items = 1, items = { @@ -117,7 +117,7 @@ minetest.register_node("ores:peat", { tile_images = {"ores_peat.png"}, particle_image = {"ores_peat.png"}, is_ground_content = true, - groups = {crumbly=3}, + groups = {crumbly=3,drop_on_dig=1,falling_node=1}, sounds = default.node_sound_stone_defaults(), }) @@ -230,12 +230,13 @@ minetest.register_on_generated(function(minp, maxp, seed) } for i, ore in ipairs(gen_ores) do if pr:next(1,2) == 1 then - generate_ore(ore[1], "default:stone", minp, maxp, seed+i, 1/8/8/8/8/8/8, 10, 850, ore[2] or -31000, ore[3] or 31000) + generate_ore(ore[1], "default:stone", minp, maxp, seed+i, 1/8/8/8/8/8/8, 10, 850, ore[2] or -31000, ore[3] or 200) end end - generate_peat("ores:peat", "default:dirt", minp, maxp, seed+19, 1/8/16/24, 10, 1000, -31000, 31000) - generate_ore("ores:native_copper_desert", "default:desert_stone", minp, maxp, seed+20, 1/8/8/8/8/8/8, 6, 200, -31000, 31000) - generate_ore("ores:native_gold_desert", "default:desert_stone", minp, maxp, seed+21, 1/8/8/8/8/8/8, 5, 100, -31000, 31000) + generate_peat("ores:peat", "default:dirt", minp, maxp, seed+19, 1/8/16/24, 10, 1000, -31000, 200) + generate_ore("ores:native_copper_desert", "default:desert_stone", minp, maxp, seed+20, 1/8/8/8/8/8/8, 6, 200, -31000, 200) + generate_ore("ores:native_gold_desert", "default:desert_stone", minp, maxp, seed+21, 1/8/8/8/8/8/8, 5, 100, -31000, 200) + generate_ore("ores:platinum", "ores:magnetite", minp, maxp, seed+22, 1/8/8/8/8/8/8, 10, 850, -31000, 200) if pr:next(1,2) == 1 then -- Generate clay @@ -290,7 +291,7 @@ end) minetest.register_craft({ type = "cooking", output = "default:torch 2", - recipe = "default:stick", + recipe = "group:stick", }) minetest.register_craft({ diff --git a/mods/sawing_table/depends.txt b/mods/sawing_table/depends.txt deleted file mode 100644 index 4d48733..0000000 --- a/mods/sawing_table/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -default -metals \ No newline at end of file diff --git a/mods/sawing_table/init.lua b/mods/sawing_table/init.lua deleted file mode 100644 index e3459c4..0000000 --- a/mods/sawing_table/init.lua +++ /dev/null @@ -1,84 +0,0 @@ -sawing_table = {} - -local table_containts = function(t, v) - for _, i in ipairs(t) do - if i==v then - return true - end - end - return false -end - -minetest.register_node("sawing_table:self", { - description = "Sawing table", - tiles = {"sawing_table_top.png","sawing_table_top.png","sawing_table_side2.png","sawing_table_side2.png","sawing_table_side.png","sawing_table_side.png",}, - groups = {oddly_breakable_by_hand=2, cracky=3, dig_immediate=1}, - sounds = default.node_sound_stone_defaults(), - drawtype = "nodebox", - paramtype = "light", - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = { - {-0.5,-0.5,-0.5,-0.2,0.5,0.5}, - {0.2,-0.5,-0.5,0.5,0.5,0.5}, - {-0.4,-0.43,-0.43,0.4,-0.2,0.43}, - {-0.4,0.2,-0.43,0.4,0.43,0.43}, - }, - }, - selection_box = { - type = "fixed", - fixed = { - {-0.5,-0.5,-0.5,-0.2,0.5,0.5}, - {0.2,-0.5,-0.5,0.5,0.5,0.5}, - {-0.4,-0.43,-0.43,0.4,-0.2,0.43}, - {-0.4,0.2,-0.43,0.4,0.43,0.43}, - }, - }, - can_dig = function(pos,player) - local meta = minetest.env:get_meta(pos); - local inv = meta:get_inventory() - if not inv:is_empty("ingot") then - return false - elseif not inv:is_empty("res") then - return false - elseif not inv:is_empty("recipe") then - return false - end - return true - end, - on_construct = function(pos) - local meta = minetest.env:get_meta(pos) - meta:set_string("formspec", "size[8,10]".. - "list[current_name;input;1,1.5;1,1;]".. - "list[current_name;recipe;6,1.5;1,1;]".. - "list[current_name;res;3,1.5;1,1;]".. - "label[1,1;Input:]".. - "label[6,1;Recipe:]".. - "label[3,1;Output:]".. - "button[4,2.5;2,3;saw;Saw]".. - "list[current_player;main;0,6;8,4;]") - meta:set_string("infotext", "Sawing table") - local inv = meta:get_inventory() - inv:set_size("input", 1) - inv:set_size("recipe", 1) - inv:set_size("res", 1) - end, - on_receive_fields = function(pos, formname, fields, sender) - local meta = minetest.env:get_meta(pos) - local inv = meta:get_inventory() - - if fields["saw"] then - local inputstack = inv:get_stack("input", 1) - local recipestack = inv:get_stack("recipe", 1) - local resstack = inv:get_stack("res", 1) - - if inputstack:get_name()=="default:tree" then - inv:add_item("res","default:wood 4") - inputstack:take_item() - inv:set_stack("input",1,inputstack) - return - end - end - end, -}) diff --git a/mods/sawing_table/textures/sawing_table_side.png b/mods/sawing_table/textures/sawing_table_side.png deleted file mode 100644 index 8061811..0000000 Binary files a/mods/sawing_table/textures/sawing_table_side.png and /dev/null differ diff --git a/mods/sawing_table/textures/sawing_table_side2.png b/mods/sawing_table/textures/sawing_table_side2.png deleted file mode 100644 index ab12501..0000000 Binary files a/mods/sawing_table/textures/sawing_table_side2.png and /dev/null differ diff --git a/mods/sawing_table/textures/sawing_table_top.png b/mods/sawing_table/textures/sawing_table_top.png deleted file mode 100644 index d8f4874..0000000 Binary files a/mods/sawing_table/textures/sawing_table_top.png and /dev/null differ diff --git a/mods/scribing_table/depends.txt b/mods/scribing_table/depends.txt index 0748de1..80acf10 100644 --- a/mods/scribing_table/depends.txt +++ b/mods/scribing_table/depends.txt @@ -1,2 +1,2 @@ default -metals \ No newline at end of file +trees diff --git a/mods/scribing_table/init.lua b/mods/scribing_table/init.lua index 21c6cf8..aba5280 100644 --- a/mods/scribing_table/init.lua +++ b/mods/scribing_table/init.lua @@ -1,14 +1,5 @@ scribing_table = {} -minetest.register_craft({ - output = 'scribing_table:self', - recipe = { - {'','default:stick',''}, - {'default:wood','default:glass','default:wood'}, - {'default:wood','default:wood','default:wood'}, - } -}) - realtest.registered_instrument_plans = {} function realtest.register_instrument_plan(name, PlanDef) if PlanDef.bitmap then @@ -100,6 +91,15 @@ realtest.register_instrument_plan("scribing_table:plan_chisel", { 0,0,1,0,0,} }) +realtest.register_instrument_plan("scribing_table:plan_lock", { + description = "Lock Plan", + bitmap = {0,1,1,1,0, + 0,1,0,1,0, + 0,1,1,1,0, + 0,1,1,1,0, + 0,1,1,1,0,} +}) + local function check_recipe(pos) local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory() @@ -132,56 +132,67 @@ local function check_recipe(pos) end end -minetest.register_node("scribing_table:self", { - description = "Scribing Table", - tiles = {"scribing_table_top.png", "default_wood.png", "default_wood.png^scribing_table_side.png"}, - drawtype = "nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = { - {-0.5,-0.5,-0.5,0.5,0.3,0.5}, +for i, tree_name in ipairs(realtest.registered_trees_list) do + local tree = realtest.registered_trees[tree_name] + minetest.register_node("scribing_table:scribing_table_"..tree.name:remove_modname_prefix(), { + description = tree.description.." Scribing Table", + tiles = {tree.textures[3].."^scribing_table_top.png", tree.textures[3], tree.textures[3].."^scribing_table_side.png"}, + drawtype = "nodebox", + paramtype = "light", + node_box = { + type = "fixed", + fixed = { + {-0.5,-0.5,-0.5,0.5,0.3,0.5}, + }, }, - }, - selection_box = { - type = "fixed", - fixed = { - {-0.5,-0.5,-0.5,0.5,0.3,0.5}, + selection_box = { + type = "fixed", + fixed = { + {-0.5,-0.5,-0.5,0.5,0.3,0.5}, + }, }, - }, - groups = {oddly_breakable_by_hand=3, dig_immediate=2}, - sounds = default.node_sound_stone_defaults(), - on_construct = function(pos) - local meta = minetest.env:get_meta(pos) - meta:set_string("formspec", - "size[8,10]".. - "list[current_name;paper;6,0;1,1;]".. - "list[current_name;dye;0,0;5,5;]".. - "list[current_name;res;6,4;1,1;]".. - "image[5,1;2,3.4;scribing_table_arrow.png]".. - "list[current_player;main;0,6;8,4;]" - ) - meta:set_string("infotext", "Scribing Table") - local inv = meta:get_inventory() - inv:set_size("paper", 1) - inv:set_size("dye", 25) - inv:set_size("res", 1) - end, - on_metadata_inventory_move = function(pos, from_list, from_index,to_list, to_index, count, player) - check_recipe(pos) - end, - on_metadata_inventory_put = function(pos, listname, index, stack, player) - check_recipe(pos) - end, - on_metadata_inventory_take = function(pos, listname, index, stack, player) - check_recipe(pos) - end, - can_dig = function(pos,player) - local meta = minetest.env:get_meta(pos) - local inv = meta:get_inventory() - if inv:is_empty("paper") and inv:is_empty("dye") and inv:is_empty("res") then - return true - end - return false - end, + groups = {oddly_breakable_by_hand=3, dig_immediate=2}, + sounds = default.node_sound_stone_defaults(), + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + meta:set_string("formspec", + "size[8,10]".. + "list[current_name;paper;6.5,0.5;1,1;]".. + "list[current_name;dye;0.5,0.5;5,5;]".. + "list[current_name;res;6.5,4.5;1,1;]".. + "image[5.5,1.5;2,3.4;scribing_table_arrow.png]".. + "list[current_player;main;0,6;8,4;]" + ) + meta:set_string("infotext", "Scribing Table") + local inv = meta:get_inventory() + inv:set_size("paper", 1) + inv:set_size("dye", 25) + inv:set_size("res", 1) + end, + on_metadata_inventory_move = function(pos, from_list, from_index,to_list, to_index, count, player) + check_recipe(pos) + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + check_recipe(pos) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + check_recipe(pos) + end, + can_dig = function(pos,player) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + if inv:is_empty("paper") and inv:is_empty("dye") and inv:is_empty("res") then + return true + end + return false + end, + }) + minetest.register_craft({ + output = "scribing_table:scribing_table_"..tree.name:remove_modname_prefix(), + recipe = { + {"","group:stick",""}, + {tree.name.."_plank","default:glass",tree.name.."_plank"}, + {tree.name.."_plank",tree.name.."_plank",tree.name.."_plank"}, + } }) +end diff --git a/mods/scribing_table/textures/scribing_table_top.png b/mods/scribing_table/textures/scribing_table_top.png index ad774dd..252ae1c 100644 Binary files a/mods/scribing_table/textures/scribing_table_top.png and b/mods/scribing_table/textures/scribing_table_top.png differ diff --git a/mods/stairs/README.txt b/mods/stairs/README.txt deleted file mode 100644 index 716a677..0000000 --- a/mods/stairs/README.txt +++ /dev/null @@ -1,26 +0,0 @@ -Minetest 0.4 mod: stairs -========================= - -License of source code: ------------------------ -Copyright (C) 2011-2012 Kahrl -Copyright (C) 2011-2012 celeron55, Perttu Ahola - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -http://www.gnu.org/licenses/lgpl-2.1.html - -License of media (textures and sounds) --------------------------------------- -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -http://creativecommons.org/licenses/by-sa/3.0/ - -Authors of media files ------------------------ -Everything not listed in here: -Copyright (C) 2010-2012 celeron55, Perttu Ahola - - diff --git a/mods/stairs/depends.txt b/mods/stairs/depends.txt deleted file mode 100644 index 4ad96d5..0000000 --- a/mods/stairs/depends.txt +++ /dev/null @@ -1 +0,0 @@ -default diff --git a/mods/stairs/init.lua b/mods/stairs/init.lua deleted file mode 100644 index dd52e3c..0000000 --- a/mods/stairs/init.lua +++ /dev/null @@ -1,146 +0,0 @@ --- Minetest 0.4 mod: stairs --- See README.txt for licensing and other information. - -stairs = {} - --- Node will be called stairs:stair_ -function stairs.register_stair(subname, recipeitem, groups, images, description) - minetest.register_node("stairs:stair_" .. subname, { - description = description, - 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 = 'stairs:stair_' .. subname .. ' 4', - recipe = { - {recipeitem, "", ""}, - {recipeitem, recipeitem, ""}, - {recipeitem, recipeitem, recipeitem}, - }, - }) - - -- Flipped recipe for the silly minecrafters - minetest.register_craft({ - output = 'stairs:stair_' .. subname .. ' 4', - recipe = { - {"", "", recipeitem}, - {"", recipeitem, recipeitem}, - {recipeitem, recipeitem, recipeitem}, - }, - }) -end - --- Node will be called stairs:slab_ -function stairs.register_slab(subname, recipeitem, groups, images, description) - minetest.register_node("stairs:slab_" .. subname, { - description = description, - 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 == "stairs:slab_" .. subname then - slabpos = p0 - slabnode = n0 - elseif n1.name == "stairs:slab_" .. subname 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 = 'stairs:slab_' .. subname .. ' 3', - recipe = { - {recipeitem, recipeitem, recipeitem}, - }, - }) -end - --- Nodes will be called stairs:{stair,slab}_ -function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab) - stairs.register_stair(subname, recipeitem, groups, images, desc_stair) - stairs.register_slab(subname, recipeitem, groups, images, desc_slab) -end - -stairs.register_stair_and_slab("wood", "default:wood", - {snappy=2,choppy=2,oddly_breakable_by_hand=2}, - {"default_wood.png"}, - "Wooden stair", - "Wooden slab") - -stairs.register_stair_and_slab("stone", "default:stone", - {cracky=3}, - {"default_stone.png"}, - "Stone stair", - "Stone slab") - -stairs.register_stair_and_slab("cobble", "default:cobbleblock", - {cracky=3}, - {"default_cobbleblock.png"}, - "Cobble stair", - "Cobble slab") - -stairs.register_stair_and_slab("brick", "default:brick", - {cracky=3}, - {"default_brick.png"}, - "Brick stair", - "Brick slab") - -stairs.register_stair_and_slab("sandstone", "default:sandstone", - {crumbly=2,cracky=2}, - {"default_sandstone.png"}, - "Sandstone stair", - "Sandstone slab") diff --git a/mods/sticks/init.lua b/mods/sticks/init.lua index a6d2d4f..084db52 100644 --- a/mods/sticks/init.lua +++ b/mods/sticks/init.lua @@ -1,6 +1,6 @@ minetest.register_tool("sticks:sticks", { description = "Sticks", - inventory_image = "default_sticks.png", + inventory_image = "sticks_sticks.png", on_use = function(item, user, pointed_thing) local pos if pointed_thing.type == "node" then @@ -24,10 +24,10 @@ minetest.register_tool("sticks:sticks", { for _, v in ipairs(objects) do if not v:is_player() and v:get_luaentity() and v:get_luaentity().name == "__builtin:item" then local istack = ItemStack(v:get_luaentity().itemstring) - if istack:get_name() == "default:stick" then + if minetest.get_item_group(istack:get_name(), "stick") == 1 then bonfireb = bonfireb + istack:get_count() * 2 v:remove() - elseif istack:get_name() == "default:leaves" then + elseif minetest.get_item_group(istack:get_name(), "leaves") == 1 then bonfireb = bonfireb + istack:get_count() v:remove() elseif istack:get_name() == "default:coal_lump" then @@ -36,7 +36,7 @@ minetest.register_tool("sticks:sticks", { end end end - if furnaceb >= 9 then + if furnaceb >= 9 and math.random(6) == 1 and minetest.env:get_node(pos).name == "air" then if furnace.check_furnace_blocks(pos) then for _, v in ipairs(coals) do v:remove() @@ -68,7 +68,7 @@ minetest.register_tool("sticks:sticks", { end end end - if bonfireb >= 10 and minetest.env:get_node(pos).name == "air" then + if bonfireb >= 10 and math.random(2) == 1 and minetest.env:get_node(pos).name == "air" then minetest.env:set_node(pos, {name = "bonfire:self"}) local meta = minetest.env:get_meta(pos) meta:set_int("active", 1) @@ -91,11 +91,9 @@ minetest.register_tool("sticks:sticks", { minetest.register_craft({ + type = "shapeless", output = "sticks:sticks", - recipe = { - {"", "default:stick"}, - {"default:stick", ""}, - }, + recipe = {"group:stick", "group:stick"}, }) minetest.register_alias("sticks", "sticks:sticks") diff --git a/mods/default/textures/default_sticks.png b/mods/sticks/textures/sticks_sticks.png similarity index 100% rename from mods/default/textures/default_sticks.png rename to mods/sticks/textures/sticks_sticks.png diff --git a/mods/tree_plus/depends.txt b/mods/tree_plus/depends.txt deleted file mode 100644 index 331d858..0000000 --- a/mods/tree_plus/depends.txt +++ /dev/null @@ -1 +0,0 @@ -default \ No newline at end of file diff --git a/mods/tree_plus/init.lua b/mods/tree_plus/init.lua deleted file mode 100644 index 08054f5..0000000 --- a/mods/tree_plus/init.lua +++ /dev/null @@ -1,76 +0,0 @@ -minetest.register_node(":default:leaves", { - description = "Leaves", - drawtype = "allfaces_optional", - visual_scale = 1.3, - tiles = {"default_leaves.png"}, - particle_image = {"default_leaves.png"}, - paramtype = "light", - groups = {snappy=3, leafdecay=3, flammable=2}, - drop = { - max_items = 1, - items = { - { - items = {'default:sapling'}, - rarity = 15, - }, - { - items = {'default:stick'}, - rarity = 3, - }, - { - items = {'default:leaves'}, - } - } - }, - climbable = true, - sounds = default.node_sound_leaves_defaults(), - walkable = false, -}) - -GROUND_LIST={ - 'default:dirt', - 'default:dirt_with_grass', -} - -local table_containts = function(t, v) - for _, i in ipairs(t) do - if i==v then - return true - end - end - return false -end - -minetest.register_abm({ - nodenames = {'default:tree'}, - interval = 1.0, - chance = 1.0, - action = function(pos, node, active_object_count, active_object_count_wider) - if table_containts(GROUND_LIST, minetest.env:get_node({x = pos.x, y = pos.y-1, z = pos.z}).name) then return end - for i = -1, 1 do - for k = -1, 1 do - if minetest.env:get_node({x = pos.x+i, y = pos.y-1, z = pos.z+k}).name == 'default:tree' then return end - end - end - minetest.env:add_item(pos, "default:tree") - minetest.env:add_node(pos, {name="air"}) - end, -}) - -minetest.register_abm({ - nodenames = {'default:tree'}, - interval = 3600000, - chance = 0.1, - action = function(pos, node, active_object_count, active_object_count_wider) - for i=0, 3 do - for j=0,3 do - for k=0,3 do - if minetest.env:get_node({x=pos.x+i-1, y=pos.y+j-1, z=pos.z+k-1}).name == "air" then - minetest.env:add_node({x=pos.x+i-1, y=pos.y+j-1, z=pos.z+k-1}, {name="default:apple"}) - return - end - end - end - end - end, -}) diff --git a/mods/trees/depends.txt b/mods/trees/depends.txt new file mode 100644 index 0000000..aad13fc --- /dev/null +++ b/mods/trees/depends.txt @@ -0,0 +1,3 @@ +default +helper_functions +metals diff --git a/mods/trees/init.lua b/mods/trees/init.lua new file mode 100644 index 0000000..795273d --- /dev/null +++ b/mods/trees/init.lua @@ -0,0 +1,80 @@ +trees = {} + +dofile(minetest.get_modpath("trees").."/leavesgen.lua") + +function trees.make_tree(pos, tree) + local tree = realtest.registered_trees[tree] + if not table.contains(tree.grounds, minetest.env:get_node({x=pos.x,y=pos.y-1,z=pos.z}).name) then + return + end + local height = tree.height() + for i = 1,height do + if minetest.env:get_node({x=pos.x, y=pos.y+i, z=pos.z}).name ~= "air" then + return + end + end + for i = 0,height do + minetest.env:add_node({x=pos.x, y=pos.y+i, z=pos.z}, {name=tree.name.."_trunk"}) + end + for i = 1,#tree.leaves do + local p = {x=pos.x+tree.leaves[i][1], y=pos.y+height+tree.leaves[i][2], z=pos.z+tree.leaves[i][3]} + if minetest.env:get_node(p).name == "air" or minetest.env:get_node(p).name == "ignore" then + minetest.env:add_node(p, {name=tree.name.."_leaves"}) + end + end +end + +local function generate(tree, minp, maxp, seed) + local perlin1 = minetest.env:get_perlin(329, 3, 0.6, 100) + -- Assume X and Z lengths are equal + local divlen = 16 + local divs = (maxp.x-minp.x)/divlen+1; + for divx=0,divs-1 do + for divz=0,divs-1 do + local x0 = minp.x + math.floor((divx+0)*divlen) + local z0 = minp.z + math.floor((divz+0)*divlen) + local x1 = minp.x + math.floor((divx+1)*divlen) + local z1 = minp.z + math.floor((divz+1)*divlen) + -- Determine trees amount from perlin noise + local trees_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 5 + 0) + -- Find random positions for trees based on this random + local pr = PseudoRandom(seed) + for i=0,trees_amount do + local x = pr:next(x0, x1) + local z = pr:next(z0, z1) + -- Find ground level (0...30) + local ground_y = nil + for y=30,0,-1 do + if minetest.env:get_node({x=x,y=y,z=z}).name ~= "air" then + ground_y = y + break + end + end + if ground_y then + trees.make_tree({x=x,y=ground_y+1,z=z}, tree) + end + end + end + end +end + +dofile(minetest.get_modpath("trees").."/registration.lua") + +minetest.register_on_generated(function(minp, maxp, seed) + local pr = PseudoRandom(seed) + local n = 0 + if pr:next(1,2) == 1 then + n = n + 1 + end + if pr:next(1, 10) == 1 then + n = n + 1 + end + if pr:next(1, 20) == 1 then + n = n + 1 + end + if n > 0 then + for i = 1, n do + generate(realtest.registered_trees_list[pr:next(1,#realtest.registered_trees_list)], minp, maxp, seed, 1/8/2, 1) + end + end +end) diff --git a/mods/trees/leavesgen.lua b/mods/trees/leavesgen.lua new file mode 100644 index 0000000..a63ecbf --- /dev/null +++ b/mods/trees/leavesgen.lua @@ -0,0 +1,1458 @@ +trees.gen_lists={} +trees.gen_lists.ash={ + {0,2,0}, + {-1,2,0}, + {1,2,0}, + {0,2,-1}, + {0,2,1}, + ---------- + {-1,1,-1}, + {0,1,-1}, + {1,1,-1}, + {-1,1,0}, + {0,1,0}, + {1,1,0}, + {-1,1,1}, + {0,1,1}, + {1,1,1}, + {-2,1,0}, + {2,1,0}, + {0,1,-2}, + {0,1,2}, + ---------- + {-1,0,-2}, + {0,0,-2}, + {1,0,-2}, + {-2,0,-1}, + {-1,0,-1}, + {0,0,-1}, + {1,0,-1}, + {2,0,-1}, + {-2,0,0}, + {-1,0,0}, + {0,0,0}, + {1,0,0}, + {2,0,0}, + {-2,0,1}, + {-1,0,1}, + {0,0,1}, + {1,0,1}, + {2,0,1}, + {-1,0,2}, + {0,0,2}, + {1,0,2}, + ---------- + {-1,-1,-2}, + {0,-1,-2}, + {1,-1,-2}, + {-2,-1,-1}, + {-1,-1,-1}, + {0,-1,-1}, + {1,-1,-1}, + {2,-1,-1}, + {-2,-1,0}, + {-1,-1,0}, + {0,-1,0}, + {1,-1,0}, + {2,-1,0}, + {-2,-1,1}, + {-1,-1,1}, + {0,-1,1}, + {1,-1,1}, + {2,-1,1}, + {-1,-1,2}, + {0,-1,2}, + {1,-1,2}, + {3,-1,0}, + {-3,-1,0}, + {0,-1,3}, + {0,-1,-3}, + ---------- + {-2,-2,-2}, + {-1,-2,-2}, + {0,-2,-2}, + {1,-2,-2}, + {2,-2,-2}, + {-2,-2,-1}, + {-1,-2,-1}, + {0,-2,-1}, + {1,-2,-1}, + {2,-2,-1}, + {-2,-2,0}, + {-1,-2,0}, + {0,-2,0}, + {1,-2,0}, + {2,-2,0}, + {-2,-2,1}, + {-1,-2,1}, + {0,-2,1}, + {1,-2,1}, + {2,-2,1}, + {-2,-2,2}, + {-1,-2,2}, + {0,-2,2}, + {1,-2,2}, + {2,-2,2}, + {3,-2,0}, + {-3,-2,0}, + {0,-2,3}, + {0,-2,-3}, + ---------- + {-1,-3,-1}, + {0,-3,-1}, + {1,-3,-1}, + {-1,-3,0}, + {0,-3,0}, + {1,-3,0}, + {-1,-3,1}, + {0,-3,1}, + {1,-3,1}, + {-2,-3,0}, + {2,-3,0}, + {0,-3,-2}, + {0,-3,2}, +} + +trees.gen_lists.mapple={ + {0,1,0}, + {-1,1,0}, + {1,1,0}, + {0,1,-1}, + {0,1,1}, + ----------- + {-1,0,0}, + {1,0,0}, + {0,0,-1}, + {0,0,1}, + {-1,0,-1}, + {1,0,-1}, + {-1,0,1}, + {1,0,1}, + ----------- + {-1,-1,0}, + {1,-1,0}, + {0,-1,-1}, + {0,-1,1}, + {-1,-1,-1}, + {1,-1,-1}, + {-1,-1,1}, + {1,-1,1}, + {-2,-1,-1}, + {-2,-1,0}, + {-2,-1,1}, + {2,-1,-1}, + {2,-1,0}, + {2,-1,1}, + {1,-1,-2}, + {0,-1,-2}, + {-1,-1,-2}, + {1,-1,2}, + {0,-1,2}, + {-1,-1,2}, + ----------- + {-1,-2,0}, + {1,-2,0}, + {0,-2,-1}, + {0,-2,1}, + {-1,-2,-1}, + {1,-2,-1}, + {-1,-2,1}, + {1,-2,1}, + {-2,-2,-1}, + {-2,-2,0}, + {-2,-2,1}, + {2,-2,-1}, + {2,-2,0}, + {2,-2,1}, + {-1,-2,-2}, + {0,-2,-2}, + {1,-2,-2}, + {-1,-2,2}, + {0,-2,2}, + {1,-2,2}, + {-2,-2,2}, + {-2,-2,-2}, + {2,-2,2}, + {2,-2,-2}, + ----------- + {-1,-3,1}, + {-1,-3,0}, + {-1,-3,-1}, + {1,-3,1}, + {1,-3,0}, + {1,-3,-1}, + {0,-3,1}, + {0,-3,-1}, + {-2,-3,0}, + {2,-3,0}, + {0,-3,2}, + {0,-3,-2}, + ----------- + {0,-4,-1}, + {0,-4,1}, + {-1,-4,0}, + {1,-4,0}, +} + +trees.gen_lists.birch={ + {1,1,0}, + {0,1,1}, + {-1,1,0}, + {0,1,-1}, + {0,1,0}, + ---------- + {-1,0,-1}, + {0,0,-1}, + {1,0,-1}, + {-1,0,0}, + {0,0,0}, + {1,0,0}, + {-1,0,1}, + {0,0,1}, + {1,0,1}, + ---------- + {-1,-1,-1}, + {0,-1,-1}, + {1,-1,-1}, + {-1,-1,0}, + {0,-1,0}, + {1,-1,0}, + {-1,-1,1}, + {0,-1,1}, + {1,-1,1}, + {-2,-1,-1}, + {-2,-1,0}, + {-2,-1,1}, + {2,-1,-1}, + {2,-1,0}, + {2,-1,1}, + {-1,-1,-2}, + {0,-1,-2}, + {1,-1,-2}, + {-1,-1,2}, + {0,-1,2}, + {1,-1,2}, + ----------- + {-1,-2,-1}, + {0,-2,-1}, + {1,-2,-1}, + {-1,-2,0}, + {0,-2,0}, + {1,-2,0}, + {-1,-2,1}, + {0,-2,1}, + {1,-2,1}, + {-2,-2,-1}, + {-2,-2,0}, + {-2,-2,1}, + {2,-2,-1}, + {2,-2,0}, + {2,-2,1}, + {-1,-2,-2}, + {0,-2,-2}, + {1,-2,-2}, + {-1,-2,2}, + {0,-2,2}, + {1,-2,2}, + ----------- + {-1,-3,-1}, + {0,-3,-1}, + {1,-3,-1}, + {-1,-3,0}, + {0,-3,0}, + {1,-3,0}, + {-1,-3,1}, + {0,-3,1}, + {1,-3,1}, + {-2,-3,-1}, + {-2,-3,0}, + {-2,-3,1}, + {2,-3,-1}, + {2,-3,0}, + {2,-3,1}, + {-1,-3,-2}, + {0,-3,-2}, + {1,-3,-2}, + {-1,-3,2}, + {0,-3,2}, + {1,-3,2}, + ----------- + {-2,-4,-2}, + {-1,-4,-2}, + {0,-4,-2}, + {1,-4,-2}, + {2,-4,-2}, + {-2,-4,-1}, + {-1,-4,-1}, + {0,-4,-1}, + {1,-4,-1}, + {2,-4,-1}, + {-2,-4,0}, + {-1,-4,0}, + {0,-4,0}, + {1,-4,0}, + {2,-4,0}, + {-2,-4,1}, + {-1,-4,1}, + {0,-4,1}, + {1,-4,1}, + {2,-4,1}, + {-2,-4,2}, + {-1,-4,2}, + {0,-4,2}, + {1,-4,2}, + {2,-4,2}, + {-3,-4,0}, + {3,-4,0}, + {0,-4,-3}, + {0,-4,3}, + ------------ + {-2,-5,-2}, + {-1,-5,-2}, + {0,-5,-2}, + {1,-5,-2}, + {2,-5,-2}, + {-2,-5,-1}, + {-1,-5,-1}, + {0,-5,-1}, + {1,-5,-1}, + {2,-5,-1}, + {-2,-5,0}, + {-1,-5,0}, + {0,-5,0}, + {1,-5,0}, + {2,-5,0}, + {-2,-5,1}, + {-1,-5,1}, + {0,-5,1}, + {1,-5,1}, + {2,-5,1}, + {-2,-5,2}, + {-1,-5,2}, + {0,-5,2}, + {1,-5,2}, + {2,-5,2}, + {-3,-5,-1}, + {-3,-5,0}, + {-3,-5,1}, + {3,-5,-1}, + {3,-5,0}, + {3,-5,1}, + {-1,-5,-3}, + {0,-5,-3}, + {1,-5,-3}, + {-1,-5,3}, + {0,-5,3}, + {1,-5,3}, + ------------- + {-2,-6,-2}, + {-1,-6,-2}, + {0,-6,-2}, + {1,-6,-2}, + {2,-6,-2}, + {-2,-6,-1}, + {-1,-6,-1}, + {0,-6,-1}, + {1,-6,-1}, + {2,-6,-1}, + {-2,-6,0}, + {-1,-6,0}, + {0,-6,0}, + {1,-6,0}, + {2,-6,0}, + {-2,-6,1}, + {-1,-6,1}, + {0,-6,1}, + {1,-6,1}, + {2,-6,1}, + {-2,-6,2}, + {-1,-6,2}, + {0,-6,2}, + {1,-6,2}, + {2,-6,2}, + {-3,-6,-1}, + {-3,-6,0}, + {-3,-6,1}, + {3,-6,-1}, + {3,-6,0}, + {3,-6,1}, + {-1,-6,-3}, + {0,-6,-3}, + {1,-6,-3}, + {-1,-6,3}, + {0,-6,3}, + {1,-6,3}, + ------------- + {-2,-7,-2}, + {-1,-7,-2}, + {0,-7,-2}, + {1,-7,-2}, + {2,-7,-2}, + {-2,-7,-1}, + {-1,-7,-1}, + {0,-7,-1}, + {1,-7,-1}, + {2,-7,-1}, + {-2,-7,0}, + {-1,-7,0}, + {0,-7,0}, + {1,-7,0}, + {2,-7,0}, + {-2,-7,1}, + {-1,-7,1}, + {0,-7,1}, + {1,-7,1}, + {2,-7,1}, + {-2,-7,2}, + {-1,-7,2}, + {0,-7,2}, + {1,-7,2}, + {2,-7,2}, + {-3,-7,-1}, + {-3,-7,0}, + {-3,-7,1}, + {3,-7,-1}, + {3,-7,0}, + {3,-7,1}, + {-1,-7,-3}, + {0,-7,-3}, + {1,-7,-3}, + {-1,-7,3}, + {0,-7,3}, + {1,-7,3}, + ---------- + {-1,-8,-1}, + {0,-8,-1}, + {1,-8,-1}, + {-1,-8,0}, + {0,-8,0}, + {1,-8,0}, + {-1,-8,1}, + {0,-8,1}, + {1,-8,1}, + {-2,-8,-1}, + {-2,-8,0}, + {-2,-8,1}, + {2,-8,-1}, + {2,-8,0}, + {2,-8,1}, + {-1,-8,-2}, + {0,-8,-2}, + {1,-8,-2}, + {-1,-8,2}, + {0,-8,2}, + {1,-8,2}, + ------------- + {-1,-9,-1}, + {0,-9,-1}, + {1,-9,-1}, + {-1,-9,0}, + {0,-9,0}, + {1,-9,0}, + {-1,-9,1}, + {0,-9,1}, + {1,-9,1}, +} + +trees.gen_lists.aspen={ + {-1,1,0}, + {1,1,0}, + {0,1,-1}, + {0,1,1}, + {0,1,0}, + ----------- + {-1,0,-1}, + {0,0,-1}, + {1,0,-1}, + {-1,0,0}, + {0,0,0}, + {1,0,0}, + {-1,0,1}, + {0,0,1}, + {1,0,1}, + {-2,0,-1}, + {-2,0,0}, + {-2,0,1}, + {2,0,-1}, + {2,0,0}, + {2,0,1}, + {-1,0,-2}, + {0,0,-2}, + {1,0,-2}, + {-1,0,2}, + {0,0,2}, + {1,0,2}, + ---------- + {-2,-1,-2}, + {-1,-1,-2}, + {0,-1,-2}, + {1,-1,-2}, + {2,-1,-2}, + {-2,-1,-1}, + {-1,-1,-1}, + {0,-1,-1}, + {1,-1,-1}, + {2,-1,-1}, + {-2,-1,0}, + {-1,-1,0}, + {0,-1,0}, + {1,-1,0}, + {2,-1,0}, + {-2,-1,1}, + {-1,-1,1}, + {0,-1,1}, + {1,-1,1}, + {2,-1,1}, + {-2,-1,2}, + {-1,-1,2}, + {0,-1,2}, + {1,-1,2}, + {2,-1,2}, + {-3,-1,0}, + {3,-1,0}, + {0,-1,-3}, + {0,-1,3}, + ----------- + {-2,-2,-2}, + {-1,-2,-2}, + {0,-2,-2}, + {1,-2,-2}, + {2,-2,-2}, + {-2,-2,-1}, + {-1,-2,-1}, + {0,-2,-1}, + {1,-2,-1}, + {2,-2,-1}, + {-2,-2,0}, + {-1,-2,0}, + {0,-2,0}, + {1,-2,0}, + {2,-2,0}, + {-2,-2,1}, + {-1,-2,1}, + {0,-2,1}, + {1,-2,1}, + {2,-2,1}, + {-2,-2,2}, + {-1,-2,2}, + {0,-2,2}, + {1,-2,2}, + {2,-2,2}, + {-3,-2,-1}, + {-3,-2,0}, + {-3,-2,1}, + {3,-2,-1}, + {3,-2,0}, + {3,-2,1}, + {-1,-2,-3}, + {0,-2,-3}, + {1,-2,-3}, + {-1,-2,3}, + {0,-2,3}, + {1,-2,3}, + ----------- + {-1,-3,-1}, + {0,-3,-1}, + {1,-3,-1}, + {-1,-3,0}, + {0,-3,0}, + {1,-3,0}, + {-1,-3,1}, + {0,-3,1}, + {1,-3,1}, + {-2,-3,-1}, + {-2,-3,0}, + {-2,-3,1}, + {2,-3,-1}, + {2,-3,0}, + {2,-3,1}, + {-1,-3,-2}, + {0,-3,-2}, + {1,-3,-2}, + {-1,-3,2}, + {0,-3,2}, + {1,-3,2}, + ----------- + {-1,-4,-1}, + {-1,-4,0}, + {-1,-4,1}, + {0,-4,-1}, + {0,-4,0}, + {0,-4,1}, + {1,-4,-1}, + {1,-4,0}, + {1,-4,1}, + {-2,-4,0}, + {2,-4,0}, + {0,-4,-2}, + {0,-4,2}, + ----------- + {-1,-5,-1}, + {-1,-5,0}, + {-1,-5,1}, + {0,-5,-1}, + {0,-5,0}, + {0,-5,1}, + {1,-5,-1}, + {1,-5,0}, + {1,-5,1}, + ---------- + {-1,-6,0}, + {1,-6,0}, + {0,-6,-1}, + {0,-6,1}, +} + +trees.gen_lists.chestnut={ + {0,1,0}, + {-1,1,0}, + {1,1,0}, + {0,1,-1}, + {0,1,1}, + ----------- + {-1,0,-1}, + {0,0,-1}, + {1,0,-1}, + {-1,0,0}, + {0,0,0}, + {1,0,0}, + {-1,0,1}, + {0,0,1}, + {1,0,1}, + {-2,0,0}, + {2,0,0}, + {0,0,-2}, + {0,0,2}, + ----------- + {-2,-1,-2}, + {-1,-1,-2}, + {0,-1,-2}, + {1,-1,-2}, + {2,-1,-2}, + {-2,-1,-1}, + {-1,-1,-1}, + {0,-1,-1}, + {1,-1,-1}, + {2,-1,-1}, + {-2,-1,0}, + {-1,-1,0}, + {0,-1,0}, + {1,-1,0}, + {2,-1,0}, + {-2,-1,1}, + {-1,-1,1}, + {0,-1,1}, + {1,-1,1}, + {2,-1,1}, + {-2,-1,2}, + {-1,-1,2}, + {0,-1,2}, + {1,-1,2}, + {2,-1,2}, + {-1,-1,-3}, + {0,-1,-3}, + {1,-1,-3}, + {-1,-1,3}, + {0,-1,3}, + {1,-1,3}, + {-3,-1,-1}, + {-3,-1,0}, + {-3,-1,1}, + {3,-1,-1}, + {3,-1,0}, + {3,-1,1}, + ----------- + {-2,-2,-2}, + {-1,-2,-2}, + {0,-2,-2}, + {1,-2,-2}, + {2,-2,-2}, + {-2,-2,-1}, + {-1,-2,-1}, + {0,-2,-1}, + {1,-2,-1}, + {2,-2,-1}, + {-2,-2,0}, + {-1,-2,0}, + {0,-2,0}, + {1,-2,0}, + {2,-2,0}, + {-2,-2,1}, + {-1,-2,1}, + {0,-2,1}, + {1,-2,1}, + {2,-2,1}, + {-2,-2,2}, + {-1,-2,2}, + {0,-2,2}, + {1,-2,2}, + {2,-2,2}, + {-2,-2,-3}, + {-1,-2,-3}, + {0,-2,-3}, + {1,-2,-3}, + {2,-2,-3}, + {-2,-2,3}, + {-1,-2,3}, + {0,-2,3}, + {1,-2,3}, + {2,-2,3}, + {-3,-2,-2}, + {-3,-2,-1}, + {-3,-2,0}, + {-3,-2,1}, + {-3,-2,2}, + {3,-2,-2}, + {3,-2,-1}, + {3,-2,0}, + {3,-2,1}, + {3,-2,2}, + {-1,-2,-4}, + {0,-2,-4}, + {1,-2,-4}, + {-1,-2,4}, + {0,-2,4}, + {1,-2,4}, + {-4,-2,-1}, + {-4,-2,0}, + {-4,-2,1}, + {4,-2,-1}, + {4,-2,0}, + {4,-2,1}, + {-5,-2,0}, + {5,-2,0}, + {0,-2,-5}, + {0,-2,5}, + ----------- + {-3,-3,-4}, + {-2,-3,-4}, + {-1,-3,-4}, + {0,-3,-4}, + {1,-3,-4}, + {2,-3,-4}, + {3,-3,-4}, + {-4,-3,-3}, + {-3,-3,-3}, + {-2,-3,-3}, + {-1,-3,-3}, + {0,-3,-3}, + {1,-3,-3}, + {2,-3,-3}, + {3,-3,-3}, + {4,-3,-3}, + {-4,-3,-2}, + {-3,-3,-2}, + {-2,-3,-2}, + {-1,-3,-2}, + {0,-3,-2}, + {1,-3,-2}, + {2,-3,-2}, + {3,-3,-2}, + {4,-3,-2}, + {-4,-3,-1}, + {-3,-3,-1}, + {-2,-3,-1}, + {-1,-3,-1}, + {0,-3,-1}, + {1,-3,-1}, + {2,-3,-1}, + {3,-3,-1}, + {4,-3,-1}, + {-4,-3,0}, + {-3,-3,0}, + {-2,-3,0}, + {-1,-3,0}, + {0,-3,0}, + {1,-3,0}, + {2,-3,0}, + {3,-3,0}, + {4,-3,0}, + {-4,-3,1}, + {-3,-3,1}, + {-2,-3,1}, + {-1,-3,1}, + {0,-3,1}, + {1,-3,1}, + {2,-3,1}, + {3,-3,1}, + {4,-3,1}, + {-4,-3,2}, + {-3,-3,2}, + {-2,-3,2}, + {-1,-3,2}, + {0,-3,2}, + {1,-3,2}, + {2,-3,2}, + {3,-3,2}, + {4,-3,2}, + {-4,-3,3}, + {-3,-3,3}, + {-2,-3,3}, + {-1,-3,3}, + {0,-3,3}, + {1,-3,3}, + {2,-3,3}, + {3,-3,3}, + {4,-3,3}, + {-3,-3,4}, + {-2,-3,4}, + {-1,-3,4}, + {0,-3,4}, + {1,-3,4}, + {2,-3,4}, + {3,-3,4}, + {-2,-3,-5}, + {-1,-3,-5}, + {0,-3,-5}, + {1,-3,-5}, + {2,-3,-5}, + {-2,-3,5}, + {-1,-3,5}, + {0,-3,5}, + {1,-3,5}, + {2,-3,5}, + {-5,-3,-2}, + {-5,-3,-1}, + {-5,-3,0}, + {-5,-3,1}, + {-5,-3,2}, + {5,-3,-2}, + {5,-3,-1}, + {5,-3,0}, + {5,-3,1}, + {5,-3,2}, + {-6,-3,0}, + {6,-3,0}, + {0,-3,-6}, + {0,-3,6}, + ---------- + {-1,-4,-6}, + {0,-4,-6}, + {1,-4,-6}, + + {-3,-4,-5}, + {-2,-4,-5}, + {-1,-4,-5}, + {0,-4,-5}, + {1,-4,-5}, + {2,-4,-5}, + {3,-4,-5}, + + {-4,-4,-4}, + {-3,-4,-4}, + {-2,-4,-4}, + {-1,-4,-4}, + {0,-4,-4}, + {1,-4,-4}, + {2,-4,-4}, + {3,-4,-4}, + {4,-4,-4}, + + {-5,-4,-3}, + {-4,-4,-3}, + {-3,-4,-3}, + {-2,-4,-3}, + {-1,-4,-3}, + {0,-4,-3}, + {1,-4,-3}, + {2,-4,-3}, + {3,-4,-3}, + {4,-4,-3}, + {5,-4,-3}, + + {-5,-4,-2}, + {-4,-4,-2}, + {-3,-4,-2}, + {-2,-4,-2}, + {-1,-4,-2}, + {0,-4,-2}, + {1,-4,-2}, + {2,-4,-2}, + {3,-4,-2}, + {4,-4,-2}, + {5,-4,-2}, + + {-6,-4,-1}, + {-5,-4,-1}, + {-4,-4,-1}, + {-3,-4,-1}, + {-2,-4,-1}, + {-1,-4,-1}, + {0,-4,-1}, + {1,-4,-1}, + {2,-4,-1}, + {3,-4,-1}, + {4,-4,-1}, + {5,-4,-1}, + {6,-4,-1}, + + {-6,-4,0}, + {-5,-4,0}, + {-4,-4,0}, + {-3,-4,0}, + {-2,-4,0}, + {-1,-4,0}, + {0,-4,0}, + {1,-4,0}, + {2,-4,0}, + {3,-4,0}, + {4,-4,0}, + {5,-4,0}, + {6,-4,0}, + + {-6,-4,1}, + {-5,-4,1}, + {-4,-4,1}, + {-3,-4,1}, + {-2,-4,1}, + {-1,-4,1}, + {0,-4,1}, + {1,-4,1}, + {2,-4,1}, + {3,-4,1}, + {4,-4,1}, + {5,-4,1}, + {6,-4,1}, + + {-5,-4,2}, + {-4,-4,2}, + {-3,-4,2}, + {-2,-4,2}, + {-1,-4,2}, + {0,-4,2}, + {1,-4,2}, + {2,-4,2}, + {3,-4,2}, + {4,-4,2}, + {5,-4,2}, + + {-5,-4,3}, + {-4,-4,3}, + {-3,-4,3}, + {-2,-4,3}, + {-1,-4,3}, + {0,-4,3}, + {1,-4,3}, + {2,-4,3}, + {3,-4,3}, + {4,-4,3}, + {5,-4,3}, + + {-4,-4,4}, + {-3,-4,4}, + {-2,-4,4}, + {-1,-4,4}, + {0,-4,4}, + {1,-4,4}, + {2,-4,4}, + {3,-4,4}, + {4,-4,4}, + + {-3,-4,5}, + {-2,-4,5}, + {-1,-4,5}, + {0,-4,5}, + {1,-4,5}, + {2,-4,5}, + {3,-4,5}, + + {-1,-4,6}, + {0,-4,6}, + {1,-4,6}, + ---------- + {-1,-5,-6}, + {0,-5,-6}, + {1,-5,-6}, + + {-3,-5,-5}, + {-2,-5,-5}, + {-1,-5,-5}, + {0,-5,-5}, + {1,-5,-5}, + {2,-5,-5}, + {3,-5,-5}, + + {-4,-5,-4}, + {-3,-5,-4}, + {-2,-5,-4}, + {-1,-5,-4}, + {0,-5,-4}, + {1,-5,-4}, + {2,-5,-4}, + {3,-5,-4}, + {4,-5,-4}, + + {-5,-5,-3}, + {-4,-5,-3}, + {-3,-5,-3}, + {-2,-5,-3}, + {-1,-5,-3}, + {0,-5,-3}, + {1,-5,-3}, + {2,-5,-3}, + {3,-5,-3}, + {4,-5,-3}, + {5,-5,-3}, + + {-5,-5,-2}, + {-4,-5,-2}, + {-3,-5,-2}, + {-2,-5,-2}, + {-1,-5,-2}, + {0,-5,-2}, + {1,-5,-2}, + {2,-5,-2}, + {3,-5,-2}, + {4,-5,-2}, + {5,-5,-2}, + + {-6,-5,-1}, + {-5,-5,-1}, + {-4,-5,-1}, + {-3,-5,-1}, + {-2,-5,-1}, + {-1,-5,-1}, + {0,-5,-1}, + {1,-5,-1}, + {2,-5,-1}, + {3,-5,-1}, + {4,-5,-1}, + {5,-5,-1}, + {6,-5,-1}, + + {-6,-5,0}, + {-5,-5,0}, + {-4,-5,0}, + {-3,-5,0}, + {-2,-5,0}, + {-1,-5,0}, + {0,-5,0}, + {1,-5,0}, + {2,-5,0}, + {3,-5,0}, + {4,-5,0}, + {5,-5,0}, + {6,-5,0}, + + {-6,-5,1}, + {-5,-5,1}, + {-4,-5,1}, + {-3,-5,1}, + {-2,-5,1}, + {-1,-5,1}, + {0,-5,1}, + {1,-5,1}, + {2,-5,1}, + {3,-5,1}, + {4,-5,1}, + {5,-5,1}, + {6,-5,1}, + + {-5,-5,2}, + {-4,-5,2}, + {-3,-5,2}, + {-2,-5,2}, + {-1,-5,2}, + {0,-5,2}, + {1,-5,2}, + {2,-5,2}, + {3,-5,2}, + {4,-5,2}, + {5,-5,2}, + + {-5,-5,3}, + {-4,-5,3}, + {-3,-5,3}, + {-2,-5,3}, + {-1,-5,3}, + {0,-5,3}, + {1,-5,3}, + {2,-5,3}, + {3,-5,3}, + {4,-5,3}, + {5,-5,3}, + + {-4,-5,4}, + {-3,-5,4}, + {-2,-5,4}, + {-1,-5,4}, + {0,-5,4}, + {1,-5,4}, + {2,-5,4}, + {3,-5,4}, + {4,-5,4}, + + {-3,-5,5}, + {-2,-5,5}, + {-1,-5,5}, + {0,-5,5}, + {1,-5,5}, + {2,-5,5}, + {3,-5,5}, + + {-1,-5,6}, + {0,-5,6}, + {1,-5,6}, + ---------- + {-3,-6,-4}, + {-2,-6,-4}, + {-1,-6,-4}, + {0,-6,-4}, + {1,-6,-4}, + {2,-6,-4}, + {3,-6,-4}, + {-4,-6,-3}, + {-3,-6,-3}, + {-2,-6,-3}, + {-1,-6,-3}, + {0,-6,-3}, + {1,-6,-3}, + {2,-6,-3}, + {3,-6,-3}, + {4,-6,-3}, + {-4,-6,-2}, + {-3,-6,-2}, + {-2,-6,-2}, + {-1,-6,-2}, + {0,-6,-2}, + {1,-6,-2}, + {2,-6,-2}, + {3,-6,-2}, + {4,-6,-2}, + {-4,-6,-1}, + {-3,-6,-1}, + {-2,-6,-1}, + {-1,-6,-1}, + {0,-6,-1}, + {1,-6,-1}, + {2,-6,-1}, + {3,-6,-1}, + {4,-6,-1}, + {-4,-6,0}, + {-3,-6,0}, + {-2,-6,0}, + {-1,-6,0}, + {0,-6,0}, + {1,-6,0}, + {2,-6,0}, + {3,-6,0}, + {4,-6,0}, + {-4,-6,1}, + {-3,-6,1}, + {-2,-6,1}, + {-1,-6,1}, + {0,-6,1}, + {1,-6,1}, + {2,-6,1}, + {3,-6,1}, + {4,-6,1}, + {-4,-6,2}, + {-3,-6,2}, + {-2,-6,2}, + {-1,-6,2}, + {0,-6,2}, + {1,-6,2}, + {2,-6,2}, + {3,-6,2}, + {4,-6,2}, + {-4,-6,3}, + {-3,-6,3}, + {-2,-6,3}, + {-1,-6,3}, + {0,-6,3}, + {1,-6,3}, + {2,-6,3}, + {3,-6,3}, + {4,-6,3}, + {-3,-6,4}, + {-2,-6,4}, + {-1,-6,4}, + {0,-6,4}, + {1,-6,4}, + {2,-6,4}, + {3,-6,4}, + {-2,-6,-5}, + {-1,-6,-5}, + {0,-6,-5}, + {1,-6,-5}, + {2,-6,-5}, + {-2,-6,5}, + {-1,-6,5}, + {0,-6,5}, + {1,-6,5}, + {2,-6,5}, + {-5,-6,-2}, + {-5,-6,-1}, + {-5,-6,0}, + {-5,-6,1}, + {-5,-6,2}, + {5,-6,-2}, + {5,-6,-1}, + {5,-6,0}, + {5,-6,1}, + {5,-6,2}, + {-6,-6,0}, + {6,-6,0}, + {0,-6,-6}, + {0,-6,6}, + ---------- + {-2,-7,-1}, + {-2,-7,0}, + {-2,-7,1}, + {2,-7,-1}, + {2,-7,0}, + {2,-7,1}, + {-1,-7,-1}, + {0,-7,-1}, + {1,-7,-1}, + {-1,-7,0}, + {0,-7,0}, + {1,-7,0}, + {-1,-7,1}, + {0,-7,1}, + {1,-7,1}, + {-1,-7,-2}, + {0,-7,-2}, + {1,-7,-2}, + {-1,-7,2}, + {0,-7,2}, + {1,-7,2}, +} + +trees.gen_lists.pine={ + {-1,1,0}, + {1,1,0}, + {0,1,-1}, + {0,1,1}, + {0,1,0}, + ---------- + {-1,0,-1}, + {-1,0,0}, + {-1,0,1}, + {0,0,-1}, + {0,0,0}, + {0,0,1}, + {1,0,-1}, + {1,0,0}, + {1,0,1}, + ---------- + {-1,-1,-1}, + {-1,-1,0}, + {-1,-1,1}, + {0,-1,-1}, + {0,-1,0}, + {0,-1,1}, + {1,-1,-1}, + {1,-1,0}, + {1,-1,1}, + {-2,-1,-1}, + {-2,-1,0}, + {-2,-1,1}, + {2,-1,-1}, + {2,-1,0}, + {2,-1,1}, + {-1,-1,-2}, + {0,-1,-2}, + {1,-1,-2}, + {-1,-1,2}, + {0,-1,2}, + {1,-1,2}, + ---------- + {-2,-2,-2}, + {-2,-2,-1}, + {-2,-2,0}, + {-2,-2,1}, + {-2,-2,2}, + {-1,-2,-2}, + {-1,-2,-1}, + {-1,-2,0}, + {-1,-2,1}, + {-1,-2,2}, + {-1,-2,-2}, + {0,-2,-1}, + {0,-2,0}, + {0,-2,1}, + {0,-2,2}, + {1,-2,-2}, + {1,-2,-1}, + {1,-2,0}, + {1,-2,1}, + {1,-2,2}, + {2,-2,-2}, + {2,-2,-1}, + {2,-2,0}, + {2,-2,1}, + {2,-2,2}, + {-3,-2,-1}, + {-3,-2,0}, + {-3,-2,1}, + {3,-2,-1}, + {3,-2,0}, + {3,-2,1}, + {-1,-2,-3}, + {0,-2,-3}, + {1,-2,-3}, + {-1,-2,3}, + {0,-2,3}, + {1,-2,3}, + ---------- + {-3,-3,-2}, + {-3,-3,-1}, + {-3,-3,0}, + {-3,-3,1}, + {-3,-3,2}, + {-2,-3,-3}, + {-2,-3,-2}, + {-2,-3,-1}, + {-2,-3,0}, + {-2,-3,1}, + {-2,-3,2}, + {-2,-3,3}, + {-1,-3,-3}, + {-1,-3,-2}, + {-1,-3,-1}, + {-1,-3,0}, + {-1,-3,1}, + {-1,-3,2}, + {-1,-3,3}, + {0,-3,-3}, + {0,-3,-2}, + {0,-3,-1}, + {0,-3,0}, + {0,-3,1}, + {0,-3,2}, + {0,-3,3}, + {1,-3,-3}, + {1,-3,-2}, + {1,-3,-1}, + {1,-3,0}, + {1,-3,1}, + {1,-3,2}, + {1,-3,3}, + {2,-3,-3}, + {2,-3,-2}, + {2,-3,-1}, + {2,-3,0}, + {2,-3,1}, + {2,-3,2}, + {2,-3,3}, + {3,-3,-2}, + {3,-3,-1}, + {3,-3,0}, + {3,-3,1}, + {3,-3,2}, + ---------- + {-3,-4,-2}, + {-3,-4,-1}, + {-3,-4,0}, + {-3,-4,1}, + {-3,-4,2}, + {-2,-4,-3}, + {-2,-4,-2}, + {-2,-4,-1}, + {-2,-4,0}, + {-2,-4,1}, + {-2,-4,2}, + {-2,-4,3}, + {-1,-4,-3}, + {-1,-4,-2}, + {-1,-4,-1}, + {-1,-4,0}, + {-1,-4,1}, + {-1,-4,2}, + {-1,-4,3}, + {0,-4,-3}, + {0,-4,-2}, + {0,-4,-1}, + {0,-4,0}, + {0,-4,1}, + {0,-4,2}, + {0,-4,3}, + {1,-4,-3}, + {1,-4,-2}, + {1,-4,-1}, + {1,-4,0}, + {1,-4,1}, + {1,-4,2}, + {1,-4,3}, + {2,-4,-3}, + {2,-4,-2}, + {2,-4,-1}, + {2,-4,0}, + {2,-4,1}, + {2,-4,2}, + {2,-4,3}, + {3,-4,-2}, + {3,-4,-1}, + {3,-4,0}, + {3,-4,1}, + {3,-4,2}, + ---------- + {-3,-5,-2}, + {-3,-5,-1}, + {-3,-5,0}, + {-3,-5,1}, + {-3,-5,2}, + {-2,-5,-3}, + {-2,-5,-2}, + {-2,-5,-1}, + {-2,-5,0}, + {-2,-5,1}, + {-2,-5,2}, + {-2,-5,3}, + {-1,-5,-3}, + {-1,-5,-2}, + {-1,-5,-1}, + {-1,-5,0}, + {-1,-5,1}, + {-1,-5,2}, + {-1,-5,3}, + {0,-5,-3}, + {0,-5,-2}, + {0,-5,-1}, + {0,-5,0}, + {0,-5,1}, + {0,-5,2}, + {0,-5,3}, + {1,-5,-3}, + {1,-5,-2}, + {1,-5,-1}, + {1,-5,0}, + {1,-5,1}, + {1,-5,2}, + {1,-5,3}, + {2,-5,-3}, + {2,-5,-2}, + {2,-5,-1}, + {2,-5,0}, + {2,-5,1}, + {2,-5,2}, + {2,-5,3}, + {3,-5,-2}, + {3,-5,-1}, + {3,-5,0}, + {3,-5,1}, + {3,-5,2}, + ---------- + {-1,-6,-1}, + {-1,-6,0}, + {-1,-6,1}, + {0,-6,-1}, + {0,-6,0}, + {0,-6,1}, + {1,-6,-1}, + {1,-6,0}, + {1,-6,1}, + {-2,-6,-1}, + {-2,-6,0}, + {-2,-6,1}, + {2,-6,-1}, + {2,-6,0}, + {2,-6,1}, + {-1,-6,-2}, + {0,-6,-2}, + {1,-6,-2}, + {-1,-6,2}, + {0,-6,2}, + {1,-6,2}, +} diff --git a/mods/trees/registration.lua b/mods/trees/registration.lua new file mode 100644 index 0000000..439d1df --- /dev/null +++ b/mods/trees/registration.lua @@ -0,0 +1,461 @@ +realtest.registered_trees = {} +realtest.registered_trees_list = {} +function realtest.register_tree(name, TreeDef) + local tree = { + name = name, + description = TreeDef.description or "", + grounds = TreeDef.grounds or {"default:dirt","default:dirt_with_grass"}, + leaves = TreeDef.leaves or {}, + height = TreeDef.height or function() return 10 end, + radius = TreeDef.radius or 5, + textures = TreeDef.textures or {{},"","","",""}, + grow_interval = TreeDef.grow_interval or 60, + grow_chance = TreeDef.grow_chance or 20, + grow_light = TreeDef.grow_light or 8 + } + realtest.registered_trees[name] = tree + table.insert(realtest.registered_trees_list, tree.name) + + minetest.register_node(tree.name.."_planks", { + description = tree.description.." Planks", + tiles = {tree.textures[3]}, + groups = {planks=1,snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,drop_on_dig=1}, + sounds = default.node_sound_wood_defaults(), + }) + + minetest.register_craftitem(tree.name.."_stick", { + description = tree.description.." Stick", + inventory_image = tree.textures[4], + groups = {stick=1}, + }) + + minetest.register_node(tree.name.."_sapling", { + description = tree.description.." Sapling", + drawtype = "plantlike", + visual_scale = 1.0, + tiles = {tree.textures[5]}, + inventory_image = tree.textures[5], + wield_image = tree.textures[5], + paramtype = "light", + walkable = false, + groups = {snappy=2,dig_immediate=3,flammable=2,dropping_node=1}, + sounds = default.node_sound_defaults(), + }) + + minetest.register_craftitem(tree.name.."_plank", { + description = tree.description.." Plank", + inventory_image = tree.textures[7], + group = {plank=1}, + }) + + minetest.register_node(tree.name.."_log", { + description = tree.description.." Log", + tiles = tree.textures[1], + inventory_image = tree.textures[6], + wield_image = tree.textures[6], + groups = {log=1,snappy=1,choppy=2,flammable=2,dropping_node=1,drop_on_dig=1}, + sounds = default.node_sound_wood_defaults(), + drop = tree.name.."_plank 4", + drop_on_dropping = tree.name.."_log", + drawtype = "nodebox", + paramtype = "light", + node_box = { + type = "fixed", + fixed = { + {-0.4,-0.5,-0.4,0.4,0.5,0.4}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.4,-0.5,-0.4,0.4,0.5,0.4}, + }, + }, + }) + + minetest.register_node(tree.name.."_leaves", { + description = tree.description.." Leaves", + drawtype = "allfaces_optional", + visual_scale = 1.3, + tiles = {tree.textures[2]}, + paramtype = "light", + groups = {snappy=3, leafdecay=3, flammable=2,drop_on_dig=1,leaves=1}, + drop = { + max_items = 1, + items = { + { + items = {tree.name..'_sapling'}, + rarity = 30, + }, + { + items = {tree.name..'_stick'}, + rarity = 10, + }, + { + items = {}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), + walkable = false, + climbable = true, + }) + + minetest.register_node(tree.name.."_trunk", { + description = tree.description.." Trunk", + tiles = tree.textures[1], + groups = {tree=1,snappy=1,choppy=2,flammable=2,dropping_node=1,drop_on_dig=1}, + sounds = default.node_sound_wood_defaults(), + drop = tree.name.."_log", + drawtype = "nodebox", + paramtype = "light", + node_box = { + type = "fixed", + fixed = { + {-0.4,-0.5,-0.4,0.4,0.5,0.4}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.4,-0.5,-0.4,0.4,0.5,0.4}, + }, + }, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + for i = 1,#tree.leaves do + local p = {x=pos.x+tree.leaves[i][1], y=pos.y+tree.leaves[i][2], z=pos.z+tree.leaves[i][3]} + if minetest.env:get_node(p).name == tree.name.."_leaves" then + minetest.env:dig_node(p) + end + end + end, + }) + + minetest.register_node(tree.name.."_fence", { + description = tree.description.." Fence", + drawtype = "fencelike", + tiles = {tree.textures[3]}, + paramtype = "light", + is_ground_content = true, + selection_box = { + type = "fixed", + fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, + }, + groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2}, + sounds = default.node_sound_wood_defaults(), + }) + + minetest.register_node(tree.name.."_stair", { + description = tree.description.." Stair", + drawtype = "nodebox", + tiles = {tree.textures[3]}, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = true, + groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2}, + 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_node(tree.name.."_slab", { + description = tree.description.." Slab", + drawtype = "nodebox", + tiles = {tree.textures[3]}, + paramtype = "light", + is_ground_content = true, + groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2}, + 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}, + }, + }) + + minetest.register_node(tree.name.."_ladder", { + description = tree.description.." Ladder", + drawtype = "nodebox", + tiles = {tree.textures[3]}, + particle_image = {tree.textures[3]}, + inventory_image = tree.textures[8], + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = true, + climbable = true, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.5-1/7, -0.5+1/7, 0.5, 0.5}, + {0.5-1/7, -0.5, 0.5-1/7, 0.5, 0.5, 0.5}, + {-0.5+1/7, 0.5-1/6-1/12, 0.5-1/16, 0.5-1/7, 0.5-1/12, 0.5}, + {-0.5+1/7, 0.5-1/12-1/6*3, 0.5-1/16, 0.5-1/7, 0.5-1/12-1/6*2, 0.5}, + {-0.5+1/7, 0.5-1/12-1/6*5, 0.5-1/16, 0.5-1/7, 0.5-1/12-1/6*4, 0.5}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.5-1/7, -0.5+1/7, 0.5, 0.5}, + {0.5-1/7, -0.5, 0.5-1/7, 0.5, 0.5, 0.5}, + {-0.5+1/7, 0.5-1/6-1/12, 0.5-1/16, 0.5-1/7, 0.5-1/12, 0.5}, + {-0.5+1/7, 0.5-1/12-1/6*3, 0.5-1/16, 0.5-1/7, 0.5-1/12-1/6*2, 0.5}, + {-0.5+1/7, 0.5-1/12-1/6*5, 0.5-1/16, 0.5-1/7, 0.5-1/12-1/6*4, 0.5}, + }, + }, + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type == "node" and + minetest.registered_nodes[minetest.env:get_node(pointed_thing.above).name].buildable_to == true then + local param2 = nil + if pointed_thing.above.x < pointed_thing.under.x then + param2 = 1 + elseif pointed_thing.above.x > pointed_thing.under.x then + param2 = 3 + elseif pointed_thing.above.z < pointed_thing.under.z then + param2 = 0 + elseif pointed_thing.above.z > pointed_thing.under.z then + param2 = 2 + end + if param2 then + minetest.env:set_node(pointed_thing.above,{name = tree.name.."_ladder", param2 = param2}) + end + itemstack:take_item() + return itemstack + end + end, + node_placement_prediction = "", + groups = {snappy=1,choppy=2,oddly_breakable_by_hand=3,flammable=2}, + sounds = default.node_sound_wood_defaults(), + }) + + minetest.register_craft({ + output = tree.name.."_ladder", + recipe = { + {tree.name.."_stick", "", tree.name.."_stick"}, + {tree.name.."_stick", tree.name.."_stick", tree.name.."_stick"}, + {tree.name.."_stick", "", tree.name.."_stick"}, + } + }) + + minetest.register_craft({ + output = tree.name.."_slab", + recipe = { + {tree.name.."_plank", tree.name.."_plank", tree.name.."_plank"}, + }, + }) + + minetest.register_craft({ + output = tree.name.."_planks", + recipe = { + {tree.name.."_slab"}, + {tree.name.."_slab"}, + }, + }) + + minetest.register_craft({ + output = tree.name.."_stair 2", + recipe = { + {tree.name.."_plank", "", ""}, + {tree.name.."_plank", tree.name.."_plank", ""}, + {tree.name.."_plank", tree.name.."_plank", tree.name.."_plank"}, + }, + }) + + minetest.register_craft({ + output = tree.name.."_stair 2", + recipe = { + {"", "", tree.name.."_plank"}, + {"", tree.name.."_plank", tree.name.."_plank"}, + {tree.name.."_plank", tree.name.."_plank", tree.name.."_plank"}, + }, + }) + + minetest.register_craft({ + output = tree.name.."_fence 2", + recipe = { + {tree.name.."_plank", tree.name.."_plank", tree.name.."_plank"}, + {tree.name.."_plank", tree.name.."_plank", tree.name.."_plank"}, + } + }) + + minetest.register_craft({ + output = "default:sign_wall", + recipe = { + {tree.name.."_plank", tree.name.."_plank", tree.name.."_plank"}, + {tree.name.."_plank", tree.name.."_plank", tree.name.."_plank"}, + {"", "group:stick", ""}, + } + }) + + minetest.register_craft({ + output = "default:chest", + recipe = { + {tree.name.."_plank", tree.name.."_plank", tree.name.."_plank"}, + {tree.name.."_plank", "", tree.name.."_plank"}, + {tree.name.."_plank", tree.name.."_plank", tree.name.."_plank"}, + } + }) + + for i,metal in ipairs(metals.list) do + minetest.register_craft({ + output = "default:chest_locked", + recipe = { + {tree.name.."_plank", tree.name.."_plank", tree.name.."_plank"}, + {tree.name.."_plank", "metals:"..metal.."_lock", tree.name.."_plank"}, + {tree.name.."_plank", tree.name.."_plank", tree.name.."_plank"}, + } + }) + end + + minetest.register_craft({ + output = tree.name.."_planks", + recipe = { + {tree.name.."_plank",tree.name.."_plank"}, + {tree.name.."_plank",tree.name.."_plank"} + } + }) + + minetest.register_craft({ + output = tree.name.."_plank 4", + recipe = {{tree.name.."_planks"}} + }) + + minetest.register_craft({ + type = "fuel", + recipe = tree.name.."_stair", + burntime = 3.5, + }) + realtest.add_bonfire_fuel(tree.name.."_stair") + + minetest.register_craft({ + type = "fuel", + recipe = tree.name.."_slab", + burntime = 3.5, + }) + realtest.add_bonfire_fuel(tree.name.."_slab") + + minetest.register_craft({ + type = "fuel", + recipe = tree.name.."_plank", + burntime = 2, + }) + realtest.add_bonfire_fuel(tree.name.."_plank") + + minetest.register_craft({ + type = "fuel", + recipe = tree.name.."_planks", + burntime = 7, + }) + realtest.add_bonfire_fuel(tree.name.."_planks") + + minetest.register_craft({ + type = "fuel", + recipe = tree.name.."_log", + burntime = 7, + }) + realtest.add_bonfire_fuel(tree.name.."_log") + + minetest.register_craft({ + type = "fuel", + recipe = tree.name.."_stick", + burntime = 1, + }) + realtest.add_bonfire_fuel(tree.name.."_stick") + + minetest.register_craft({ + type = "fuel", + recipe = tree.name.."_sapling", + burntime = 5, + }) + realtest.add_bonfire_fuel(tree.name.."_sapling") + + minetest.register_craft({ + type="cooking", + output="default:coal_lump", + recipe=tree.name.."_log", + }) + + minetest.register_abm({ + nodenames = {tree.name.."_sapling"}, + neighbors = tree.grounds, + interval = tree.grow_interval, + chance = tree.grow_chance, + action = function(pos, node) + if not minetest.env:get_node_light(pos) then + return + end + if minetest.env:get_node_light(pos) >= tree.grow_light then + trees.make_tree(pos, tree.name) + end + end, + }) +end + +realtest.register_tree("trees:ash", { + description = "Ash", + leaves = trees.gen_lists.ash, + height = function() + return 4 + math.random(4) + end, + textures = {{"trees_ash_trunk_top.png", "trees_ash_trunk_top.png", "trees_ash_trunk.png"},"trees_ash_leaves.png", + "trees_ash_planks.png", "trees_ash_stick.png", "trees_ash_sapling.png", "trees_ash_log.png", "trees_ash_plank.png", + "trees_ash_ladder.png"} +}) +realtest.register_tree("trees:aspen", { + description = "Aspen", + leaves = trees.gen_lists.aspen, + height = function() + return 10 + math.random(4) + end, + textures = {{"trees_aspen_trunk_top.png", "trees_aspen_trunk_top.png", "trees_aspen_trunk.png"},"trees_aspen_leaves.png", + "trees_aspen_planks.png", "trees_aspen_stick.png", "trees_aspen_sapling.png", "trees_aspen_log.png", "trees_aspen_plank.png", + "trees_aspen_ladder.png"} +}) +realtest.register_tree("trees:birch", { + description = "Birch", + leaves = trees.gen_lists.birch, + height = function() + return 10 + math.random(4) + end, + textures = {{"trees_birch_trunk_top.png", "trees_birch_trunk_top.png", "trees_birch_trunk.png"},"trees_birch_leaves.png", + "trees_birch_planks.png", "trees_birch_stick.png", "trees_birch_sapling.png", "trees_birch_log.png", "trees_birch_plank.png", + "trees_birch_ladder.png"} +}) +realtest.register_tree("trees:mapple", { + description = "Mapple", + leaves = trees.gen_lists.mapple, + height = function() + return 7 + math.random(5) + end, + textures = {{"trees_mapple_trunk_top.png", "trees_mapple_trunk_top.png", "trees_mapple_trunk.png"},"trees_mapple_leaves.png", + "trees_mapple_planks.png", "trees_mapple_stick.png", "trees_mapple_sapling.png", "trees_mapple_log.png", "trees_mapple_plank.png", + "trees_mapple_ladder.png"} +}) +realtest.register_tree("trees:chestnut", { + description = "Chestnut", + leaves = trees.gen_lists.chestnut, + height = function() + return 9 + math.random(2) + end, + radius = 10, + textures = {{"trees_chestnut_trunk_top.png", "trees_chestnut_trunk_top.png", "trees_chestnut_trunk.png"},"trees_chestnut_leaves.png", + "trees_chestnut_planks.png", "trees_chestnut_stick.png", "trees_chestnut_sapling.png", "trees_chestnut_log.png", + "trees_chestnut_plank.png", "trees_chestnut_ladder.png"} +}) +realtest.register_tree("trees:pine", { + description = "Pine", + leaves = trees.gen_lists.pine, + height = function() + return 13 + math.random(4) + end, + radius = 8, + textures = {{"trees_pine_trunk_top.png", "trees_pine_trunk_top.png", "trees_pine_trunk.png"},"trees_pine_leaves.png", + "trees_pine_planks.png", "trees_pine_stick.png", "trees_pine_sapling.png", "trees_pine_log.png", "trees_pine_plank.png", + "trees_pine_ladder.png"} +}) diff --git a/mods/trees/textures/trees_ash_ladder.png b/mods/trees/textures/trees_ash_ladder.png new file mode 100644 index 0000000..bb99bde Binary files /dev/null and b/mods/trees/textures/trees_ash_ladder.png differ diff --git a/mods/trees/textures/trees_ash_leaves.png b/mods/trees/textures/trees_ash_leaves.png new file mode 100644 index 0000000..647e389 Binary files /dev/null and b/mods/trees/textures/trees_ash_leaves.png differ diff --git a/mods/trees/textures/trees_ash_log.png b/mods/trees/textures/trees_ash_log.png new file mode 100644 index 0000000..f4b4245 Binary files /dev/null and b/mods/trees/textures/trees_ash_log.png differ diff --git a/mods/trees/textures/trees_ash_plank.png b/mods/trees/textures/trees_ash_plank.png new file mode 100644 index 0000000..09f783e Binary files /dev/null and b/mods/trees/textures/trees_ash_plank.png differ diff --git a/mods/trees/textures/trees_ash_planks.png b/mods/trees/textures/trees_ash_planks.png new file mode 100644 index 0000000..fdb8e9d Binary files /dev/null and b/mods/trees/textures/trees_ash_planks.png differ diff --git a/mods/trees/textures/trees_ash_sapling.png b/mods/trees/textures/trees_ash_sapling.png new file mode 100644 index 0000000..3591e44 Binary files /dev/null and b/mods/trees/textures/trees_ash_sapling.png differ diff --git a/mods/trees/textures/trees_ash_stick.png b/mods/trees/textures/trees_ash_stick.png new file mode 100644 index 0000000..5e26f53 Binary files /dev/null and b/mods/trees/textures/trees_ash_stick.png differ diff --git a/mods/trees/textures/trees_ash_trunk.png b/mods/trees/textures/trees_ash_trunk.png new file mode 100644 index 0000000..1dc00ee Binary files /dev/null and b/mods/trees/textures/trees_ash_trunk.png differ diff --git a/mods/trees/textures/trees_ash_trunk_top.png b/mods/trees/textures/trees_ash_trunk_top.png new file mode 100644 index 0000000..41661c8 Binary files /dev/null and b/mods/trees/textures/trees_ash_trunk_top.png differ diff --git a/mods/trees/textures/trees_aspen_ladder.png b/mods/trees/textures/trees_aspen_ladder.png new file mode 100644 index 0000000..5f4f55c Binary files /dev/null and b/mods/trees/textures/trees_aspen_ladder.png differ diff --git a/mods/trees/textures/trees_aspen_leaves.png b/mods/trees/textures/trees_aspen_leaves.png new file mode 100644 index 0000000..2c29dcb Binary files /dev/null and b/mods/trees/textures/trees_aspen_leaves.png differ diff --git a/mods/trees/textures/trees_aspen_log.png b/mods/trees/textures/trees_aspen_log.png new file mode 100644 index 0000000..704d208 Binary files /dev/null and b/mods/trees/textures/trees_aspen_log.png differ diff --git a/mods/trees/textures/trees_aspen_plank.png b/mods/trees/textures/trees_aspen_plank.png new file mode 100644 index 0000000..6435f1f Binary files /dev/null and b/mods/trees/textures/trees_aspen_plank.png differ diff --git a/mods/trees/textures/trees_aspen_planks.png b/mods/trees/textures/trees_aspen_planks.png new file mode 100644 index 0000000..0895c31 Binary files /dev/null and b/mods/trees/textures/trees_aspen_planks.png differ diff --git a/mods/trees/textures/trees_aspen_sapling.png b/mods/trees/textures/trees_aspen_sapling.png new file mode 100644 index 0000000..8788249 Binary files /dev/null and b/mods/trees/textures/trees_aspen_sapling.png differ diff --git a/mods/trees/textures/trees_aspen_stick.png b/mods/trees/textures/trees_aspen_stick.png new file mode 100644 index 0000000..6b5800c Binary files /dev/null and b/mods/trees/textures/trees_aspen_stick.png differ diff --git a/mods/trees/textures/trees_aspen_trunk.png b/mods/trees/textures/trees_aspen_trunk.png new file mode 100644 index 0000000..904d4fe Binary files /dev/null and b/mods/trees/textures/trees_aspen_trunk.png differ diff --git a/mods/trees/textures/trees_aspen_trunk_top.png b/mods/trees/textures/trees_aspen_trunk_top.png new file mode 100644 index 0000000..c3cea6d Binary files /dev/null and b/mods/trees/textures/trees_aspen_trunk_top.png differ diff --git a/mods/trees/textures/trees_birch_ladder.png b/mods/trees/textures/trees_birch_ladder.png new file mode 100644 index 0000000..0e0bfc6 Binary files /dev/null and b/mods/trees/textures/trees_birch_ladder.png differ diff --git a/mods/trees/textures/trees_birch_leaves.png b/mods/trees/textures/trees_birch_leaves.png new file mode 100644 index 0000000..0dfee2f Binary files /dev/null and b/mods/trees/textures/trees_birch_leaves.png differ diff --git a/mods/trees/textures/trees_birch_log.png b/mods/trees/textures/trees_birch_log.png new file mode 100644 index 0000000..a9e9ae3 Binary files /dev/null and b/mods/trees/textures/trees_birch_log.png differ diff --git a/mods/trees/textures/trees_birch_plank.png b/mods/trees/textures/trees_birch_plank.png new file mode 100644 index 0000000..0bad45c Binary files /dev/null and b/mods/trees/textures/trees_birch_plank.png differ diff --git a/mods/trees/textures/trees_birch_planks.png b/mods/trees/textures/trees_birch_planks.png new file mode 100644 index 0000000..e980ec4 Binary files /dev/null and b/mods/trees/textures/trees_birch_planks.png differ diff --git a/mods/trees/textures/trees_birch_sapling.png b/mods/trees/textures/trees_birch_sapling.png new file mode 100644 index 0000000..ed12360 Binary files /dev/null and b/mods/trees/textures/trees_birch_sapling.png differ diff --git a/mods/trees/textures/trees_birch_stick.png b/mods/trees/textures/trees_birch_stick.png new file mode 100644 index 0000000..9101ad9 Binary files /dev/null and b/mods/trees/textures/trees_birch_stick.png differ diff --git a/mods/trees/textures/trees_birch_trunk.png b/mods/trees/textures/trees_birch_trunk.png new file mode 100644 index 0000000..b2d7428 Binary files /dev/null and b/mods/trees/textures/trees_birch_trunk.png differ diff --git a/mods/trees/textures/trees_birch_trunk_top.png b/mods/trees/textures/trees_birch_trunk_top.png new file mode 100644 index 0000000..27dd5b7 Binary files /dev/null and b/mods/trees/textures/trees_birch_trunk_top.png differ diff --git a/mods/trees/textures/trees_chestnut_ladder.png b/mods/trees/textures/trees_chestnut_ladder.png new file mode 100644 index 0000000..8a83b33 Binary files /dev/null and b/mods/trees/textures/trees_chestnut_ladder.png differ diff --git a/mods/trees/textures/trees_chestnut_leaves.png b/mods/trees/textures/trees_chestnut_leaves.png new file mode 100644 index 0000000..69636ea Binary files /dev/null and b/mods/trees/textures/trees_chestnut_leaves.png differ diff --git a/mods/trees/textures/trees_chestnut_log.png b/mods/trees/textures/trees_chestnut_log.png new file mode 100644 index 0000000..0d1a34d Binary files /dev/null and b/mods/trees/textures/trees_chestnut_log.png differ diff --git a/mods/trees/textures/trees_chestnut_plank.png b/mods/trees/textures/trees_chestnut_plank.png new file mode 100644 index 0000000..76cca21 Binary files /dev/null and b/mods/trees/textures/trees_chestnut_plank.png differ diff --git a/mods/trees/textures/trees_chestnut_planks.png b/mods/trees/textures/trees_chestnut_planks.png new file mode 100644 index 0000000..731b798 Binary files /dev/null and b/mods/trees/textures/trees_chestnut_planks.png differ diff --git a/mods/trees/textures/trees_chestnut_sapling.png b/mods/trees/textures/trees_chestnut_sapling.png new file mode 100644 index 0000000..67db3ed Binary files /dev/null and b/mods/trees/textures/trees_chestnut_sapling.png differ diff --git a/mods/trees/textures/trees_chestnut_stick.png b/mods/trees/textures/trees_chestnut_stick.png new file mode 100644 index 0000000..fbf22eb Binary files /dev/null and b/mods/trees/textures/trees_chestnut_stick.png differ diff --git a/mods/trees/textures/trees_chestnut_trunk.png b/mods/trees/textures/trees_chestnut_trunk.png new file mode 100644 index 0000000..1965ffc Binary files /dev/null and b/mods/trees/textures/trees_chestnut_trunk.png differ diff --git a/mods/trees/textures/trees_chestnut_trunk_top.png b/mods/trees/textures/trees_chestnut_trunk_top.png new file mode 100644 index 0000000..e78148e Binary files /dev/null and b/mods/trees/textures/trees_chestnut_trunk_top.png differ diff --git a/mods/trees/textures/trees_mapple_ladder.png b/mods/trees/textures/trees_mapple_ladder.png new file mode 100644 index 0000000..30c95a6 Binary files /dev/null and b/mods/trees/textures/trees_mapple_ladder.png differ diff --git a/mods/trees/textures/trees_mapple_leaves.png b/mods/trees/textures/trees_mapple_leaves.png new file mode 100644 index 0000000..2446fe8 Binary files /dev/null and b/mods/trees/textures/trees_mapple_leaves.png differ diff --git a/mods/trees/textures/trees_mapple_log.png b/mods/trees/textures/trees_mapple_log.png new file mode 100644 index 0000000..2582adf Binary files /dev/null and b/mods/trees/textures/trees_mapple_log.png differ diff --git a/mods/trees/textures/trees_mapple_plank.png b/mods/trees/textures/trees_mapple_plank.png new file mode 100644 index 0000000..ae694b9 Binary files /dev/null and b/mods/trees/textures/trees_mapple_plank.png differ diff --git a/mods/trees/textures/trees_mapple_planks.png b/mods/trees/textures/trees_mapple_planks.png new file mode 100644 index 0000000..ddca83f Binary files /dev/null and b/mods/trees/textures/trees_mapple_planks.png differ diff --git a/mods/trees/textures/trees_mapple_sapling.png b/mods/trees/textures/trees_mapple_sapling.png new file mode 100644 index 0000000..6b20d09 Binary files /dev/null and b/mods/trees/textures/trees_mapple_sapling.png differ diff --git a/mods/trees/textures/trees_mapple_stick.png b/mods/trees/textures/trees_mapple_stick.png new file mode 100644 index 0000000..686fc78 Binary files /dev/null and b/mods/trees/textures/trees_mapple_stick.png differ diff --git a/mods/trees/textures/trees_mapple_trunk.png b/mods/trees/textures/trees_mapple_trunk.png new file mode 100644 index 0000000..be8ede7 Binary files /dev/null and b/mods/trees/textures/trees_mapple_trunk.png differ diff --git a/mods/trees/textures/trees_mapple_trunk_top.png b/mods/trees/textures/trees_mapple_trunk_top.png new file mode 100644 index 0000000..ba87b5a Binary files /dev/null and b/mods/trees/textures/trees_mapple_trunk_top.png differ diff --git a/mods/trees/textures/trees_pine_ladder.png b/mods/trees/textures/trees_pine_ladder.png new file mode 100644 index 0000000..be03c10 Binary files /dev/null and b/mods/trees/textures/trees_pine_ladder.png differ diff --git a/mods/trees/textures/trees_pine_leaves.png b/mods/trees/textures/trees_pine_leaves.png new file mode 100644 index 0000000..0856b73 Binary files /dev/null and b/mods/trees/textures/trees_pine_leaves.png differ diff --git a/mods/trees/textures/trees_pine_log.png b/mods/trees/textures/trees_pine_log.png new file mode 100644 index 0000000..40f7265 Binary files /dev/null and b/mods/trees/textures/trees_pine_log.png differ diff --git a/mods/trees/textures/trees_pine_plank.png b/mods/trees/textures/trees_pine_plank.png new file mode 100644 index 0000000..346eced Binary files /dev/null and b/mods/trees/textures/trees_pine_plank.png differ diff --git a/mods/trees/textures/trees_pine_planks.png b/mods/trees/textures/trees_pine_planks.png new file mode 100644 index 0000000..b2c731e Binary files /dev/null and b/mods/trees/textures/trees_pine_planks.png differ diff --git a/mods/trees/textures/trees_pine_sapling.png b/mods/trees/textures/trees_pine_sapling.png new file mode 100644 index 0000000..a5823b3 Binary files /dev/null and b/mods/trees/textures/trees_pine_sapling.png differ diff --git a/mods/trees/textures/trees_pine_stick.png b/mods/trees/textures/trees_pine_stick.png new file mode 100644 index 0000000..cf35e5d Binary files /dev/null and b/mods/trees/textures/trees_pine_stick.png differ diff --git a/mods/trees/textures/trees_pine_trunk.png b/mods/trees/textures/trees_pine_trunk.png new file mode 100644 index 0000000..b5094cd Binary files /dev/null and b/mods/trees/textures/trees_pine_trunk.png differ diff --git a/mods/trees/textures/trees_pine_trunk_top.png b/mods/trees/textures/trees_pine_trunk_top.png new file mode 100644 index 0000000..8ccd67d Binary files /dev/null and b/mods/trees/textures/trees_pine_trunk_top.png differ diff --git a/mods/trees/textures/trees_sequoia_ladder.png b/mods/trees/textures/trees_sequoia_ladder.png new file mode 100644 index 0000000..e62642c Binary files /dev/null and b/mods/trees/textures/trees_sequoia_ladder.png differ diff --git a/mods/trees/textures/trees_sequoia_leaves.png b/mods/trees/textures/trees_sequoia_leaves.png new file mode 100644 index 0000000..a339368 Binary files /dev/null and b/mods/trees/textures/trees_sequoia_leaves.png differ diff --git a/mods/trees/textures/trees_sequoia_log.png b/mods/trees/textures/trees_sequoia_log.png new file mode 100644 index 0000000..fa57563 Binary files /dev/null and b/mods/trees/textures/trees_sequoia_log.png differ diff --git a/mods/trees/textures/trees_sequoia_plank.png b/mods/trees/textures/trees_sequoia_plank.png new file mode 100644 index 0000000..41992e6 Binary files /dev/null and b/mods/trees/textures/trees_sequoia_plank.png differ diff --git a/mods/trees/textures/trees_sequoia_planks.png b/mods/trees/textures/trees_sequoia_planks.png new file mode 100644 index 0000000..817471b Binary files /dev/null and b/mods/trees/textures/trees_sequoia_planks.png differ diff --git a/mods/trees/textures/trees_sequoia_sapling.png b/mods/trees/textures/trees_sequoia_sapling.png new file mode 100644 index 0000000..4e1666e Binary files /dev/null and b/mods/trees/textures/trees_sequoia_sapling.png differ diff --git a/mods/trees/textures/trees_sequoia_stick.png b/mods/trees/textures/trees_sequoia_stick.png new file mode 100644 index 0000000..4c73f37 Binary files /dev/null and b/mods/trees/textures/trees_sequoia_stick.png differ diff --git a/mods/trees/textures/trees_sequoia_trunk.png b/mods/trees/textures/trees_sequoia_trunk.png new file mode 100644 index 0000000..fb9222a Binary files /dev/null and b/mods/trees/textures/trees_sequoia_trunk.png differ diff --git a/mods/trees/textures/trees_sequoia_trunk_top.png b/mods/trees/textures/trees_sequoia_trunk_top.png new file mode 100644 index 0000000..8a0be48 Binary files /dev/null and b/mods/trees/textures/trees_sequoia_trunk_top.png differ