--
-- stackstring manipulation functions
--- example stackstring: 'CraftItem "apple" 4'
--- example item: {type="CraftItem", name="apple"}
--- example item: {type="ToolItem", name="SteelPick", wear="23272"}
+-- example stackstring: 'craft "apple" 4'
+-- example item: {type="craft", name="apple"}
+-- example item: {type="tool", name="SteelPick", wear="23272"}
--
function stackstring_take_item(stackstring)
end
local stacktype = nil
stacktype = string.match(stackstring,
- '([%a%d]+Item[%a%d]*)')
- if stacktype == "NodeItem" or stacktype == "CraftItem" then
+ '([%a%d]+)')
+ if stacktype == "node" or stacktype == "craft" then
local itemtype = nil
local itemname = nil
local itemcount = nil
itemtype, itemname, itemcount = string.match(stackstring,
- '([%a%d]+Item[%a%d]*) "([^"]*)" (%d+)')
+ '([%a%d]+) "([^"]*)" (%d+)')
itemcount = tonumber(itemcount)
if itemcount == 0 then
return '', nil
return itemtype.." \""..itemname.."\" "..(itemcount-1),
{type=itemtype, name=itemname}
end
- elseif stacktype == "ToolItem" then
+ elseif stacktype == "tool" then
local itemtype = nil
local itemname = nil
local itemwear = nil
itemtype, itemname, itemwear = string.match(stackstring,
- '([%a%d]+Item[%a%d]*) "([^"]*)" (%d+)')
+ '([%a%d]+) "([^"]*)" (%d+)')
itemwear = tonumber(itemwear)
return '', {type=itemtype, name=itemname, wear=itemwear}
end
stackstring = stackstring or ''
local stacktype = nil
stacktype = string.match(stackstring,
- '([%a%d]+Item[%a%d]*)')
+ '([%a%d]+)')
stacktype = stacktype or ''
if stacktype ~= '' and stacktype ~= item.type then
return stackstring, false
end
- if item.type == "NodeItem" or item.type == "CraftItem" then
+ if item.type == "node" or item.type == "craft" then
local itemtype = nil
local itemname = nil
local itemcount = nil
itemtype, itemname, itemcount = string.match(stackstring,
- '([%a%d]+Item[%a%d]*) "([^"]*)" (%d+)')
+ '([%a%d]+) "([^"]*)" (%d+)')
itemtype = itemtype or item.type
itemname = itemname or item.name
if itemcount == nil then
end
itemcount = itemcount + 1
return itemtype.." \""..itemname.."\" "..itemcount, true
- elseif item.type == "ToolItem" then
+ elseif item.type == "tool" then
if stacktype ~= nil then
return stackstring, false
end
local itemname = nil
local itemwear = nil
itemtype, itemname, itemwear = string.match(stackstring,
- '([%a%d]+Item[%a%d]*) "([^"]*)" (%d+)')
+ '([%a%d]+) "([^"]*)" (%d+)')
itemwear = tonumber(itemwear)
return itemtype.." \""..itemname.."\" "..itemwear, true
end
local item
local success
- stack, item = stackstring_take_item('NodeItem "TNT" 3')
- assert(stack == 'NodeItem "TNT" 2')
- assert(item.type == 'NodeItem')
+ stack, item = stackstring_take_item('node "TNT" 3')
+ assert(stack == 'node "TNT" 2')
+ assert(item.type == 'node')
assert(item.name == 'TNT')
- stack, item = stackstring_take_item('CraftItem "with spaces" 2')
- assert(stack == 'CraftItem "with spaces" 1')
- assert(item.type == 'CraftItem')
+ stack, item = stackstring_take_item('craft "with spaces" 2')
+ assert(stack == 'craft "with spaces" 1')
+ assert(item.type == 'craft')
assert(item.name == 'with spaces')
- stack, item = stackstring_take_item('CraftItem "with spaces" 1')
+ stack, item = stackstring_take_item('craft "with spaces" 1')
assert(stack == '')
- assert(item.type == 'CraftItem')
+ assert(item.type == 'craft')
assert(item.name == 'with spaces')
- stack, item = stackstring_take_item('CraftItem "s8df2kj3" 0')
+ stack, item = stackstring_take_item('craft "s8df2kj3" 0')
assert(stack == '')
assert(item == nil)
- stack, item = stackstring_take_item('ToolItem "With Spaces" 32487')
+ stack, item = stackstring_take_item('tool "With Spaces" 32487')
assert(stack == '')
- assert(item.type == 'ToolItem')
+ assert(item.type == 'tool')
assert(item.name == 'With Spaces')
assert(item.wear == 32487)
- stack, success = stackstring_put_item('NodeItem "With Spaces" 40',
- {type='NodeItem', name='With Spaces'})
- assert(stack == 'NodeItem "With Spaces" 41')
+ stack, success = stackstring_put_item('node "With Spaces" 40',
+ {type='node', name='With Spaces'})
+ assert(stack == 'node "With Spaces" 41')
assert(success == true)
- stack, success = stackstring_put_item('CraftItem "With Spaces" 40',
- {type='CraftItem', name='With Spaces'})
- assert(stack == 'CraftItem "With Spaces" 41')
+ stack, success = stackstring_put_item('craft "With Spaces" 40',
+ {type='craft', name='With Spaces'})
+ assert(stack == 'craft "With Spaces" 41')
assert(success == true)
- stack, success = stackstring_put_item('ToolItem "With Spaces" 32487',
- {type='ToolItem', name='With Spaces'})
- assert(stack == 'ToolItem "With Spaces" 32487')
+ stack, success = stackstring_put_item('tool "With Spaces" 32487',
+ {type='tool', name='With Spaces'})
+ assert(stack == 'tool "With Spaces" 32487')
assert(success == false)
- stack, success = stackstring_put_item('NodeItem "With Spaces" 40',
- {type='ToolItem', name='With Spaces'})
- assert(stack == 'NodeItem "With Spaces" 40')
+ stack, success = stackstring_put_item('node "With Spaces" 40',
+ {type='tool', name='With Spaces'})
+ assert(stack == 'node "With Spaces" 40')
assert(success == false)
- assert(stackstring_put_stackstring('NodeItem "With Spaces" 2',
- 'NodeItem "With Spaces" 1') == 'NodeItem "With Spaces" 3')
+ assert(stackstring_put_stackstring('node "With Spaces" 2',
+ 'node "With Spaces" 1') == 'node "With Spaces" 3')
end
test_stackstring()
--print("item: " .. dump(item))
--print("placer: " .. dump(placer))
--print("pos: " .. dump(pos))
- minetest.env:add_item(pos, 'CraftItem "' .. item .. '" 1')
+ minetest.env:add_item(pos, 'craft "' .. item .. '" 1')
return true
end
-- {x=num, y=num, z=num}
--
-- stackstring/itemstring: A stack of items in serialized format.
--- eg. 'NodeItem "dirt" 5'
--- eg. 'ToolItem "WPick" 21323'
--- eg. 'CraftItem "apple" 2'
+-- eg. 'node "dirt" 5'
+-- eg. 'tool "WPick" 21323'
+-- eg. 'craft "apple" 2'
--
-- item: A single item in Lua table format.
--- eg. {type="NodeItem", name="dirt"}
+-- eg. {type="node", name="dirt"}
-- ^ a single dirt node
--- eg. {type="ToolItem", name="WPick", wear=21323}
+-- eg. {type="tool", name="WPick", wear=21323}
-- ^ a wooden pick about 1/3 weared out
--- eg. {type="CraftItem", name="apple"}
+-- eg. {type="craft", name="apple"}
-- ^ an apple.
--
-- Global functions:
--
-- Recipe:
-- {
--- output = 'ToolItem "STPick"',
+-- output = 'tool "STPick"',
-- recipe = {
--- {'NodeItem "cobble"', 'NodeItem "cobble"', 'NodeItem "cobble"'},
--- {'', 'CraftItem "Stick"', ''},
--- {'', 'CraftItem "Stick"', ''},
+-- {'node "cobble"', 'node "cobble"', 'node "cobble"'},
+-- {'', 'craft "Stick"', ''},
+-- {'', 'craft "Stick"', ''},
-- }
-- }
--
--
minetest.register_craft({
- output = 'NodeItem "wood" 4',
+ output = 'node "wood" 4',
recipe = {
- {'NodeItem "tree"'},
+ {'node "tree"'},
}
})
minetest.register_craft({
- output = 'CraftItem "Stick" 4',
+ output = 'craft "Stick" 4',
recipe = {
- {'NodeItem "wood"'},
+ {'node "wood"'},
}
})
minetest.register_craft({
- output = 'NodeItem "wooden_fence" 2',
+ output = 'node "wooden_fence" 2',
recipe = {
- {'CraftItem "Stick"', 'CraftItem "Stick"', 'CraftItem "Stick"'},
- {'CraftItem "Stick"', 'CraftItem "Stick"', 'CraftItem "Stick"'},
+ {'craft "Stick"', 'craft "Stick"', 'craft "Stick"'},
+ {'craft "Stick"', 'craft "Stick"', 'craft "Stick"'},
}
})
minetest.register_craft({
- output = 'NodeItem "sign_wall" 1',
+ output = 'node "sign_wall" 1',
recipe = {
- {'NodeItem "wood"', 'NodeItem "wood"', 'NodeItem "wood"'},
- {'NodeItem "wood"', 'NodeItem "wood"', 'NodeItem "wood"'},
- {'', 'CraftItem "Stick"', ''},
+ {'node "wood"', 'node "wood"', 'node "wood"'},
+ {'node "wood"', 'node "wood"', 'node "wood"'},
+ {'', 'craft "Stick"', ''},
}
})
minetest.register_craft({
- output = 'NodeItem "torch" 4',
+ output = 'node "torch" 4',
recipe = {
- {'CraftItem "lump_of_coal"'},
- {'CraftItem "Stick"'},
+ {'craft "lump_of_coal"'},
+ {'craft "Stick"'},
}
})
minetest.register_craft({
- output = 'ToolItem "WPick"',
+ output = 'tool "WPick"',
recipe = {
- {'NodeItem "wood"', 'NodeItem "wood"', 'NodeItem "wood"'},
- {'', 'CraftItem "Stick"', ''},
- {'', 'CraftItem "Stick"', ''},
+ {'node "wood"', 'node "wood"', 'node "wood"'},
+ {'', 'craft "Stick"', ''},
+ {'', 'craft "Stick"', ''},
}
})
minetest.register_craft({
- output = 'ToolItem "STPick"',
+ output = 'tool "STPick"',
recipe = {
- {'NodeItem "cobble"', 'NodeItem "cobble"', 'NodeItem "cobble"'},
- {'', 'CraftItem "Stick"', ''},
- {'', 'CraftItem "Stick"', ''},
+ {'node "cobble"', 'node "cobble"', 'node "cobble"'},
+ {'', 'craft "Stick"', ''},
+ {'', 'craft "Stick"', ''},
}
})
minetest.register_craft({
- output = 'ToolItem "SteelPick"',
+ output = 'tool "SteelPick"',
recipe = {
- {'CraftItem "steel_ingot"', 'CraftItem "steel_ingot"', 'CraftItem "steel_ingot"'},
- {'', 'CraftItem "Stick"', ''},
- {'', 'CraftItem "Stick"', ''},
+ {'craft "steel_ingot"', 'craft "steel_ingot"', 'craft "steel_ingot"'},
+ {'', 'craft "Stick"', ''},
+ {'', 'craft "Stick"', ''},
}
})
minetest.register_craft({
- output = 'ToolItem "MesePick"',
+ output = 'tool "MesePick"',
recipe = {
- {'NodeItem "mese"', 'NodeItem "mese"', 'NodeItem "mese"'},
- {'', 'CraftItem "Stick"', ''},
- {'', 'CraftItem "Stick"', ''},
+ {'node "mese"', 'node "mese"', 'node "mese"'},
+ {'', 'craft "Stick"', ''},
+ {'', 'craft "Stick"', ''},
}
})
minetest.register_craft({
- output = 'ToolItem "WShovel"',
+ output = 'tool "WShovel"',
recipe = {
- {'NodeItem "wood"'},
- {'CraftItem "Stick"'},
- {'CraftItem "Stick"'},
+ {'node "wood"'},
+ {'craft "Stick"'},
+ {'craft "Stick"'},
}
})
minetest.register_craft({
- output = 'ToolItem "STShovel"',
+ output = 'tool "STShovel"',
recipe = {
- {'NodeItem "cobble"'},
- {'CraftItem "Stick"'},
- {'CraftItem "Stick"'},
+ {'node "cobble"'},
+ {'craft "Stick"'},
+ {'craft "Stick"'},
}
})
minetest.register_craft({
- output = 'ToolItem "SteelShovel"',
+ output = 'tool "SteelShovel"',
recipe = {
- {'CraftItem "steel_ingot"'},
- {'CraftItem "Stick"'},
- {'CraftItem "Stick"'},
+ {'craft "steel_ingot"'},
+ {'craft "Stick"'},
+ {'craft "Stick"'},
}
})
minetest.register_craft({
- output = 'ToolItem "WAxe"',
+ output = 'tool "WAxe"',
recipe = {
- {'NodeItem "wood"', 'NodeItem "wood"'},
- {'NodeItem "wood"', 'CraftItem "Stick"'},
- {'', 'CraftItem "Stick"'},
+ {'node "wood"', 'node "wood"'},
+ {'node "wood"', 'craft "Stick"'},
+ {'', 'craft "Stick"'},
}
})
minetest.register_craft({
- output = 'ToolItem "STAxe"',
+ output = 'tool "STAxe"',
recipe = {
- {'NodeItem "cobble"', 'NodeItem "cobble"'},
- {'NodeItem "cobble"', 'CraftItem "Stick"'},
- {'', 'CraftItem "Stick"'},
+ {'node "cobble"', 'node "cobble"'},
+ {'node "cobble"', 'craft "Stick"'},
+ {'', 'craft "Stick"'},
}
})
minetest.register_craft({
- output = 'ToolItem "SteelAxe"',
+ output = 'tool "SteelAxe"',
recipe = {
- {'CraftItem "steel_ingot"', 'CraftItem "steel_ingot"'},
- {'CraftItem "steel_ingot"', 'CraftItem "Stick"'},
- {'', 'CraftItem "Stick"'},
+ {'craft "steel_ingot"', 'craft "steel_ingot"'},
+ {'craft "steel_ingot"', 'craft "Stick"'},
+ {'', 'craft "Stick"'},
}
})
minetest.register_craft({
- output = 'ToolItem "WSword"',
+ output = 'tool "WSword"',
recipe = {
- {'NodeItem "wood"'},
- {'NodeItem "wood"'},
- {'CraftItem "Stick"'},
+ {'node "wood"'},
+ {'node "wood"'},
+ {'craft "Stick"'},
}
})
minetest.register_craft({
- output = 'ToolItem "STSword"',
+ output = 'tool "STSword"',
recipe = {
- {'NodeItem "cobble"'},
- {'NodeItem "cobble"'},
- {'CraftItem "Stick"'},
+ {'node "cobble"'},
+ {'node "cobble"'},
+ {'craft "Stick"'},
}
})
minetest.register_craft({
- output = 'ToolItem "SteelSword"',
+ output = 'tool "SteelSword"',
recipe = {
- {'CraftItem "steel_ingot"'},
- {'CraftItem "steel_ingot"'},
- {'CraftItem "Stick"'},
+ {'craft "steel_ingot"'},
+ {'craft "steel_ingot"'},
+ {'craft "Stick"'},
}
})
minetest.register_craft({
- output = 'NodeItem "rail" 15',
+ output = 'node "rail" 15',
recipe = {
- {'CraftItem "steel_ingot"', '', 'CraftItem "steel_ingot"'},
- {'CraftItem "steel_ingot"', 'CraftItem "Stick"', 'CraftItem "steel_ingot"'},
- {'CraftItem "steel_ingot"', '', 'CraftItem "steel_ingot"'},
+ {'craft "steel_ingot"', '', 'craft "steel_ingot"'},
+ {'craft "steel_ingot"', 'craft "Stick"', 'craft "steel_ingot"'},
+ {'craft "steel_ingot"', '', 'craft "steel_ingot"'},
}
})
minetest.register_craft({
- output = 'NodeItem "chest" 1',
+ output = 'node "chest" 1',
recipe = {
- {'NodeItem "wood"', 'NodeItem "wood"', 'NodeItem "wood"'},
- {'NodeItem "wood"', '', 'NodeItem "wood"'},
- {'NodeItem "wood"', 'NodeItem "wood"', 'NodeItem "wood"'},
+ {'node "wood"', 'node "wood"', 'node "wood"'},
+ {'node "wood"', '', 'node "wood"'},
+ {'node "wood"', 'node "wood"', 'node "wood"'},
}
})
minetest.register_craft({
- output = 'NodeItem "locked_chest" 1',
+ output = 'node "locked_chest" 1',
recipe = {
- {'NodeItem "wood"', 'NodeItem "wood"', 'NodeItem "wood"'},
- {'NodeItem "wood"', 'CraftItem "steel_ingot"', 'NodeItem "wood"'},
- {'NodeItem "wood"', 'NodeItem "wood"', 'NodeItem "wood"'},
+ {'node "wood"', 'node "wood"', 'node "wood"'},
+ {'node "wood"', 'craft "steel_ingot"', 'node "wood"'},
+ {'node "wood"', 'node "wood"', 'node "wood"'},
}
})
minetest.register_craft({
- output = 'NodeItem "furnace" 1',
+ output = 'node "furnace" 1',
recipe = {
- {'NodeItem "cobble"', 'NodeItem "cobble"', 'NodeItem "cobble"'},
- {'NodeItem "cobble"', '', 'NodeItem "cobble"'},
- {'NodeItem "cobble"', 'NodeItem "cobble"', 'NodeItem "cobble"'},
+ {'node "cobble"', 'node "cobble"', 'node "cobble"'},
+ {'node "cobble"', '', 'node "cobble"'},
+ {'node "cobble"', 'node "cobble"', 'node "cobble"'},
}
})
minetest.register_craft({
- output = 'NodeItem "steelblock" 1',
+ output = 'node "steelblock" 1',
recipe = {
- {'CraftItem "steel_ingot"', 'CraftItem "steel_ingot"', 'CraftItem "steel_ingot"'},
- {'CraftItem "steel_ingot"', 'CraftItem "steel_ingot"', 'CraftItem "steel_ingot"'},
- {'CraftItem "steel_ingot"', 'CraftItem "steel_ingot"', 'CraftItem "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"', 'craft "steel_ingot"'},
}
})
minetest.register_craft({
- output = 'NodeItem "sandstone" 1',
+ output = 'node "sandstone" 1',
recipe = {
- {'NodeItem "sand"', 'NodeItem "sand"'},
- {'NodeItem "sand"', 'NodeItem "sand"'},
+ {'node "sand"', 'node "sand"'},
+ {'node "sand"', 'node "sand"'},
}
})
minetest.register_craft({
- output = 'NodeItem "clay" 1',
+ output = 'node "clay" 1',
recipe = {
- {'CraftItem "lump_of_clay"', 'CraftItem "lump_of_clay"'},
- {'CraftItem "lump_of_clay"', 'CraftItem "lump_of_clay"'},
+ {'craft "lump_of_clay"', 'craft "lump_of_clay"'},
+ {'craft "lump_of_clay"', 'craft "lump_of_clay"'},
}
})
minetest.register_craft({
- output = 'NodeItem "brick" 1',
+ output = 'node "brick" 1',
recipe = {
- {'CraftItem "clay_brick"', 'CraftItem "clay_brick"'},
- {'CraftItem "clay_brick"', 'CraftItem "clay_brick"'},
+ {'craft "clay_brick"', 'craft "clay_brick"'},
+ {'craft "clay_brick"', 'craft "clay_brick"'},
}
})
minetest.register_craft({
- output = 'CraftItem "paper" 1',
+ output = 'craft "paper" 1',
recipe = {
- {'NodeItem "papyrus"', 'NodeItem "papyrus"', 'NodeItem "papyrus"'},
+ {'node "papyrus"', 'node "papyrus"', 'node "papyrus"'},
}
})
minetest.register_craft({
- output = 'CraftItem "book" 1',
+ output = 'craft "book" 1',
recipe = {
- {'CraftItem "paper"'},
- {'CraftItem "paper"'},
- {'CraftItem "paper"'},
+ {'craft "paper"'},
+ {'craft "paper"'},
+ {'craft "paper"'},
}
})
minetest.register_craft({
- output = 'NodeItem "bookshelf" 1',
+ output = 'node "bookshelf" 1',
recipe = {
- {'NodeItem "wood"', 'NodeItem "wood"', 'NodeItem "wood"'},
- {'CraftItem "book"', 'CraftItem "book"', 'CraftItem "book"'},
- {'NodeItem "wood"', 'NodeItem "wood"', 'NodeItem "wood"'},
+ {'node "wood"', 'node "wood"', 'node "wood"'},
+ {'craft "book"', 'craft "book"', 'craft "book"'},
+ {'node "wood"', 'node "wood"', 'node "wood"'},
}
})
minetest.register_craft({
- output = 'NodeItem "ladder" 1',
+ output = 'node "ladder" 1',
recipe = {
- {'CraftItem "Stick"', '', 'CraftItem "Stick"'},
- {'CraftItem "Stick"', 'CraftItem "Stick"', 'CraftItem "Stick"'},
- {'CraftItem "Stick"', '', 'CraftItem "Stick"'},
+ {'craft "Stick"', '', 'craft "Stick"'},
+ {'craft "Stick"', 'craft "Stick"', 'craft "Stick"'},
+ {'craft "Stick"', '', 'craft "Stick"'},
}
})
minetest.register_craft({
- output = 'CraftItem "apple_iron" 1',
+ output = 'craft "apple_iron" 1',
recipe = {
- {'', 'CraftItem "steel_ingot"', ''},
- {'CraftItem "steel_ingot"', 'CraftItem "apple"', 'CraftItem "steel_ingot"'},
- {'', 'CraftItem "steel_ingot"', ''},
+ {'', 'craft "steel_ingot"', ''},
+ {'craft "steel_ingot"', 'craft "apple"', 'craft "steel_ingot"'},
+ {'', 'craft "steel_ingot"', ''},
}
})
is_ground_content = true,
often_contains_mineral = true, -- Texture atlas hint
material = digprop_stonelike(1.0),
- dug_item = 'NodeItem "cobble" 1',
+ dug_item = 'node "cobble" 1',
})
minetest.register_node("dirt_with_grass", {
inventory_image = inventorycube("mud.png^grass_side.png"),
is_ground_content = true,
material = digprop_dirtlike(1.0),
- dug_item = 'NodeItem "dirt" 1',
+ dug_item = 'node "dirt" 1',
})
minetest.register_node("dirt_with_grass_footsteps", {
inventory_image = "grass_footsteps.png",
is_ground_content = true,
material = digprop_dirtlike(1.0),
- dug_item = 'NodeItem "dirt" 1',
+ dug_item = 'node "dirt" 1',
})
minetest.register_node("dirt", {
inventory_image = inventorycube("sand.png"),
is_ground_content = true,
material = digprop_dirtlike(1.0),
- cookresult_item = 'NodeItem "glass" 1',
+ cookresult_item = 'node "glass" 1',
})
minetest.register_node("gravel", {
inventory_image = inventorycube("sandstone.png"),
is_ground_content = true,
material = digprop_dirtlike(1.0), -- FIXME should this be stonelike?
- dug_item = 'NodeItem "sand" 1', -- FIXME is this intentional?
+ dug_item = 'node "sand" 1', -- FIXME is this intentional?
})
minetest.register_node("clay", {
inventory_image = inventorycube("clay.png"),
is_ground_content = true,
material = digprop_dirtlike(1.0),
- dug_item = 'CraftItem "lump_of_clay" 4',
+ dug_item = 'craft "lump_of_clay" 4',
})
minetest.register_node("brick", {
inventory_image = inventorycube("brick.png"),
is_ground_content = true,
material = digprop_stonelike(1.0),
- dug_item = 'CraftItem "clay_brick" 4',
+ dug_item = 'craft "clay_brick" 4',
})
minetest.register_node("tree", {
inventory_image = inventorycube("tree_top.png", "tree.png", "tree.png"),
is_ground_content = true,
material = digprop_woodlike(1.0),
- cookresult_item = 'CraftItem "lump_of_coal" 1',
+ cookresult_item = 'craft "lump_of_coal" 1',
furnace_burntime = 30,
})
inventory_image = inventorycube("jungletree_top.png", "jungletree.png", "jungletree.png"),
is_ground_content = true,
material = digprop_woodlike(1.0),
- cookresult_item = 'CraftItem "lump_of_coal" 1',
+ cookresult_item = 'craft "lump_of_coal" 1',
furnace_burntime = 30,
})
light_propagates = true,
paramtype = "light",
material = digprop_leaveslike(1.0),
- extra_dug_item = 'NodeItem "sapling" 1',
+ extra_dug_item = 'node "sapling" 1',
extra_dug_item_rarity = 20,
furnace_burntime = 1,
})
tile_images = {"cobble.png"},
inventory_image = inventorycube("cobble.png"),
is_ground_content = true,
- cookresult_item = 'NodeItem "stone" 1',
+ cookresult_item = 'node "stone" 1',
material = digprop_stonelike(0.9),
})
light_propagates = true,
sunlight_propagates = true,
walkable = false,
- dug_item = 'CraftItem "apple" 1',
+ dug_item = 'craft "apple" 1',
material = digprop_constanttime(0.0),
furnace_burntime = 3,
})
minetest.register_craftitem("lump_of_iron", {
image = "lump_of_iron.png",
- cookresult_item = 'CraftItem "steel_ingot" 1',
+ cookresult_item = 'craft "steel_ingot" 1',
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem("lump_of_clay", {
image = "lump_of_clay.png",
- cookresult_item = 'CraftItem "clay_brick" 1',
+ cookresult_item = 'craft "clay_brick" 1',
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem("rat", {
image = "rat.png",
- cookresult_item = 'CraftItem "cooked_rat" 1',
+ cookresult_item = 'craft "cooked_rat" 1',
on_drop = function(item, dropper, pos)
minetest.env:add_rat(pos)
return true
minetest.register_craftitem("cooked_rat", {
image = "cooked_rat.png",
- cookresult_item = 'CraftItem "scorched_stuff" 1',
+ cookresult_item = 'craft "scorched_stuff" 1',
on_place_on_ground = minetest.craftitem_place_item,
on_use = minetest.craftitem_eat(6),
})