Merge pull request #1 from sda97ghb/trees

Trees
This commit is contained in:
Oleg Matveev 2012-11-29 02:56:17 -08:00
commit 9be38954d4
159 changed files with 2466 additions and 981 deletions

View File

@ -25,7 +25,7 @@ function realtest.register_anvil_recipe(RecipeDef)
end end
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 for i, metal in ipairs(metals.list) do
realtest.register_anvil_recipe({ realtest.register_anvil_recipe({
item1 = "metals:"..metal.."_unshaped", item1 = "metals:"..metal.."_unshaped",
@ -57,12 +57,19 @@ for i, metal in ipairs(metals.list) do
output = "metals:"..metal.."_doublesheet", output = "metals:"..metal.."_doublesheet",
level = metals.levels[i] - 1, 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 end
--Pig iron --> Wrought iron --Pig iron --> Wrought iron
realtest.register_anvil_recipe({ realtest.register_anvil_recipe({
item1 = "metals:pig_iron_ingot", item1 = "metals:pig_iron_ingot",
output = "metals:wrought_iron_ingot", output = "metals:wrought_iron_ingot",
level = 3, level = 2,
}) })
--Instruments --Instruments
local instruments = local instruments =
@ -99,7 +106,7 @@ local anvils = {
} }
minetest.register_craft({ minetest.register_craft({
output = 'anvil:stone_anvil', output = 'anvil:anvil_stone',
recipe = { recipe = {
{'default:stone','default:stone','default:stone'}, {'default:stone','default:stone','default:stone'},
{'','default:stone',''}, {'','default:stone',''},
@ -110,7 +117,7 @@ minetest.register_craft({
for _, anvil in ipairs(anvils) do for _, anvil in ipairs(anvils) do
if anvil[1] ~= "stone" then if anvil[1] ~= "stone" then
minetest.register_craft({ minetest.register_craft({
output = "anvil:"..anvil[1].."_anvil", output = "anvil:anvil_"..anvil[1],
recipe = { recipe = {
{"metals:"..anvil[1].."_doubleingot","metals:"..anvil[1].."_doubleingot","metals:"..anvil[1].."_doubleingot"}, {"metals:"..anvil[1].."_doubleingot","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 end
for _, anvil in ipairs(anvils) do for _, anvil in ipairs(anvils) do
minetest.register_node("anvil:"..anvil[1].."_anvil", { minetest.register_node("anvil:anvil_"..anvil[1], {
description = anvil[2] .. " Anvil", description = anvil[2] .. " Anvil",
tiles = {"anvil_"..anvil[1].."_top.png","anvil_"..anvil[1].."_top.png","anvil_"..anvil[1].."_side.png"}, tiles = {"anvil_"..anvil[1].."_top.png","anvil_"..anvil[1].."_top.png","anvil_"..anvil[1].."_side.png"},
drawtype = "nodebox", drawtype = "nodebox",
@ -145,7 +152,7 @@ for _, anvil in ipairs(anvils) do
{-0.35,-0.1,-0.2,0.35,0.1,0.2}, {-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(), sounds = default.node_sound_stone_defaults(),
can_dig = function(pos,player) can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos); 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 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 if recipe.type == "forge" and recipe.item1 == src1:get_name() and recipe.item2 == src2:get_name() and
anvil[3] >= recipe.level 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 inv:room_for_item("output", recipe.output) then
if recipe.rmitem1 then if recipe.rmitem1 then
src1:take_item() src1:take_item()

View File

@ -8,6 +8,23 @@ bonfire.formspec =
"list[current_name;dst;5,1;2,1;]".. "list[current_name;dst;5,1;2,1;]"..
"list[current_player;main;0,5;8,4;]" "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", { minetest.register_node("bonfire:self", {
description = "Bonfire", description = "Bonfire",
tiles = {"bonfire_top.png", "bonfire_bottom.png", "bonfire_side.png"}, tiles = {"bonfire_top.png", "bonfire_bottom.png", "bonfire_side.png"},
@ -170,6 +187,9 @@ minetest.register_abm({
end end
if fuellist then if fuellist then
fuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) 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 end
if fuel.time <= 0 then if fuel.time <= 0 then

View File

@ -73,10 +73,9 @@ creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
pagenum = math.floor(pagenum) pagenum = math.floor(pagenum)
local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1) local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1)
player:set_inventory_formspec("size[13,7.5]".. 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;main;5,3.5;8,4;]"..
"list[current_player;craft;8,0;3,3;]".. "list[current_player;craft;7,0;3,3;]"..
"list[current_player;craftpreview;12,1;1,1;]".. "list[current_player;craftpreview;11,1;1,1;]"..
"list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]".. "list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]"..
"label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]".. "label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]"..
"button[0.3,6.5;1.6,1;creative_prev;<<]".. "button[0.3,6.5;1.6,1;creative_prev;<<]"..

View File

@ -1 +1,2 @@
default default
trees

View File

@ -7,7 +7,8 @@ minetest.register_node("decorations:malachite_block", {
tiles = {"decorations_malachite.png"}, tiles = {"decorations_malachite.png"},
particle_image = {"minerals_malachite.png"}, particle_image = {"minerals_malachite.png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=3}, drop = "minerals:malachite 4",
groups = {cracky=3,drop_on_dig=1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -32,7 +33,9 @@ minetest.register_node("decorations:malachite_pyramid", {
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("decorations:malachite_table", { 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", description = "Malachite Table",
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
@ -52,11 +55,20 @@ minetest.register_node("decorations:malachite_table", {
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5}, {-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"}, tiles = {"decorations_malachite.png", tree.textures[3].."^decorations_malachite_table_bottom.png",
is_ground_content = true, tree.textures[3].."^decorations_malachite_table_side.png"},
groups = {cracky=3, oddly_breakable_by_hand = 2}, groups = {cracky=3, oddly_breakable_by_hand = 2},
sounds = default.node_sound_stone_defaults(), 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", { minetest.register_node("decorations:casket", {
description = "Casket", description = "Casket",
@ -85,7 +97,7 @@ minetest.register_node("decorations:casket", {
local meta = minetest.env:get_meta(pos) local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", meta:set_string("formspec",
"size[8,8]".. "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;]") "list[current_player;main;0,4;8,4;]")
meta:set_string("infotext", "Casket") meta:set_string("infotext", "Casket")
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -173,6 +185,24 @@ minetest.register_node("decorations:malachite_vase", {
sounds = default.node_sound_stone_defaults(), 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------ ------CRAFT RECIPES------
minetest.register_craft({ minetest.register_craft({
@ -199,12 +229,6 @@ minetest.register_craft({
{"minerals:malachite","minerals:malachite"}, {"minerals:malachite","minerals:malachite"},
} }
}) })
minetest.register_craft({
output = "minerals:malachite 4",
recipe = {
{"decorations:malachite_block"},
}
})
minetest.register_craft({ minetest.register_craft({
output = "decorations:malachite_pyramid", 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({ minetest.register_craft({
output = "decorations:malachite_cylinder", output = "decorations:malachite_cylinder",
recipe = { recipe = {

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

View File

@ -14,7 +14,6 @@ realtest = {}
-- Load other files -- Load other files
dofile(minetest.get_modpath("default").."/mapgen.lua") dofile(minetest.get_modpath("default").."/mapgen.lua")
dofile(minetest.get_modpath("default").."/leafdecay.lua")
-- --
-- Tool definition -- Tool definition
@ -42,95 +41,42 @@ minetest.register_item(":", {
-- --
minetest.register_craft({ minetest.register_craft({
output = 'default:fence_wood 2', output = "default:sandstone",
recipe = { recipe = {
{'default:stick', 'default:stick', 'default:stick'}, {"default:sand", "default:sand"},
{'default:stick', 'default:stick', 'default:stick'}, {"default:sand", "default:sand"},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = 'default:sign_wall', output = "default:clay",
recipe = { recipe = {
{'default:wood', 'default:wood', 'default:wood'}, {"default:clay_lump", "default:clay_lump"},
{'default:wood', 'default:wood', 'default:wood'}, {"default:clay_lump", "default:clay_lump"},
{'', 'default:stick', ''},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = 'default:chest', output = "default:brick",
recipe = { recipe = {
{'default:wood', 'default:wood', 'default:wood'}, {"default:clay_brick", "default:clay_brick"},
{'default:wood', '', 'default:wood'}, {"default:clay_brick", "default:clay_brick"},
{'default:wood', 'default:wood', 'default:wood'},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = 'default:chest_locked', output = "default:paper",
recipe = { recipe = {
{'default:wood', 'default:wood', 'default:wood'}, {"default:papyrus", "default:papyrus", "default:papyrus"},
{'default:wood', 'default:cobble', 'default:wood'},
{'default:wood', 'default:wood', 'default:wood'},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = 'default:sandstone', output = "default:book",
recipe = { recipe = {
{'default:sand', 'default:sand'}, {"default:paper"},
{'default:sand', 'default:sand'}, {"default:paper"},
} {"default:paper"},
})
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'},
} }
}) })
@ -168,18 +114,6 @@ minetest.register_craft({
-- Fuels -- Fuels
-- --
minetest.register_craft({
type = "fuel",
recipe = "default:tree",
burntime = 20,
})
minetest.register_craft({
type = "fuel",
recipe = "default:leaves",
burntime = 3,
})
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",
recipe = "default:cactus", recipe = "default:cactus",
@ -204,24 +138,12 @@ minetest.register_craft({
burntime = 15, burntime = 15,
}) })
minetest.register_craft({
type = "fuel",
recipe = "default:stick",
burntime = 1,
})
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",
recipe = "default:ladder", recipe = "default:ladder",
burntime = 15, burntime = 15,
}) })
minetest.register_craft({
type = "fuel",
recipe = "default:wood",
burntime = 7,
})
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",
recipe = "default:torch", recipe = "default:torch",
@ -246,18 +168,6 @@ minetest.register_craft({
burntime = 40, 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({ minetest.register_craft({
type = "fuel", type = "fuel",
recipe = "default:coal_lump", recipe = "default:coal_lump",
@ -346,23 +256,23 @@ minetest.register_node("default:stone", {
tiles = {"default_stone.png"}, tiles = {"default_stone.png"},
particle_image = {"default_cobble.png"}, particle_image = {"default_cobble.png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=3}, groups = {cracky=3,drop_on_dig=1},
drop = { drop = {
max_items = 1, max_items = 1,
items = { items = {
{ {
items = {'default:cobble', 'minerals:borax'}, items = {"default:cobble", "minerals:borax"},
rarity = 50, rarity = 50,
}, },
{ {
items = {'default:cobble', 'default:cobble', 'default:cobble'}, items = {"default:cobble", "default:cobble", "default:cobble"},
rarity = 5 rarity = 5
}, },
{ {
items = {'default:cobble', 'default:cobble'} items = {"default:cobble", "default:cobble"}
}, },
{ {
items = {'default:cobble 1'}, items = {"default:cobble"},
rarity = 5 rarity = 5
}, },
}, },
@ -375,8 +285,7 @@ minetest.register_node("default:desert_stone", {
tiles = {"default_desert_stone.png"}, tiles = {"default_desert_stone.png"},
particle_image = {"default_desert_stone.png"}, particle_image = {"default_desert_stone.png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=3}, groups = {cracky=3,drop_on_dig=1},
drop = 'default:desert_stone',
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -385,7 +294,7 @@ minetest.register_node("default:stone_flat", {
tiles = {"default_stone_flat.png"}, tiles = {"default_stone_flat.png"},
particle_image = {"default_stone_flat.png"}, particle_image = {"default_stone_flat.png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=3}, groups = {cracky=3,drop_on_dig=1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -394,7 +303,7 @@ minetest.register_node("default:desert_stone_flat", {
tiles = {"default_desert_stone_flat.png"}, tiles = {"default_desert_stone_flat.png"},
particle_image = {"default_desert_stone_flat.png"}, particle_image = {"default_desert_stone_flat.png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=3}, groups = {cracky=3,drop_on_dig=1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -403,7 +312,7 @@ minetest.register_node("default:cobbleblock_flat", {
tiles = {"default_cobbleblock_flat.png"}, tiles = {"default_cobbleblock_flat.png"},
particle_image = {"default_cobble.png"}, particle_image = {"default_cobble.png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=3}, groups = {cracky=3,drop_on_dig=1},
sounds = default.node_sound_stone_defaults(), 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"}, tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
particle_image = {"default_dirt.png"}, particle_image = {"default_dirt.png"},
is_ground_content = true, is_ground_content = true,
groups = {crumbly=3}, groups = {crumbly=3,drop_on_dig=1},
drop = 'default:dirt', drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, footstep = {name="default_grass_footstep", gain=0.4},
}), }),
@ -424,7 +333,7 @@ minetest.register_node("default:dirt", {
tiles = {"default_dirt.png"}, tiles = {"default_dirt.png"},
particle_image = {"default_dirt.png"}, particle_image = {"default_dirt.png"},
is_ground_content = true, is_ground_content = true,
groups = {crumbly=3}, groups = {crumbly=3,drop_on_dig=1, falling_node=1},
sounds = default.node_sound_dirt_defaults(), sounds = default.node_sound_dirt_defaults(),
}) })
@ -433,7 +342,7 @@ minetest.register_node("default:sand", {
tiles = {"default_sand.png"}, tiles = {"default_sand.png"},
particle_image = {"default_sand.png"}, particle_image = {"default_sand.png"},
is_ground_content = true, 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(), sounds = default.node_sound_sand_defaults(),
}) })
@ -442,7 +351,7 @@ minetest.register_node("default:desert_sand", {
tiles = {"default_desert_sand.png"}, tiles = {"default_desert_sand.png"},
particle_image = {"default_desert_sand.png"}, particle_image = {"default_desert_sand.png"},
is_ground_content = true, 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(), sounds = default.node_sound_sand_defaults(),
}) })
@ -451,7 +360,7 @@ minetest.register_node("default:gravel", {
tiles = {"default_gravel.png"}, tiles = {"default_gravel.png"},
particle_image = {"default_gravel.png"}, particle_image = {"default_gravel.png"},
is_ground_content = true, 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({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.45}, footstep = {name="default_gravel_footstep", gain=0.45},
}), }),
@ -462,8 +371,8 @@ minetest.register_node("default:sandstone", {
tiles = {"default_sandstone.png"}, tiles = {"default_sandstone.png"},
particle_image = {"default_sandstone.png"}, particle_image = {"default_sandstone.png"},
is_ground_content = true, is_ground_content = true,
groups = {crumbly=2,cracky=2}, groups = {crumbly=2,cracky=2,drop_on_dig=1},
drop = 'default:sand', drop = "default:sand",
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -472,8 +381,8 @@ minetest.register_node("default:sand_with_clay", {
tiles = {"default_sand.png^default_clay.png"}, tiles = {"default_sand.png^default_clay.png"},
particle_image = {"default_clay_lump.png"}, particle_image = {"default_clay_lump.png"},
is_ground_content = true, is_ground_content = true,
groups = {crumbly=3}, groups = {crumbly=3,drop_on_dig=1},
drop = 'default:clay_lump 4', drop = "default:clay_lump 4",
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
footstep = "", footstep = "",
}), }),
@ -484,8 +393,8 @@ minetest.register_node("default:dirt_with_clay", {
tiles = {"default_dirt.png^default_clay.png"}, tiles = {"default_dirt.png^default_clay.png"},
particle_image = {"default_clay_lump.png"}, particle_image = {"default_clay_lump.png"},
is_ground_content = true, is_ground_content = true,
groups = {crumbly=3}, groups = {crumbly=3, drop_on_dig=1},
drop = 'default:clay_lump 4', drop = "default:clay_lump 4",
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
footstep = "", 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"}, 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"}, particle_image = {"default_clay_lump.png"},
is_ground_content = true, is_ground_content = true,
groups = {crumbly=3}, groups = {crumbly=3, drop_on_dig=1},
drop = 'default:clay_lump 4', drop = "default:clay_lump 4",
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
footstep = "", footstep = "",
}), }),
@ -509,50 +418,15 @@ minetest.register_node("default:brick", {
tiles = {"default_brick.png"}, tiles = {"default_brick.png"},
particle_image = {"default_clay_brick.png"}, particle_image = {"default_clay_brick.png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=3}, groups = {cracky=3,drop_on_dig=1},
drop = 'default:clay_brick 4', drop = "default:clay_brick 4",
sounds = default.node_sound_stone_defaults(), 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", { minetest.register_node("default:cactus", {
description = "Cactus", description = "Cactus",
tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"}, 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", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
node_box = { node_box = {
@ -567,7 +441,6 @@ minetest.register_node("default:cactus", {
{-0.4, -0.5, -0.4, 0.4, 0.5, 0.4}, {-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(), sounds = default.node_sound_wood_defaults(),
}) })
@ -581,18 +454,10 @@ minetest.register_node("default:papyrus", {
paramtype = "light", paramtype = "light",
is_ground_content = true, is_ground_content = true,
walkable = false, 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(), 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", { minetest.register_node("default:glass", {
description = "Glass", description = "Glass",
drawtype = "glasslike", drawtype = "glasslike",
@ -606,23 +471,6 @@ minetest.register_node("default:glass", {
sounds = default.node_sound_glass_defaults(), 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", { minetest.register_node("default:rail", {
description = "Rail", description = "Rail",
drawtype = "raillike", drawtype = "raillike",
@ -641,37 +489,6 @@ minetest.register_node("default:rail", {
groups = {bendy=2,snappy=1,dig_immediate=2}, 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 = = <default>
--wall_bottom = = <default>
--wall_side = = <default>
},
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", { minetest.register_node("default:water_flowing", {
description = "Flowing Water", description = "Flowing Water",
inventory_image = minetest.inventorycube("default_water.png"), 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.. print((sender:get_player_name() or "").." wrote \""..fields.text..
"\" to sign at "..minetest.pos_to_string(pos)) "\" to sign at "..minetest.pos_to_string(pos))
meta:set_string("text", fields.text) meta:set_string("text", fields.text)
meta:set_string("infotext", '"'..fields.text..'"') meta:set_string("infotext", "\""..fields.text.."\"")
end, end,
}) })
@ -962,7 +779,7 @@ minetest.register_node("default:cobbleblock", {
particle_image = {"default_cobble.png"}, particle_image = {"default_cobble.png"},
is_ground_content = true, is_ground_content = true,
drop = "default:cobble 9", 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(), sounds = default.node_sound_stone_defaults(),
}) })
@ -971,6 +788,25 @@ minetest.register_craftitem("default:cobble", {
inventory_image = "default_cobble.png", 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({ minetest.register_craft({
output = "default:cobbleblock", output = "default:cobbleblock",
recipe = { recipe = {
@ -980,34 +816,6 @@ minetest.register_craft({
}, },
}) })
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", { minetest.register_node("default:dry_shrub", {
description = "Dry Shrub", description = "Dry Shrub",
drawtype = "plantlike", drawtype = "plantlike",
@ -1030,11 +838,6 @@ minetest.register_node("default:dry_shrub", {
-- Crafting items -- Crafting items
-- --
minetest.register_craftitem("default:stick", {
description = "Stick",
inventory_image = "default_stick.png",
})
minetest.register_craftitem("default:paper", { minetest.register_craftitem("default:paper", {
description = "Paper", description = "Paper",
inventory_image = "default_paper.png", inventory_image = "default_paper.png",
@ -1060,11 +863,6 @@ minetest.register_craftitem("default:clay_brick", {
inventory_image = "default_clay_brick.png", inventory_image = "default_clay_brick.png",
}) })
minetest.register_craftitem("default:scorched_stuff", {
description = "Scorched Stuff",
inventory_image = "default_scorched_stuff.png",
})
-- --
-- Falling stuff -- Falling stuff
-- --
@ -1123,10 +921,10 @@ minetest.register_entity("default:falling_node", {
if minetest.registered_nodes[bcn.name] and if minetest.registered_nodes[bcn.name] and
minetest.registered_nodes[bcn.name].walkable then minetest.registered_nodes[bcn.name].walkable then
local np = {x=bcp.x, y=bcp.y+1, z=bcp.z} 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) local n2 = minetest.env:get_node(np)
-- If it's not air or liquid, remove node and replace it with -- If it"s not air or liquid, remove node and replace it with
-- it's drops -- it"s drops
if n2.name ~= "air" and (not minetest.registered_nodes[n2.name] or if n2.name ~= "air" and (not minetest.registered_nodes[n2.name] or
minetest.registered_nodes[n2.name].liquidtype == "none") then minetest.registered_nodes[n2.name].liquidtype == "none") then
local drops = minetest.get_node_drops(n2.name, "") local drops = minetest.get_node_drops(n2.name, "")
@ -1157,11 +955,11 @@ function default.spawn_falling_node(p, nodename)
end end
-- Horrible crap to support old code -- Horrible crap to support old code
-- Don't use this and never do what this does, it's completely wrong! -- 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) -- (More specifically, the client and the C++ code doesn"t get the group)
function default.register_falling_node(nodename, texture) function default.register_falling_node(nodename, texture)
minetest.log("error", debug.traceback()) 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 if minetest.registered_nodes[nodename] then
minetest.registered_nodes[nodename].groups.falling_node = 1 minetest.registered_nodes[nodename].groups.falling_node = 1
end end
@ -1188,8 +986,18 @@ function nodeupdate_single(p)
p_bottom = {x=p.x, y=p.y-1, z=p.z} p_bottom = {x=p.x, y=p.y-1, z=p.z}
n_bottom = minetest.env:get_node(p_bottom) n_bottom = minetest.env:get_node(p_bottom)
if not minetest.registered_nodes[n_bottom.name].walkable and n_bottom.name ~= n.name then if not minetest.registered_nodes[n_bottom.name].walkable and n_bottom.name ~= n.name then
if not minetest.registered_nodes[n.name].drop_on_dropping then
minetest.env:dig_node(p)
else
minetest.env:remove_node(p) minetest.env:remove_node(p)
minetest.env:add_item(p, n.name) 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) nodeupdate(p)
end end
end end
@ -1253,6 +1061,18 @@ minetest.register_on_dignode(function(pos, oldnode, digger)
end end
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({ minetest.register_abm({
nodenames = {"default:dirt_with_clay"}, nodenames = {"default:dirt_with_clay"},
interval = 2, interval = 2,
@ -1283,7 +1103,7 @@ minetest.register_abm({
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:dirt_with_grass_and_clay"}, nodenames = {"default:dirt_with_grass_and_clay"},
interval = 2, interval = 2,
chance = 20, chance = 200,
action = function(pos, node) action = function(pos, node)
pos.y = pos.y+1 pos.y = pos.y+1
local n = minetest.registered_nodes[minetest.env:get_node(pos).name] local n = minetest.registered_nodes[minetest.env:get_node(pos).name]

View File

@ -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
})

View File

@ -6,8 +6,6 @@
minetest.register_alias("mapgen_air", "air") minetest.register_alias("mapgen_air", "air")
minetest.register_alias("mapgen_stone", "default:stone") 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_apple", "default:apple")
minetest.register_alias("mapgen_water_source", "default:water_source") minetest.register_alias("mapgen_water_source", "default:water_source")
minetest.register_alias("mapgen_dirt", "default:dirt") 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_cobble", "default:cobble")
minetest.register_alias("mapgen_mossycobble", "default:mossycobble") minetest.register_alias("mapgen_mossycobble", "default:mossycobble")
minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass") 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_sand", "default:desert_sand")
minetest.register_alias("mapgen_desert_stone", "default:desert_stone") 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) function default.make_papyrus(pos, size)
for y=0,size-1 do for y=0,size-1 do
@ -121,7 +120,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
end end
if ground_y and minetest.env:get_node({x=x,y=ground_y,z=z}).name == "default:dirt_with_grass" then 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 end
end end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B

View File

@ -133,8 +133,8 @@ dyelocal = nil
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = 'dye:dark_green', output = "dye:dark_green 4",
recipe = {'default:cactus'}, recipe = {"default:cactus"},
}) })
-- EOF -- EOF

View File

@ -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}} 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 for n = 1,#furnace_blocks do
local v = furnace_blocks[n] 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 return false
end end
end end

View File

@ -33,9 +33,10 @@ function string:capitalize()
return self:sub(1,1):upper()..self:sub(2):lower() return self:sub(1,1):upper()..self:sub(2):lower()
end end
function minetest.get_item_group(name, group) function string:remove_modname_prefix()
if not minetest.registered_items[name] or not minetest.registered_items[name].groups[group] then local i = self:find(":")
return 0 if i then
return self:sub(i+1)
end end
return minetest.registered_items[name].groups[group] return nil
end end

View File

@ -1,11 +1,19 @@
for i = 1,4 do for i = 1,4 do
minetest.register_node("icicles:icicle_"..i, { minetest.register_node("icicles:icicle_"..i, {
description = "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"}, tiles = {"default_stone.png"},
is_ground_content = true, is_ground_content = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
drop = "", drop = {
max_items = 1,
items = {
{
items = {"default:cobble"},
rarity = 5 - i,
},
},
},
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
node_box = { node_box = {

View File

@ -1,21 +1,18 @@
buckets = {} buckets = {}
buckets.liquids = {} buckets.liquids = {}
function buckets.register_liquid(name, source, flowing, itemname, inventory_image) realtest.registered_liquids = {}
function realtest.register_liquid(name, LiquidDef)
buckets.liquids[source] = { if name and LiquidDef.source and LiquidDef.flowing and (LiquidDef.image_for_metal_bucket or LiquidDef.image_for_wood_bucket) then
name = name, LiquidDef.name = name
source = source, realtest.registered_liquids[LiquidDef.source] = LiquidDef
flowing = flowing, realtest.registered_liquids[LiquidDef.flowing] = LiquidDef
itemname = itemname, end
} if LiquidDef.image_for_metal_bucket then
buckets.liquids[flowing] = buckets.liquids[source] for i, metal in ipairs(metals.list) do
minetest.register_craftitem("instruments:bucket_"..metal.."_with_"..LiquidDef.name, {
if itemname ~= nil then description = metals.desc_list[i] .. " Bucket with " .. LiquidDef.description,
for i = 1,#metals.list do inventory_image = "instruments_bucket_"..metal..".png^"..LiquidDef.image_for_metal_bucket,
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,
stack_max = 1, stack_max = 1,
liquids_pointable = true, liquids_pointable = true,
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
@ -25,26 +22,55 @@ function buckets.register_liquid(name, source, flowing, itemname, inventory_imag
end end
n = minetest.env:get_node(pointed_thing.under) n = minetest.env:get_node(pointed_thing.under)
if minetest.registered_nodes[n.name].buildable_to then 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 else
n = minetest.env:get_node(pointed_thing.above) n = minetest.env:get_node(pointed_thing.above)
if minetest.registered_nodes[n.name].buildable_to then 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 else
return return
end end
end end
return {name="instruments:bucket_empty_"..metals.list[i]} return {name="instruments:bucket_"..metal}
end end
}) })
end 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 end
for i = 1,#metals.list do for i, metal in ipairs(metals.list) do
minetest.register_craftitem("instruments:bucket_empty_"..metals.list[i], { minetest.register_craftitem("instruments:bucket_"..metal, {
description = "Empty " .. metals.desc_list[i] .. " Bucket", description = "Empty " .. metals.desc_list[i] .. " Bucket",
inventory_image = "instruments_bucket_"..metals.list[i]..".png", inventory_image = "instruments_bucket_"..metal..".png",
stack_max = 1, stack_max = 1,
liquids_pointable = true, liquids_pointable = true,
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
@ -54,27 +80,58 @@ for i = 1,#metals.list do
end end
-- Check if pointing to a liquid source -- Check if pointing to a liquid source
n = minetest.env:get_node(pointed_thing.under) n = minetest.env:get_node(pointed_thing.under)
liquiddef = buckets.liquids[n.name] liquiddef = realtest.registered_liquids[n.name]
if liquiddef ~= nil and liquiddef.source == n.name and liquiddef.itemname ~= nil then if liquiddef then
minetest.env:add_node(pointed_thing.under, {name="air"}) minetest.env:add_node(pointed_thing.under, {name="air"})
return {name=liquiddef.itemname.."_"..metals.list[i]} return {name="instruments:bucket_"..wood}
end end
end, end,
}) })
end end
buckets.register_liquid( for i, tree in pairs(realtest.registered_trees) do
"Water", local wood = tree.name:remove_modname_prefix()
"default:water_source", minetest.register_craftitem("instruments:bucket_"..wood, {
"default:water_flowing", description = "Empty " .. tree.description .. " Bucket",
"instruments:bucket_water", inventory_image = "instruments_bucket_wood.png",
"instruments_water.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.."_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
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"
)

View File

@ -1,3 +1,4 @@
default default
metals metals
helper_functions helper_functions
trees

View File

@ -82,7 +82,7 @@ instruments.spear.entity.on_step = function(self, dtime)
if obj:get_hp()<=0 then if obj:get_hp()<=0 then
obj:remove() obj:remove()
end 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() self.object:remove()
end end
end end
@ -90,7 +90,7 @@ instruments.spear.entity.on_step = function(self, dtime)
if self.lastpos.x~=nil then if self.lastpos.x~=nil then
if node.name ~= "air" 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() self.object:remove()
end end
end end
@ -116,7 +116,7 @@ for i, material in ipairs(instruments.materials) do
obj:get_luaentity().material = material obj:get_luaentity().material = material
return "" return ""
end, 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) --Chisels (stone chisels are not exist)
if material ~= "stone" then if material ~= "stone" then
@ -139,7 +139,7 @@ for i, material in ipairs(instruments.materials) do
item:add_wear(65535/instruments.durability[i]) item:add_wear(65535/instruments.durability[i])
return item return item
end, end,
groups = {material_level=instruments.levels[i], durability=instruments.durability[i]}, groups = {material_level=instruments.levels[i], durability=instruments.durability[i], chisel=1},
}) })
end end
--Heads --Heads
@ -159,7 +159,7 @@ for i, material in ipairs(instruments.materials) do
output = "instruments:"..instrument.."_"..material, output = "instruments:"..instrument.."_"..material,
recipe = { recipe = {
{"instruments:"..instrument.."_"..material.."_head"}, {"instruments:"..instrument.."_"..material.."_head"},
{'default:stick'}, {"group:stick"},
}, },
}) })
end end
@ -175,7 +175,7 @@ for i, material in ipairs(instruments.materials) do
max_drop_level=1, max_drop_level=1,
groupcaps=instruments.groupcaps[j][i], 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
end end
@ -185,7 +185,7 @@ minetest.register_craft({
output = "instruments:spear_stone", output = "instruments:spear_stone",
recipe = { recipe = {
{"default:cobble", "", ""}, {"default:cobble", "", ""},
{"", "default:stick", ""}, {"", "group:stick", ""},
{"","","default:stick"}, {"","","group:stick"},
}, },
}) })

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

View File

Before

Width:  |  Height:  |  Size: 436 B

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

View File

@ -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 <sam@hocevar.net>
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.

View File

@ -1,7 +1,7 @@
--Mod by PilzAdam --Mod by PilzAdam
function minetest.handle_node_drops(pos, drops, digger) function minetest.handle_node_drops(pos, drops, digger)
for _,item in ipairs(drops) do local function drop(item)
local count, name local count, name
if type(item) == "string" then if type(item) == "string" then
count = 1 count = 1
@ -30,4 +30,20 @@ function minetest.handle_node_drops(pos, drops, digger)
end end
end 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 end

View File

@ -94,6 +94,11 @@ for i=1, #metals.list do
inventory_image = "metals_ceramic_mold.png^metals_"..metals.list[i].."_ingot.png", 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 -- Nodes
-- --
@ -103,7 +108,8 @@ for i=1, #metals.list do
tiles = {"metals_"..metals.list[i].."_block.png"}, tiles = {"metals_"..metals.list[i].."_block.png"},
particle_image = {"metals_"..metals.list[i].."_block.png"}, particle_image = {"metals_"..metals.list[i].."_block.png"},
is_ground_content = true, 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(), sounds = default.node_sound_stone_defaults(),
}) })
@ -114,13 +120,13 @@ for i=1, #metals.list do
minetest.register_craft({ minetest.register_craft({
output = "metals:"..metals.list[i].."_block", output = "metals:"..metals.list[i].."_block",
recipe = { recipe = {
{"metals:"..metals.list[i].."_ingot", "metals:"..metals.list[i].."_ingot"}, {"metals:"..metals.list[i].."_doubleingot", "metals:"..metals.list[i].."_doubleingot"},
{"metals:"..metals.list[i].."_ingot", "metals:"..metals.list[i].."_ingot"}, {"metals:"..metals.list[i].."_doubleingot", "metals:"..metals.list[i].."_doubleingot"},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "metals:"..metals.list[i].."_ingot 4", output = "metals:"..metals.list[i].."_doubleingot 4",
recipe = { recipe = {
{"metals:"..metals.list[i].."_block"}, {"metals:"..metals.list[i].."_block"},
} }
@ -135,12 +141,9 @@ for i=1, #metals.list do
}) })
minetest.register_craft({ minetest.register_craft({
output = 'sawing_table:self', output = "metals:"..metals.list[i].."_ingot",
recipe = { recipe = {{"metals:ceramic_mold_"..metals.list[i]}},
{'default:tree',"metals:"..metals.list[i].."_ingot",'default:tree'}, replacements = {{"metals:ceramic_mold_"..metals.list[i], "metals:ceramic_mold"}},
{'default:tree','','default:tree'},
{'default:tree',"metals:"..metals.list[i].."_ingot",'default:tree'},
}
}) })
-- --
@ -182,7 +185,9 @@ minetest.register_craft({
recipe = "metals:clay_mold", recipe = "metals:clay_mold",
}) })
MINERALS_LIST={ minerals = {}
minerals.list = {
'magnetite', 'magnetite',
'hematite', 'hematite',
'limonite', 'limonite',
@ -200,25 +205,25 @@ MINERALS_LIST={
'bauxite', 'bauxite',
} }
MINERALS_DESC_LIST={ minerals.desc_list = {
'magnetite', 'Magnetite',
'hematite', 'Hematite',
'limonite', 'Limonite',
'bismuthinite', 'Bismuthinite',
'cassiterite', 'Cassiterite',
'galena', 'Galena',
'malachite', 'Malachite',
'native copper', 'Native Copper',
'native gold', 'Native Gold',
'native platinum', 'Native Platinum',
'native silver', 'Native Silver',
'sphalerite', 'Sphalerite',
'tetrahedrite', 'Tetrahedrite',
'garnierite', 'Garnierite',
'bauxite', 'Bauxite',
} }
MINERALS_METALS_LIST={ minerals.metals_list = {
'pig_iron', 'pig_iron',
'pig_iron', 'pig_iron',
'pig_iron', 'pig_iron',
@ -236,24 +241,30 @@ MINERALS_METALS_LIST={
'aluminium', 'aluminium',
} }
for i=1, #MINERALS_LIST do for i, mineral in ipairs(minerals.list) do
minetest.register_craftitem("metals:ceramic_mold_"..MINERALS_LIST[i], { minetest.register_craftitem("metals:ceramic_mold_"..mineral, {
description = "Ceramic mold with "..MINERALS_DESC_LIST[i], description = "Ceramic mold with "..minerals.desc_list[i],
inventory_image = "metals_ceramic_mold_"..MINERALS_LIST[i]..".png", inventory_image = "metals_ceramic_mold_"..mineral..".png",
}) })
minetest.register_craft({ minetest.register_craft({
output = "metals:ceramic_mold_"..MINERALS_LIST[i], output = "metals:ceramic_mold_"..mineral,
recipe = { recipe = {
{"minerals:"..MINERALS_LIST[i]}, {"minerals:"..mineral},
{"metals:ceramic_mold"}, {"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({ minetest.register_craft({
type = "cooking", type = "cooking",
output = "metals:"..MINERALS_METALS_LIST[i].."_unshaped", output = "metals:"..minerals.metals_list[i].."_unshaped",
recipe = "metals:ceramic_mold_"..MINERALS_LIST[i], recipe = "metals:ceramic_mold_"..mineral,
}) })
end end

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

View File

@ -92,15 +92,3 @@ minetest.register_craft({
recipe = "minerals:bituminous_coal", recipe = "minerals:bituminous_coal",
burntime = 25, 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",
})

View File

@ -51,9 +51,9 @@ for i,ore in ipairs(ores.list) do
minetest.register_node("ores:"..ore, { minetest.register_node("ores:"..ore, {
description = ores.desc_list[i], description = ores.desc_list[i],
tile_images = {"default_stone.png^ores_"..ore..".png"}, tile_images = {"default_stone.png^ores_"..ore..".png"},
particle_image = {"ores_"..ore..".png"}, particle_image = {"minerals_"..ore..".png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=3}, groups = {cracky=3,drop_on_dig=1},
drop = { drop = {
max_items = 1, max_items = 1,
items = { items = {
@ -75,7 +75,7 @@ minetest.register_node("ores:native_copper_desert", {
tile_images = {"default_desert_stone.png^ores_native_copper.png"}, tile_images = {"default_desert_stone.png^ores_native_copper.png"},
particle_image = {"ores_native_copper.png"}, particle_image = {"ores_native_copper.png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=3}, groups = {cracky=3,drop_on_dig=1},
drop = { drop = {
max_items = 1, max_items = 1,
items = { items = {
@ -96,7 +96,7 @@ minetest.register_node("ores:native_gold_desert", {
tile_images = {"default_desert_stone.png^ores_native_gold.png"}, tile_images = {"default_desert_stone.png^ores_native_gold.png"},
particle_image = {"ores_native_gold.png"}, particle_image = {"ores_native_gold.png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=3}, groups = {cracky=3,drop_on_dig=1},
drop = { drop = {
max_items = 1, max_items = 1,
items = { items = {
@ -117,7 +117,7 @@ minetest.register_node("ores:peat", {
tile_images = {"ores_peat.png"}, tile_images = {"ores_peat.png"},
particle_image = {"ores_peat.png"}, particle_image = {"ores_peat.png"},
is_ground_content = true, is_ground_content = true,
groups = {crumbly=3}, groups = {crumbly=3,drop_on_dig=1,falling_node=1},
sounds = default.node_sound_stone_defaults(), 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 for i, ore in ipairs(gen_ores) do
if pr:next(1,2) == 1 then 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
end end
generate_peat("ores:peat", "default:dirt", minp, maxp, seed+19, 1/8/16/24, 10, 1000, -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, 31000) 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, 31000) 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 if pr:next(1,2) == 1 then
-- Generate clay -- Generate clay
@ -290,7 +291,7 @@ end)
minetest.register_craft({ minetest.register_craft({
type = "cooking", type = "cooking",
output = "default:torch 2", output = "default:torch 2",
recipe = "default:stick", recipe = "group:stick",
}) })
minetest.register_craft({ minetest.register_craft({

View File

@ -1,2 +0,0 @@
default
metals

View File

@ -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,
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 B

View File

@ -1,2 +1,2 @@
default default
metals trees

View File

@ -1,14 +1,5 @@
scribing_table = {} 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 = {} realtest.registered_instrument_plans = {}
function realtest.register_instrument_plan(name, PlanDef) function realtest.register_instrument_plan(name, PlanDef)
if PlanDef.bitmap then if PlanDef.bitmap then
@ -100,6 +91,15 @@ realtest.register_instrument_plan("scribing_table:plan_chisel", {
0,0,1,0,0,} 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 function check_recipe(pos)
local meta = minetest.env:get_meta(pos) local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -132,9 +132,11 @@ local function check_recipe(pos)
end end
end end
minetest.register_node("scribing_table:self", { for i, tree_name in ipairs(realtest.registered_trees_list) do
description = "Scribing Table", local tree = realtest.registered_trees[tree_name]
tiles = {"scribing_table_top.png", "default_wood.png", "default_wood.png^scribing_table_side.png"}, 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", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
node_box = { node_box = {
@ -155,10 +157,10 @@ minetest.register_node("scribing_table:self", {
local meta = minetest.env:get_meta(pos) local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", meta:set_string("formspec",
"size[8,10]".. "size[8,10]"..
"list[current_name;paper;6,0;1,1;]".. "list[current_name;paper;6.5,0.5;1,1;]"..
"list[current_name;dye;0,0;5,5;]".. "list[current_name;dye;0.5,0.5;5,5;]"..
"list[current_name;res;6,4;1,1;]".. "list[current_name;res;6.5,4.5;1,1;]"..
"image[5,1;2,3.4;scribing_table_arrow.png]".. "image[5.5,1.5;2,3.4;scribing_table_arrow.png]"..
"list[current_player;main;0,6;8,4;]" "list[current_player;main;0,6;8,4;]"
) )
meta:set_string("infotext", "Scribing Table") meta:set_string("infotext", "Scribing Table")
@ -185,3 +187,12 @@ minetest.register_node("scribing_table:self", {
return false return false
end, 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 907 B

After

Width:  |  Height:  |  Size: 900 B

View File

@ -1,26 +0,0 @@
Minetest 0.4 mod: stairs
=========================
License of source code:
-----------------------
Copyright (C) 2011-2012 Kahrl <kahrl@gmx.net>
Copyright (C) 2011-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
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 <celeron55@gmail.com>

View File

@ -1 +0,0 @@
default

View File

@ -1,146 +0,0 @@
-- Minetest 0.4 mod: stairs
-- See README.txt for licensing and other information.
stairs = {}
-- Node will be called stairs:stair_<subname>
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_<subname>
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}_<subname>
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")

View File

@ -1,6 +1,6 @@
minetest.register_tool("sticks:sticks", { minetest.register_tool("sticks:sticks", {
description = "Sticks", description = "Sticks",
inventory_image = "default_sticks.png", inventory_image = "sticks_sticks.png",
on_use = function(item, user, pointed_thing) on_use = function(item, user, pointed_thing)
local pos local pos
if pointed_thing.type == "node" then if pointed_thing.type == "node" then
@ -24,10 +24,10 @@ minetest.register_tool("sticks:sticks", {
for _, v in ipairs(objects) do for _, v in ipairs(objects) do
if not v:is_player() and v:get_luaentity() and v:get_luaentity().name == "__builtin:item" then if not v:is_player() and v:get_luaentity() and v:get_luaentity().name == "__builtin:item" then
local istack = ItemStack(v:get_luaentity().itemstring) 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 bonfireb = bonfireb + istack:get_count() * 2
v:remove() 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() bonfireb = bonfireb + istack:get_count()
v:remove() v:remove()
elseif istack:get_name() == "default:coal_lump" then elseif istack:get_name() == "default:coal_lump" then
@ -36,7 +36,7 @@ minetest.register_tool("sticks:sticks", {
end end
end 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 if furnace.check_furnace_blocks(pos) then
for _, v in ipairs(coals) do for _, v in ipairs(coals) do
v:remove() v:remove()
@ -68,7 +68,7 @@ minetest.register_tool("sticks:sticks", {
end end
end 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"}) minetest.env:set_node(pos, {name = "bonfire:self"})
local meta = minetest.env:get_meta(pos) local meta = minetest.env:get_meta(pos)
meta:set_int("active", 1) meta:set_int("active", 1)
@ -91,11 +91,9 @@ minetest.register_tool("sticks:sticks", {
minetest.register_craft({ minetest.register_craft({
type = "shapeless",
output = "sticks:sticks", output = "sticks:sticks",
recipe = { recipe = {"group:stick", "group:stick"},
{"", "default:stick"},
{"default:stick", ""},
},
}) })
minetest.register_alias("sticks", "sticks:sticks") minetest.register_alias("sticks", "sticks:sticks")

View File

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 297 B

View File

@ -1 +0,0 @@
default

View File

@ -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,
})

3
mods/trees/depends.txt Normal file
View File

@ -0,0 +1,3 @@
default
helper_functions
metals

80
mods/trees/init.lua Normal file
View File

@ -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)

1458
mods/trees/leavesgen.lua Normal file

File diff suppressed because it is too large Load Diff

461
mods/trees/registration.lua Normal file
View File

@ -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"}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

Some files were not shown because too many files have changed in this diff Show More