From 66f90a6101bd6c2402aa43397fc29435c72de2a1 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 3 Dec 2011 20:25:21 +0200 Subject: Make global names in default mod use good naming convention and move backwards-compatibility definitions to mods/legacy --- data/mods/legacy/depends.txt | 2 + data/mods/legacy/init.lua | 1029 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1031 insertions(+) create mode 100644 data/mods/legacy/depends.txt create mode 100644 data/mods/legacy/init.lua (limited to 'data/mods/legacy') diff --git a/data/mods/legacy/depends.txt b/data/mods/legacy/depends.txt new file mode 100644 index 000000000..3a7daa1d7 --- /dev/null +++ b/data/mods/legacy/depends.txt @@ -0,0 +1,2 @@ +default + diff --git a/data/mods/legacy/init.lua b/data/mods/legacy/init.lua new file mode 100644 index 000000000..ec691c5e7 --- /dev/null +++ b/data/mods/legacy/init.lua @@ -0,0 +1,1029 @@ +-- legacy (Minetest 0.4 mod) +-- Provides as much backwards-compatibility as feasible + +WATER_ALPHA = 160 +WATER_VISC = 1 +LAVA_VISC = 7 +LIGHT_MAX = 14 + +-- +-- Tool definition +-- Compatibility to 0.3 and old 0.4 +-- + +minetest.register_tool(":WPick", { + image = "tool_woodpick.png", + basetime = 2.0, + dt_weight = 0, + dt_crackiness = -0.5, + dt_crumbliness = 2, + dt_cuttability = 0, + basedurability = 30, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) +minetest.register_tool(":STPick", { + image = "tool_stonepick.png", + basetime = 1.5, + dt_weight = 0, + dt_crackiness = -0.5, + dt_crumbliness = 2, + dt_cuttability = 0, + basedurability = 100, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) +minetest.register_tool(":SteelPick", { + image = "tool_steelpick.png", + basetime = 1.0, + dt_weight = 0, + dt_crackiness = -0.5, + dt_crumbliness = 2, + dt_cuttability = 0, + basedurability = 333, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) +minetest.register_tool(":MesePick", { + image = "tool_mesepick.png", + basetime = 0, + dt_weight = 0, + dt_crackiness = 0, + dt_crumbliness = 0, + dt_cuttability = 0, + basedurability = 1337, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) +minetest.register_tool(":WShovel", { + image = "tool_woodshovel.png", + basetime = 2.0, + dt_weight = 0.5, + dt_crackiness = 2, + dt_crumbliness = -1.5, + dt_cuttability = 0.3, + basedurability = 30, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) +minetest.register_tool(":STShovel", { + image = "tool_stoneshovel.png", + basetime = 1.5, + dt_weight = 0.5, + dt_crackiness = 2, + dt_crumbliness = -1.5, + dt_cuttability = 0.1, + basedurability = 100, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) +minetest.register_tool(":SteelShovel", { + image = "tool_steelshovel.png", + basetime = 1.0, + dt_weight = 0.5, + dt_crackiness = 2, + dt_crumbliness = -1.5, + dt_cuttability = 0.0, + basedurability = 330, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) +minetest.register_tool(":WAxe", { + image = "tool_woodaxe.png", + basetime = 2.0, + dt_weight = 0.5, + dt_crackiness = -0.2, + dt_crumbliness = 1, + dt_cuttability = -0.5, + basedurability = 30, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) +minetest.register_tool(":STAxe", { + image = "tool_stoneaxe.png", + basetime = 1.5, + dt_weight = 0.5, + dt_crackiness = -0.2, + dt_crumbliness = 1, + dt_cuttability = -0.5, + basedurability = 100, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) +minetest.register_tool(":SteelAxe", { + image = "tool_steelaxe.png", + basetime = 1.0, + dt_weight = 0.5, + dt_crackiness = -0.2, + dt_crumbliness = 1, + dt_cuttability = -0.5, + basedurability = 330, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) +minetest.register_tool(":WSword", { + image = "tool_woodsword.png", + basetime = 3.0, + dt_weight = 3, + dt_crackiness = 0, + dt_crumbliness = 1, + dt_cuttability = -1, + basedurability = 30, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) +minetest.register_tool(":STSword", { + image = "tool_stonesword.png", + basetime = 2.5, + dt_weight = 3, + dt_crackiness = 0, + dt_crumbliness = 1, + dt_cuttability = -1, + basedurability = 100, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) +minetest.register_tool(":SteelSword", { + image = "tool_steelsword.png", + basetime = 2.0, + dt_weight = 3, + dt_crackiness = 0, + dt_crumbliness = 1, + dt_cuttability = -1, + basedurability = 330, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) + +-- +-- Crafting definition (recipe = legacy, output = default) +-- Makes current compatible with 0.3 and old 0.4 +-- + +minetest.register_craft({ + output = 'node "default:wood" 4', + recipe = { + {'node "tree"'}, + } +}) + +minetest.register_craft({ + output = 'craft "default:stick" 4', + recipe = { + {'node "wood"'}, + } +}) + +minetest.register_craft({ + output = 'node "default:fence_wooden" 2', + recipe = { + {'craft "Stick"', 'craft "Stick"', 'craft "Stick"'}, + {'craft "Stick"', 'craft "Stick"', 'craft "Stick"'}, + } +}) + +minetest.register_craft({ + output = 'node "default:sign_wall" 1', + recipe = { + {'node "wood"', 'node "wood"', 'node "wood"'}, + {'node "wood"', 'node "wood"', 'node "wood"'}, + {'', 'craft "Stick"', ''}, + } +}) + +minetest.register_craft({ + output = 'node "default:torch" 4', + recipe = { + {'craft "lump_of_coal"'}, + {'craft "Stick"'}, + } +}) + +minetest.register_craft({ + output = 'tool "default:pick_wooden"', + recipe = { + {'node "wood"', 'node "wood"', 'node "wood"'}, + {'', 'craft "Stick"', ''}, + {'', 'craft "Stick"', ''}, + } +}) + +minetest.register_craft({ + output = 'tool "default:pick_stone"', + recipe = { + {'node "cobble"', 'node "cobble"', 'node "cobble"'}, + {'', 'craft "Stick"', ''}, + {'', 'craft "Stick"', ''}, + } +}) + +minetest.register_craft({ + output = 'tool "default:pick_steel"', + recipe = { + {'craft "steel_ingot"', 'craft "steel_ingot"', 'craft "steel_ingot"'}, + {'', 'craft "Stick"', ''}, + {'', 'craft "Stick"', ''}, + } +}) + +minetest.register_craft({ + output = 'tool "default:pick_mese"', + recipe = { + {'node "mese"', 'node "mese"', 'node "mese"'}, + {'', 'craft "Stick"', ''}, + {'', 'craft "Stick"', ''}, + } +}) + +minetest.register_craft({ + output = 'tool "default:shovel_wood"', + recipe = { + {'node "wood"'}, + {'craft "Stick"'}, + {'craft "Stick"'}, + } +}) + +minetest.register_craft({ + output = 'tool "default:shovel_stone"', + recipe = { + {'node "cobble"'}, + {'craft "Stick"'}, + {'craft "Stick"'}, + } +}) + +minetest.register_craft({ + output = 'tool "default:shovel_steel"', + recipe = { + {'craft "steel_ingot"'}, + {'craft "Stick"'}, + {'craft "Stick"'}, + } +}) + +minetest.register_craft({ + output = 'tool "default:axe_wooden"', + recipe = { + {'node "wood"', 'node "wood"'}, + {'node "wood"', 'craft "Stick"'}, + {'', 'craft "Stick"'}, + } +}) + +minetest.register_craft({ + output = 'tool "default:axe_stone"', + recipe = { + {'node "cobble"', 'node "cobble"'}, + {'node "cobble"', 'craft "Stick"'}, + {'', 'craft "Stick"'}, + } +}) + +minetest.register_craft({ + output = 'tool "default:axe_steel"', + recipe = { + {'craft "steel_ingot"', 'craft "steel_ingot"'}, + {'craft "steel_ingot"', 'craft "Stick"'}, + {'', 'craft "Stick"'}, + } +}) + +minetest.register_craft({ + output = 'tool "default:sword_wood"', + recipe = { + {'node "wood"'}, + {'node "wood"'}, + {'craft "Stick"'}, + } +}) + +minetest.register_craft({ + output = 'tool "default:sword_stone"', + recipe = { + {'node "cobble"'}, + {'node "cobble"'}, + {'craft "Stick"'}, + } +}) + +minetest.register_craft({ + output = 'tool "default:sword_steel"', + recipe = { + {'craft "steel_ingot"'}, + {'craft "steel_ingot"'}, + {'craft "Stick"'}, + } +}) + +minetest.register_craft({ + output = 'node "default:rail" 15', + recipe = { + {'craft "steel_ingot"', '', 'craft "steel_ingot"'}, + {'craft "steel_ingot"', 'craft "Stick"', 'craft "steel_ingot"'}, + {'craft "steel_ingot"', '', 'craft "steel_ingot"'}, + } +}) + +minetest.register_craft({ + output = 'node "default:chest" 1', + recipe = { + {'node "wood"', 'node "wood"', 'node "wood"'}, + {'node "wood"', '', 'node "wood"'}, + {'node "wood"', 'node "wood"', 'node "wood"'}, + } +}) + +minetest.register_craft({ + output = 'node "default:chest_locked" 1', + recipe = { + {'node "wood"', 'node "wood"', 'node "wood"'}, + {'node "wood"', 'craft "steel_ingot"', 'node "wood"'}, + {'node "wood"', 'node "wood"', 'node "wood"'}, + } +}) + +minetest.register_craft({ + output = 'node "default:furnace" 1', + recipe = { + {'node "cobble"', 'node "cobble"', 'node "cobble"'}, + {'node "cobble"', '', 'node "cobble"'}, + {'node "cobble"', 'node "cobble"', 'node "cobble"'}, + } +}) + +minetest.register_craft({ + output = 'node "default:steelblock" 1', + recipe = { + {'craft "steel_ingot"', 'craft "steel_ingot"', 'craft "steel_ingot"'}, + {'craft "steel_ingot"', 'craft "steel_ingot"', 'craft "steel_ingot"'}, + {'craft "steel_ingot"', 'craft "steel_ingot"', 'craft "steel_ingot"'}, + } +}) + +minetest.register_craft({ + output = 'node "default:sandstone" 1', + recipe = { + {'node "sand"', 'node "sand"'}, + {'node "sand"', 'node "sand"'}, + } +}) + +minetest.register_craft({ + output = 'node "default:clay" 1', + recipe = { + {'craft "lump_of_clay"', 'craft "lump_of_clay"'}, + {'craft "lump_of_clay"', 'craft "lump_of_clay"'}, + } +}) + +minetest.register_craft({ + output = 'node "default:brick" 1', + recipe = { + {'craft "clay_brick"', 'craft "clay_brick"'}, + {'craft "clay_brick"', 'craft "clay_brick"'}, + } +}) + +minetest.register_craft({ + output = 'craft "default:paper" 1', + recipe = { + {'node "papyrus"', 'node "papyrus"', 'node "papyrus"'}, + } +}) + +minetest.register_craft({ + output = 'craft "default:book" 1', + recipe = { + {'craft "paper"'}, + {'craft "paper"'}, + {'craft "paper"'}, + } +}) + +minetest.register_craft({ + output = 'node "default:bookshelf" 1', + recipe = { + {'node "wood"', 'node "wood"', 'node "wood"'}, + {'craft "book"', 'craft "book"', 'craft "book"'}, + {'node "wood"', 'node "wood"', 'node "wood"'}, + } +}) + +minetest.register_craft({ + output = 'node "default:ladder" 1', + recipe = { + {'craft "Stick"', '', 'craft "Stick"'}, + {'craft "Stick"', 'craft "Stick"', 'craft "Stick"'}, + {'craft "Stick"', '', 'craft "Stick"'}, + } +}) + +minetest.register_craft({ + output = 'craft "default:apple_iron" 1', + recipe = { + {'', 'craft "steel_ingot"', ''}, + {'craft "steel_ingot"', 'craft "apple"', 'craft "steel_ingot"'}, + {'', 'craft "steel_ingot"', ''}, + } +}) + +-- +-- Node compatibility with old 0.4 +-- + +minetest.register_node(":stone", { + tile_images = {"stone.png"}, + inventory_image = minetest.inventorycube("stone.png"), + paramtype = "mineral", + is_ground_content = true, + often_contains_mineral = true, -- Texture atlas hint + material = minetest.digprop_stonelike(1.0), + dug_item = 'node "cobble" 1', +}) + +minetest.register_node(":dirt_with_grass", { + tile_images = {"grass.png", "mud.png", "mud.png^grass_side.png"}, + inventory_image = minetest.inventorycube("mud.png^grass_side.png"), + is_ground_content = true, + material = minetest.digprop_dirtlike(1.0), + dug_item = 'node "dirt" 1', +}) + +minetest.register_node(":dirt_with_grass_footsteps", { + tile_images = {"grass_footsteps.png", "mud.png", "mud.png^grass_side.png"}, + inventory_image = "grass_footsteps.png", + is_ground_content = true, + material = minetest.digprop_dirtlike(1.0), + dug_item = 'node "dirt" 1', +}) + +minetest.register_node(":dirt", { + tile_images = {"mud.png"}, + inventory_image = minetest.inventorycube("mud.png"), + is_ground_content = true, + material = minetest.digprop_dirtlike(1.0), +}) + +minetest.register_node(":sand", { + tile_images = {"sand.png"}, + inventory_image = minetest.inventorycube("sand.png"), + is_ground_content = true, + material = minetest.digprop_dirtlike(1.0), + cookresult_itemstring = 'node "glass" 1', +}) + +minetest.register_node(":gravel", { + tile_images = {"gravel.png"}, + inventory_image = minetest.inventorycube("gravel.png"), + is_ground_content = true, + material = minetest.digprop_gravellike(1.0), +}) + +minetest.register_node(":sandstone", { + tile_images = {"sandstone.png"}, + inventory_image = minetest.inventorycube("sandstone.png"), + is_ground_content = true, + material = minetest.digprop_dirtlike(1.0), + dug_item = 'node "sand" 1', +}) + +minetest.register_node(":clay", { + tile_images = {"clay.png"}, + inventory_image = minetest.inventorycube("clay.png"), + is_ground_content = true, + material = minetest.digprop_dirtlike(1.0), + dug_item = 'craft "lump_of_clay" 4', +}) + +minetest.register_node(":brick", { + tile_images = {"brick.png"}, + inventory_image = minetest.inventorycube("brick.png"), + is_ground_content = true, + material = minetest.digprop_stonelike(1.0), + dug_item = 'craft "clay_brick" 4', +}) + +minetest.register_node(":tree", { + tile_images = {"tree_top.png", "tree_top.png", "tree.png"}, + inventory_image = minetest.inventorycube("tree_top.png", "tree.png", "tree.png"), + is_ground_content = true, + material = minetest.digprop_woodlike(1.0), + cookresult_itemstring = 'craft "lump_of_coal" 1', + furnace_burntime = 30, +}) + +minetest.register_node(":jungletree", { + tile_images = {"jungletree_top.png", "jungletree_top.png", "jungletree.png"}, + inventory_image = minetest.inventorycube("jungletree_top.png", "jungletree.png", "jungletree.png"), + is_ground_content = true, + material = minetest.digprop_woodlike(1.0), + cookresult_itemstring = 'craft "lump_of_coal" 1', + furnace_burntime = 30, +}) + +minetest.register_node(":junglegrass", { + drawtype = "plantlike", + visual_scale = 1.3, + tile_images = {"junglegrass.png"}, + inventory_image = "junglegrass.png", + light_propagates = true, + paramtype = "light", + walkable = false, + material = minetest.digprop_leaveslike(1.0), + furnace_burntime = 2, +}) + +minetest.register_node(":leaves", { + drawtype = "allfaces_optional", + visual_scale = 1.3, + tile_images = {"leaves.png"}, + inventory_image = minetest.inventorycube("leaves.png"), + light_propagates = true, + paramtype = "light", + material = minetest.digprop_leaveslike(1.0), + extra_dug_item = 'node "sapling" 1', + extra_dug_item_rarity = 20, + furnace_burntime = 1, +}) + +minetest.register_node(":cactus", { + tile_images = {"cactus_top.png", "cactus_top.png", "cactus_side.png"}, + inventory_image = minetest.inventorycube("cactus_top.png", "cactus_side.png", "cactus_side.png"), + is_ground_content = true, + material = minetest.digprop_woodlike(0.75), + furnace_burntime = 15, +}) + +minetest.register_node(":papyrus", { + drawtype = "plantlike", + tile_images = {"papyrus.png"}, + inventory_image = "papyrus.png", + light_propagates = true, + paramtype = "light", + is_ground_content = true, + walkable = false, + material = minetest.digprop_leaveslike(0.5), + furnace_burntime = 1, +}) + +minetest.register_node(":bookshelf", { + tile_images = {"wood.png", "wood.png", "bookshelf.png"}, + inventory_image = minetest.inventorycube("wood.png", "bookshelf.png", "bookshelf.png"), + is_ground_content = true, + material = minetest.digprop_woodlike(0.75), + furnace_burntime = 30, +}) + +minetest.register_node(":glass", { + drawtype = "glasslike", + tile_images = {"glass.png"}, + inventory_image = minetest.inventorycube("glass.png"), + light_propagates = true, + paramtype = "light", + sunlight_propagates = true, + is_ground_content = true, + material = minetest.digprop_glasslike(1.0), +}) + +minetest.register_node(":wooden_fence", { + drawtype = "fencelike", + tile_images = {"wood.png"}, + inventory_image = "fence.png", + light_propagates = true, + paramtype = "light", + is_ground_content = true, + selection_box = { + type = "fixed", + fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, + }, + furnace_burntime = 15, + material = minetest.digprop_woodlike(0.75), +}) + +minetest.register_node(":rail", { + drawtype = "raillike", + tile_images = {"rail.png", "rail_curved.png", "rail_t_junction.png", "rail_crossing.png"}, + inventory_image = "rail.png", + light_propagates = true, + paramtype = "light", + is_ground_content = true, + walkable = false, + selection_box = { + type = "fixed", + --fixed = + }, + material = minetest.digprop_dirtlike(0.75), +}) + +minetest.register_node(":ladder", { + drawtype = "signlike", + tile_images = {"ladder.png"}, + inventory_image = "ladder.png", + light_propagates = true, + paramtype = "light", + is_ground_content = true, + wall_mounted = true, + walkable = false, + climbable = true, + selection_box = { + type = "wallmounted", + --wall_top = = + --wall_bottom = = + --wall_side = = + }, + furnace_burntime = 5, + material = minetest.digprop_woodlike(0.5), +}) + +minetest.register_node(":coalstone", { + tile_images = {"stone.png^mineral_coal.png"}, + inventory_image = "stone.png^mineral_coal.png", + is_ground_content = true, + material = minetest.digprop_stonelike(1.5), +}) + +minetest.register_node(":wood", { + tile_images = {"wood.png"}, + inventory_image = minetest.inventorycube("wood.png"), + is_ground_content = true, + furnace_burntime = 7, + material = minetest.digprop_woodlike(0.75), +}) + +minetest.register_node(":mese", { + tile_images = {"mese.png"}, + inventory_image = minetest.inventorycube("mese.png"), + is_ground_content = true, + furnace_burntime = 30, + material = minetest.digprop_stonelike(0.5), +}) + +minetest.register_node(":cloud", { + tile_images = {"cloud.png"}, + inventory_image = minetest.inventorycube("cloud.png"), + is_ground_content = true, +}) + +minetest.register_node(":water_flowing", { + drawtype = "flowingliquid", + tile_images = {"water.png"}, + alpha = WATER_ALPHA, + inventory_image = minetest.inventorycube("water.png"), + paramtype = "light", + light_propagates = true, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + liquidtype = "flowing", + liquid_alternative_flowing = "water_flowing", + liquid_alternative_source = "water_source", + liquid_viscosity = WATER_VISC, + post_effect_color = {a=64, r=100, g=100, b=200}, + special_materials = { + {image="water.png", backface_culling=false}, + {image="water.png", backface_culling=true}, + }, +}) + +minetest.register_node(":water_source", { + drawtype = "liquid", + tile_images = {"water.png"}, + alpha = WATER_ALPHA, + inventory_image = minetest.inventorycube("water.png"), + paramtype = "light", + light_propagates = true, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + liquidtype = "source", + liquid_alternative_flowing = "water_flowing", + liquid_alternative_source = "water_source", + liquid_viscosity = WATER_VISC, + post_effect_color = {a=64, r=100, g=100, b=200}, + special_materials = { + -- New-style water source material (mostly unused) + {image="water.png", backface_culling=false}, + }, +}) + +minetest.register_node(":lava_flowing", { + drawtype = "flowingliquid", + tile_images = {"lava.png"}, + inventory_image = minetest.inventorycube("lava.png"), + paramtype = "light", + light_propagates = false, + light_source = LIGHT_MAX - 1, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + liquidtype = "flowing", + liquid_alternative_flowing = "lava_flowing", + liquid_alternative_source = "lava_source", + liquid_viscosity = LAVA_VISC, + damage_per_second = 4*2, + post_effect_color = {a=192, r=255, g=64, b=0}, + special_materials = { + {image="lava.png", backface_culling=false}, + {image="lava.png", backface_culling=true}, + }, +}) + +minetest.register_node(":lava_source", { + drawtype = "liquid", + tile_images = {"lava.png"}, + inventory_image = minetest.inventorycube("lava.png"), + paramtype = "light", + light_propagates = false, + light_source = LIGHT_MAX - 1, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + liquidtype = "source", + liquid_alternative_flowing = "lava_flowing", + liquid_alternative_source = "lava_source", + liquid_viscosity = LAVA_VISC, + damage_per_second = 4*2, + post_effect_color = {a=192, r=255, g=64, b=0}, + special_materials = { + -- New-style lava source material (mostly unused) + {image="lava.png", backface_culling=false}, + }, + furnace_burntime = 60, +}) + +minetest.register_node(":torch", { + drawtype = "torchlike", + tile_images = {"torch_on_floor.png", "torch_on_ceiling.png", "torch.png"}, + inventory_image = "torch_on_floor.png", + paramtype = "light", + light_propagates = true, + sunlight_propagates = true, + walkable = false, + wall_mounted = true, + light_source = LIGHT_MAX-1, + selection_box = { + type = "wallmounted", + wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1}, + wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1}, + wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1}, + }, + material = minetest.digprop_constanttime(0.0), + furnace_burntime = 4, +}) + +minetest.register_node(":sign_wall", { + drawtype = "signlike", + tile_images = {"sign_wall.png"}, + inventory_image = "sign_wall.png", + paramtype = "light", + light_propagates = true, + sunlight_propagates = true, + walkable = false, + wall_mounted = true, + metadata_name = "sign", + selection_box = { + type = "wallmounted", + --wall_top = + --wall_bottom = + --wall_side = + }, + material = minetest.digprop_constanttime(0.5), + furnace_burntime = 10, +}) + +minetest.register_node(":chest", { + tile_images = {"chest_top.png", "chest_top.png", "chest_side.png", + "chest_side.png", "chest_side.png", "chest_front.png"}, + inventory_image = minetest.inventorycube("chest_top.png", "chest_front.png", "chest_side.png"), + paramtype = "facedir_simple", + metadata_name = "chest", + material = minetest.digprop_woodlike(1.0), + furnace_burntime = 30, +}) + +minetest.register_node(":locked_chest", { + tile_images = {"chest_top.png", "chest_top.png", "chest_side.png", + "chest_side.png", "chest_side.png", "chest_lock.png"}, + inventory_image = minetest.inventorycube("chest_top.png", "chest_lock.png", "chest_side.png"), + paramtype = "facedir_simple", + metadata_name = "locked_chest", + material = minetest.digprop_woodlike(1.0), + furnace_burntime = 30, +}) + +minetest.register_node(":furnace", { + tile_images = {"furnace_side.png", "furnace_side.png", "furnace_side.png", + "furnace_side.png", "furnace_side.png", "furnace_front.png"}, + inventory_image = minetest.inventorycube("furnace_side.png", "furnace_front.png", "furnace_side.png"), + paramtype = "facedir_simple", + metadata_name = "furnace", + material = minetest.digprop_stonelike(3.0), +}) + +minetest.register_node(":cobble", { + tile_images = {"cobble.png"}, + inventory_image = minetest.inventorycube("cobble.png"), + is_ground_content = true, + cookresult_itemstring = 'node "stone" 1', + material = minetest.digprop_stonelike(0.9), +}) + +minetest.register_node(":mossycobble", { + tile_images = {"mossycobble.png"}, + inventory_image = minetest.inventorycube("mossycobble.png"), + is_ground_content = true, + material = minetest.digprop_stonelike(0.8), +}) + +minetest.register_node(":steelblock", { + tile_images = {"steel_block.png"}, + inventory_image = minetest.inventorycube("steel_block.png"), + is_ground_content = true, + material = minetest.digprop_stonelike(5.0), +}) + +minetest.register_node(":nyancat", { + tile_images = {"nc_side.png", "nc_side.png", "nc_side.png", + "nc_side.png", "nc_back.png", "nc_front.png"}, + inventory_image = "nc_front.png", + paramtype = "facedir_simple", + material = minetest.digprop_stonelike(3.0), + furnace_burntime = 1, +}) + +minetest.register_node(":nyancat_rainbow", { + tile_images = {"nc_rb.png"}, + inventory_image = "nc_rb.png", + material = minetest.digprop_stonelike(3.0), + furnace_burntime = 1, +}) + +minetest.register_node(":sapling", { + drawtype = "plantlike", + visual_scale = 1.0, + tile_images = {"sapling.png"}, + inventory_image = "sapling.png", + paramtype = "light", + light_propagates = true, + walkable = false, + material = minetest.digprop_constanttime(0.0), + furnace_burntime = 10, +}) + +minetest.register_node(":apple", { + drawtype = "plantlike", + visual_scale = 1.0, + tile_images = {"apple.png"}, + inventory_image = "apple.png", + paramtype = "light", + light_propagates = true, + sunlight_propagates = true, + walkable = false, + dug_item = 'craft "apple" 1', + material = minetest.digprop_constanttime(0.0), + furnace_burntime = 3, +}) + +-- +-- Crafting items +-- Compatibility to 0.3 and old 0.4 +-- + +minetest.register_craftitem(":Stick", { + image = "stick.png", + --furnace_burntime = ..., + on_place_on_ground = minetest.craftitem_place_item, +}) + +minetest.register_craftitem(":paper", { + image = "paper.png", + on_place_on_ground = minetest.craftitem_place_item, +}) + +minetest.register_craftitem(":book", { + image = "book.png", + on_place_on_ground = minetest.craftitem_place_item, +}) + +minetest.register_craftitem(":lump_of_coal", { + image = "lump_of_coal.png", + furnace_burntime = 40; + on_place_on_ground = minetest.craftitem_place_item, +}) + +minetest.register_craftitem(":lump_of_iron", { + image = "lump_of_iron.png", + cookresult_itemstring = 'craft "steel_ingot" 1', + on_place_on_ground = minetest.craftitem_place_item, +}) + +minetest.register_craftitem(":lump_of_clay", { + image = "lump_of_clay.png", + cookresult_itemstring = 'craft "clay_brick" 1', + on_place_on_ground = minetest.craftitem_place_item, +}) + +minetest.register_craftitem(":steel_ingot", { + image = "steel_ingot.png", + on_place_on_ground = minetest.craftitem_place_item, +}) + +minetest.register_craftitem(":clay_brick", { + image = "clay_brick.png", + on_place_on_ground = minetest.craftitem_place_item, +}) + +minetest.register_craftitem(":rat", { + image = "rat.png", + cookresult_itemstring = 'craft "cooked_rat" 1', + on_drop = function(item, dropper, pos) + minetest.env:add_rat(pos) + return true + end, +}) + +minetest.register_craftitem(":cooked_rat", { + image = "cooked_rat.png", + cookresult_itemstring = 'craft "scorched_stuff" 1', + on_place_on_ground = minetest.craftitem_place_item, + on_use = minetest.craftitem_eat(6), +}) + +minetest.register_craftitem(":scorched_stuff", { + image = "scorched_stuff.png", + on_place_on_ground = minetest.craftitem_place_item, +}) + +minetest.register_craftitem(":firefly", { + image = "firefly.png", + on_drop = function(item, dropper, pos) + minetest.env:add_firefly(pos) + return true + end, +}) + +minetest.register_craftitem(":apple", { + image = "apple.png", + on_place_on_ground = minetest.craftitem_place_item, + on_use = minetest.craftitem_eat(4), +}) + +minetest.register_craftitem(":apple_iron", { + image = "apple_iron.png", + on_place_on_ground = minetest.craftitem_place_item, + on_use = minetest.craftitem_eat(8), +}) + +-- +-- Falling stuff +-- + +default.register_falling_node("sand", "sand.png") +default.register_falling_node("gravel", "gravel.png") + +-- +-- Global callbacks +-- + +function on_placenode(p, node) + nodeupdate(p) +end +minetest.register_on_placenode(on_placenode) + +function on_dignode(p, node) + nodeupdate(p) +end +minetest.register_on_dignode(on_dignode) + +-- END -- cgit v1.2.3