diff options
author | Kahrl <kahrl@gmx.net> | 2012-01-12 06:10:39 +0100 |
---|---|---|
committer | Kahrl <kahrl@gmx.net> | 2012-01-12 06:10:39 +0100 |
commit | 6a76c226e10e92c3e3339096f07f8ab065e2098b (patch) | |
tree | 396d9083f5f76ebb5ba96df113ba68046c2487df /data/mods/legacy | |
parent | 569156b01302ea4ba45d11ff5524b62dbc6a9aa0 (diff) | |
download | minetest-6a76c226e10e92c3e3339096f07f8ab065e2098b.tar.gz minetest-6a76c226e10e92c3e3339096f07f8ab065e2098b.tar.bz2 minetest-6a76c226e10e92c3e3339096f07f8ab065e2098b.zip |
The huge item definition and item namespace unification patch (itemdef), see http://c55.me/minetest/wiki/doku.php?id=changes:itemdef
Diffstat (limited to 'data/mods/legacy')
-rw-r--r-- | data/mods/legacy/init.lua | 171 |
1 files changed, 100 insertions, 71 deletions
diff --git a/data/mods/legacy/init.lua b/data/mods/legacy/init.lua index 3bd68f0bc..127b0e17f 100644 --- a/data/mods/legacy/init.lua +++ b/data/mods/legacy/init.lua @@ -5,97 +5,126 @@ -- Aliases to support loading 0.3 and old 0.4 worlds and inventories -- -minetest.alias_node("stone", "default:stone") -minetest.alias_node("dirt_with_grass", "default:dirt_with_grass") -minetest.alias_node("dirt_with_grass_footsteps", "default:dirt_with_grass_footsteps") -minetest.alias_node("dirt", "default:dirt") -minetest.alias_node("sand", "default:sand") -minetest.alias_node("gravel", "default:gravel") -minetest.alias_node("sandstone", "default:sandstone") -minetest.alias_node("clay", "default:clay") -minetest.alias_node("brick", "default:brick") -minetest.alias_node("tree", "default:tree") -minetest.alias_node("jungletree", "default:jungletree") -minetest.alias_node("junglegrass", "default:junglegrass") -minetest.alias_node("leaves", "default:leaves") -minetest.alias_node("cactus", "default:cactus") -minetest.alias_node("papyrus", "default:papyrus") -minetest.alias_node("bookshelf", "default:bookshelf") -minetest.alias_node("glass", "default:glass") -minetest.alias_node("wooden_fence", "default:fence_wood") -minetest.alias_node("rail", "default:rail") -minetest.alias_node("ladder", "default:ladder") -minetest.alias_node("wood", "default:wood") -minetest.alias_node("mese", "default:mese") -minetest.alias_node("cloud", "default:cloud") -minetest.alias_node("water_flowing", "default:water_flowing") -minetest.alias_node("water_source", "default:water_source") -minetest.alias_node("lava_flowing", "default:lava_flowing") -minetest.alias_node("lava_source", "default:lava_source") -minetest.alias_node("torch", "default:torch") -minetest.alias_node("sign_wall", "default:sign_wall") -minetest.alias_node("furnace", "default:furnace") -minetest.alias_node("chest", "default:chest") -minetest.alias_node("locked_chest", "default:chest_locked") -minetest.alias_node("cobble", "default:cobble") -minetest.alias_node("mossycobble", "default:mossycobble") -minetest.alias_node("steelblock", "default:steelblock") -minetest.alias_node("nyancat", "default:nyancat") -minetest.alias_node("nyancat_rainbow", "default:nyancat_rainbow") -minetest.alias_node("sapling", "default:sapling") -minetest.alias_node("apple", "default:apple") +minetest.register_alias("stone", "default:stone") +minetest.register_alias("dirt_with_grass", "default:dirt_with_grass") +minetest.register_alias("dirt_with_grass_footsteps", "default:dirt_with_grass_footsteps") +minetest.register_alias("dirt", "default:dirt") +minetest.register_alias("sand", "default:sand") +minetest.register_alias("gravel", "default:gravel") +minetest.register_alias("sandstone", "default:sandstone") +minetest.register_alias("clay", "default:clay") +minetest.register_alias("brick", "default:brick") +minetest.register_alias("tree", "default:tree") +minetest.register_alias("jungletree", "default:jungletree") +minetest.register_alias("junglegrass", "default:junglegrass") +minetest.register_alias("leaves", "default:leaves") +minetest.register_alias("cactus", "default:cactus") +minetest.register_alias("papyrus", "default:papyrus") +minetest.register_alias("bookshelf", "default:bookshelf") +minetest.register_alias("glass", "default:glass") +minetest.register_alias("wooden_fence", "default:fence_wood") +minetest.register_alias("rail", "default:rail") +minetest.register_alias("ladder", "default:ladder") +minetest.register_alias("wood", "default:wood") +minetest.register_alias("mese", "default:mese") +minetest.register_alias("cloud", "default:cloud") +minetest.register_alias("water_flowing", "default:water_flowing") +minetest.register_alias("water_source", "default:water_source") +minetest.register_alias("lava_flowing", "default:lava_flowing") +minetest.register_alias("lava_source", "default:lava_source") +minetest.register_alias("torch", "default:torch") +minetest.register_alias("sign_wall", "default:sign_wall") +minetest.register_alias("furnace", "default:furnace") +minetest.register_alias("chest", "default:chest") +minetest.register_alias("locked_chest", "default:chest_locked") +minetest.register_alias("cobble", "default:cobble") +minetest.register_alias("mossycobble", "default:mossycobble") +minetest.register_alias("steelblock", "default:steelblock") +minetest.register_alias("nyancat", "default:nyancat") +minetest.register_alias("nyancat_rainbow", "default:nyancat_rainbow") +minetest.register_alias("sapling", "default:sapling") +minetest.register_alias("apple", "default:apple") -minetest.alias_tool("WPick", "default:pick_wood") -minetest.alias_tool("STPick", "default:pick_stone") -minetest.alias_tool("SteelPick", "default:pick_steel") -minetest.alias_tool("MesePick", "default:pick_mese") -minetest.alias_tool("WShovel", "default:shovel_wood") -minetest.alias_tool("STShovel", "default:shovel_stone") -minetest.alias_tool("SteelShovel", "default:shovel_steel") -minetest.alias_tool("WAxe", "default:axe_wood") -minetest.alias_tool("STAxe", "default:axe_stone") -minetest.alias_tool("SteelAxe", "default:axe_steel") -minetest.alias_tool("WSword", "default:sword_wood") -minetest.alias_tool("STSword", "default:sword_stone") -minetest.alias_tool("SteelSword", "default:sword_steel") +minetest.register_alias("WPick", "default:pick_wood") +minetest.register_alias("STPick", "default:pick_stone") +minetest.register_alias("SteelPick", "default:pick_steel") +minetest.register_alias("MesePick", "default:pick_mese") +minetest.register_alias("WShovel", "default:shovel_wood") +minetest.register_alias("STShovel", "default:shovel_stone") +minetest.register_alias("SteelShovel", "default:shovel_steel") +minetest.register_alias("WAxe", "default:axe_wood") +minetest.register_alias("STAxe", "default:axe_stone") +minetest.register_alias("SteelAxe", "default:axe_steel") +minetest.register_alias("WSword", "default:sword_wood") +minetest.register_alias("STSword", "default:sword_stone") +minetest.register_alias("SteelSword", "default:sword_steel") -minetest.alias_craftitem("Stick", "default:stick") -minetest.alias_craftitem("paper", "default:paper") -minetest.alias_craftitem("book", "default:book") -minetest.alias_craftitem("lump_of_coal", "default:coal_lump") -minetest.alias_craftitem("lump_of_iron", "default:iron_lump") -minetest.alias_craftitem("lump_of_clay", "default:clay_lump") -minetest.alias_craftitem("steel_ingot", "default:steel_ingot") -minetest.alias_craftitem("clay_brick", "default:clay_brick") -minetest.alias_craftitem("scorched_stuff", "default:scorched_stuff") -minetest.alias_craftitem("apple", "default:apple") +minetest.register_alias("Stick", "default:stick") +minetest.register_alias("paper", "default:paper") +minetest.register_alias("book", "default:book") +minetest.register_alias("lump_of_coal", "default:coal_lump") +minetest.register_alias("lump_of_iron", "default:iron_lump") +minetest.register_alias("lump_of_clay", "default:clay_lump") +minetest.register_alias("steel_ingot", "default:steel_ingot") +minetest.register_alias("clay_brick", "default:clay_brick") +minetest.register_alias("scorched_stuff", "default:scorched_stuff") -- -- Old items -- minetest.register_craftitem(":rat", { - image = "rat.png", - cookresult_itemstring = 'craft "cooked_rat" 1', + description = "Rat", + inventory_image = "rat.png", on_drop = function(item, dropper, pos) minetest.env:add_rat(pos) - return true + item:take_item() + return item end, + on_place = function(item, dropped, pointed) + pos = minetest.get_pointed_thing_position(pointed, true) + if pos ~= nil then + minetest.env:add_rat(pos) + item:take_item() + return item + end + 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), + description = "Cooked rat", + inventory_image = "cooked_rat.png", + on_use = minetest.item_eat(6), }) minetest.register_craftitem(":firefly", { - image = "firefly.png", + description = "Firefly", + inventory_image = "firefly.png", on_drop = function(item, dropper, pos) minetest.env:add_firefly(pos) - return true + item:take_item() + return item end, + on_place = function(item, dropped, pointed) + pos = minetest.get_pointed_thing_position(pointed, true) + if pos ~= nil then + minetest.env:add_firefly(pos) + item:take_item() + return item + end + end +}) + +minetest.register_craft({ + type = "cooking", + output = "cooked_rat", + recipe = "rat", +}) + +minetest.register_craft({ + type = "cooking", + output = "scorched_stuff", + recipe = "cooked_rat", }) -- END |