mirror of
https://github.com/minetest-mods/i3.git
synced 2025-06-28 06:40:17 +02:00
Move some files
This commit is contained in:
181
tests/test_custom_recipes.lua
Normal file
181
tests/test_custom_recipes.lua
Normal file
@ -0,0 +1,181 @@
|
||||
local mt = ItemStack("default:wood")
|
||||
mt:get_meta():set_string("description", "test wood")
|
||||
mt:get_meta():set_string("color", "green")
|
||||
|
||||
local mt2 = ItemStack("dye:red")
|
||||
mt2:get_meta():set_string("description", "test red")
|
||||
mt2:get_meta():set_string("color", "#ff0")
|
||||
|
||||
minetest.register_craft({
|
||||
output = mt:to_string(),
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"default:wood",
|
||||
mt2:to_string(),
|
||||
},
|
||||
})
|
||||
|
||||
i3.register_craft({
|
||||
result = "default:ladder_wood 2",
|
||||
items = {"default:copper_ingot 7, default:tin_ingot, default:steel_ingot 2"},
|
||||
})
|
||||
|
||||
i3.register_craft({
|
||||
grid = {
|
||||
"X #",
|
||||
" ## ",
|
||||
"X#X#",
|
||||
"X X",
|
||||
},
|
||||
key = {
|
||||
['#'] = "default:wood",
|
||||
['X'] = "default:glass 2",
|
||||
},
|
||||
result = "default:mese 3",
|
||||
})
|
||||
|
||||
i3.register_craft({
|
||||
grid = {
|
||||
"X #",
|
||||
" ## ",
|
||||
"X#X#X",
|
||||
"X X",
|
||||
},
|
||||
key = {
|
||||
['#'] = "default:wood",
|
||||
['X'] = "default:glass",
|
||||
},
|
||||
result = "default:mese 3",
|
||||
})
|
||||
|
||||
i3.register_craft({
|
||||
grid = {
|
||||
"X #",
|
||||
" ## ",
|
||||
"X#X#",
|
||||
"#X#X#",
|
||||
"X X",
|
||||
},
|
||||
key = {
|
||||
['#'] = "default:wood",
|
||||
['X'] = "default:glass",
|
||||
},
|
||||
result = "default:mese 3",
|
||||
})
|
||||
|
||||
i3.register_craft({
|
||||
grid = {
|
||||
"X #",
|
||||
" ## ",
|
||||
"X#X#",
|
||||
"#X#X#",
|
||||
"X X##",
|
||||
},
|
||||
key = {
|
||||
['#'] = "default:wood",
|
||||
['X'] = "default:glass",
|
||||
},
|
||||
result = "default:mese 3",
|
||||
})
|
||||
|
||||
|
||||
i3.register_craft({
|
||||
grid = {
|
||||
"X #",
|
||||
" ## ",
|
||||
"X#X#",
|
||||
"#X#X#",
|
||||
"X X##",
|
||||
" ## ",
|
||||
},
|
||||
key = {
|
||||
['#'] = "default:wood",
|
||||
['X'] = "default:glass",
|
||||
},
|
||||
result = "default:mese 3",
|
||||
})
|
||||
|
||||
i3.register_craft({
|
||||
grid = {
|
||||
"X #",
|
||||
" ## ",
|
||||
"X#X#",
|
||||
"#X#X#",
|
||||
"X X##X",
|
||||
" ## ",
|
||||
},
|
||||
key = {
|
||||
['#'] = "default:wood",
|
||||
['X'] = "default:glass",
|
||||
},
|
||||
result = "default:mese 3",
|
||||
})
|
||||
|
||||
i3.register_craft({
|
||||
grid = {
|
||||
"X #",
|
||||
" ## ",
|
||||
"X#X#",
|
||||
"#X#X#",
|
||||
"X X##X#",
|
||||
" ## ",
|
||||
},
|
||||
key = {
|
||||
['#'] = "default:wood",
|
||||
['X'] = "default:glass",
|
||||
},
|
||||
result = "default:mese 3",
|
||||
})
|
||||
|
||||
i3.register_craft({
|
||||
grid = {
|
||||
"X #",
|
||||
" ## ",
|
||||
"X#X#",
|
||||
"#X#X#",
|
||||
"X X##X#X",
|
||||
" ## ",
|
||||
},
|
||||
key = {
|
||||
['#'] = "default:wood",
|
||||
['X'] = "default:glass",
|
||||
},
|
||||
result = "default:mese 3",
|
||||
})
|
||||
|
||||
i3.register_craft({
|
||||
grid = {
|
||||
"X #",
|
||||
" ## ",
|
||||
"X#X#",
|
||||
"#X#X#",
|
||||
"X X##X#X",
|
||||
" ## ",
|
||||
"#X#X#",
|
||||
"#X#X#",
|
||||
},
|
||||
key = {
|
||||
['#'] = "default:wood",
|
||||
['X'] = "default:glass",
|
||||
},
|
||||
result = "default:mese 3",
|
||||
})
|
||||
|
||||
i3.register_craft({
|
||||
grid = {
|
||||
"X #",
|
||||
" ## ",
|
||||
"X#X#",
|
||||
"#X#X#",
|
||||
"X X##X#X",
|
||||
" ## ",
|
||||
"#X#X#",
|
||||
"#X#X#",
|
||||
"X #",
|
||||
},
|
||||
key = {
|
||||
['#'] = "default:wood",
|
||||
['X'] = "default:glass",
|
||||
},
|
||||
result = "default:mese 3",
|
||||
})
|
8
tests/test_online_recipe.json
Normal file
8
tests/test_online_recipe.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"items": [
|
||||
"default:stone, default:stone, default:stone",
|
||||
"default:stone, , default:stone",
|
||||
"default:stone, default:stone, default:stone"
|
||||
],
|
||||
"result": "default:cobble 16"
|
||||
}
|
49
tests/test_tabs.lua
Normal file
49
tests/test_tabs.lua
Normal file
@ -0,0 +1,49 @@
|
||||
i3.new_tab {
|
||||
name = "test1",
|
||||
description = "Test 1 Test 1",
|
||||
image = "i3_heart.png",
|
||||
|
||||
formspec = function(player, data, fs)
|
||||
fs("label[3,1;Test 1]")
|
||||
end,
|
||||
}
|
||||
|
||||
i3.new_tab {
|
||||
name = "test2",
|
||||
description = "Test 2",
|
||||
image = "i3_mesepick.png",
|
||||
|
||||
formspec = function(player, data, fs)
|
||||
fs("label[3,1;Test 2]")
|
||||
end,
|
||||
}
|
||||
|
||||
i3.new_tab {
|
||||
name = "test3",
|
||||
description = "Test 3",
|
||||
|
||||
access = function(player, data)
|
||||
local name = player:get_player_name()
|
||||
if name == "singleplayer" then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
formspec = function(player, data, fs)
|
||||
fs("label[3,1;Test 3]")
|
||||
end,
|
||||
|
||||
fields = function(player, data, fields)
|
||||
i3.set_fs(player, "label[3,2;Test extra_fs]")
|
||||
end,
|
||||
}
|
||||
|
||||
i3.override_tab("test2", {
|
||||
name = "test2",
|
||||
description = "Test override",
|
||||
image = "i3_mesepick.png",
|
||||
|
||||
formspec = function(player, data, fs)
|
||||
fs("label[3,1;Override!]")
|
||||
end,
|
||||
})
|
Reference in New Issue
Block a user