aboutsummaryrefslogtreecommitdiff
path: root/data/mods/experimental
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2012-01-12 06:10:39 +0100
committerKahrl <kahrl@gmx.net>2012-01-12 06:10:39 +0100
commit6a76c226e10e92c3e3339096f07f8ab065e2098b (patch)
tree396d9083f5f76ebb5ba96df113ba68046c2487df /data/mods/experimental
parent569156b01302ea4ba45d11ff5524b62dbc6a9aa0 (diff)
downloadminetest-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/experimental')
-rw-r--r--data/mods/experimental/init.lua48
1 files changed, 9 insertions, 39 deletions
diff --git a/data/mods/experimental/init.lua b/data/mods/experimental/init.lua
index 2aae9b199..a58d8f08d 100644
--- a/data/mods/experimental/init.lua
+++ b/data/mods/experimental/init.lua
@@ -25,6 +25,7 @@ minetest.register_globalstep(on_step)
-- An example furnace-thing implemented in Lua
+--[[
minetest.register_node("experimental:luafurnace", {
tile_images = {"default_lava.png", "default_furnace_side.png",
"default_furnace_side.png", "default_furnace_side.png",
@@ -56,15 +57,6 @@ minetest.register_on_placenode(function(pos, newnode, placer)
end
end)
-local get_item_definition = function(item)
- if not item then return nil end
- if item.type == "node" then
- return minetest.registered_nodes[item.name]
- elseif item.type == "craft" then
- return minetest.registered_craftitems[item.name]
- end
-end
-
minetest.register_abm({
nodenames = {"experimental:luafurnace"},
interval = 1.0,
@@ -176,7 +168,6 @@ minetest.register_abm({
inv:set_stack("fuel", 1, stack)
end,
})
---[[
minetest.register_abm({
nodenames = {"experimental:luafurnace"},
interval = 1.0,
@@ -231,7 +222,6 @@ minetest.register_abm({
meta:set_infotext("Lua Furnace: total cooked: "..total_cooked)
end,
})
---]]
minetest.register_craft({
output = 'node "experimental:luafurnace" 1',
recipe = {
@@ -240,6 +230,7 @@ minetest.register_craft({
{'node "default:cobble"', 'node "default:cobble"', 'node "default:cobble"'},
}
})
+--]]
--
-- Random stuff
@@ -261,38 +252,16 @@ minetest.register_tool("experimental:horribletool", {
})
--]]
---[[minetest.register_craft({
- output = 'node "somenode" 4',
- recipe = {
- {'craft "default_tick" 1'},
- }
-})
-
-minetest.register_node("experimental:somenode", {
- tile_images = {"lava.png", "mese.png", "stone.png", "grass.png", "cobble.png", "tree_top.png"},
- inventory_image = minetest.inventorycube("lava.png", "mese.png", "stone.png"),
- --inventory_image = "treeprop.png",
- material = {
- diggability = "normal",
- weight = 0,
- crackiness = 0,
- crumbliness = 0,
- cuttability = 0,
- flammability = 0
- },
- metadata_name = "chest",
-})]]
-
--
-- TNT (not functional)
--
minetest.register_craft({
- output = 'node "experimental:tnt" 4',
+ output = 'experimental:tnt',
recipe = {
- {'node "default:wood" 1'},
- {'craft "default:coal_lump" 1'},
- {'node "default:wood" 1'}
+ {'default:wood'},
+ {'default:coal_lump'},
+ {'default:wood'}
}
})
@@ -363,7 +332,7 @@ function TNT:on_punch(hitter)
self.health = self.health - 1
if self.health <= 0 then
self.object:remove()
- hitter:add_to_inventory("node TNT 1")
+ hitter:get_inventory():add_item("main", "experimental:tnt")
hitter:set_hp(hitter:get_hp() - 1)
end
end
@@ -380,7 +349,7 @@ end
minetest.register_entity("experimental:tnt", TNT)
-- Add TNT's old name also
-minetest.alias_node("TNT", "experimental:tnt")
+minetest.register_alias("TNT", "experimental:tnt")
--
-- A test entity for testing animated and yaw-modulated sprites
@@ -547,6 +516,7 @@ minetest.register_abm({
end,
})--]]
+print("experimental modname="..dump(minetest.get_current_modname()))
print("experimental modpath="..dump(minetest.get_modpath("experimental")))
-- END