minetest-mod-snow/src/crafting.lua

217 lines
4.1 KiB
Lua
Raw Normal View History

2014-06-04 00:34:58 +02:00
--[[
Crafting Sections (in order, top to bottom):
1. Cooking
2. Crafting and Recycling
2014-06-04 00:34:58 +02:00
The crafting recipe for the sled is in the sled.lua file.
~ LazyJ
]]
2014-06-04 00:34:58 +02:00
-- 1. Cooking
2014-06-04 00:34:58 +02:00
--[[
"Cooks_into_ice" is a custom group I assigned to full-sized, snow-stuff nodes
2014-06-04 00:34:58 +02:00
(snow bricks, snow cobble, snow blocks, etc.) so I wouldn't have to write an individual cooking
recipe for each one.
~ LazyJ
]]
2014-06-04 00:34:58 +02:00
minetest.register_craft({
type = "cooking",
cooktime = 12,
output = "default:ice",
recipe = "group:cooks_into_ice",
})
-- 2. Crafting and Recycling
2014-06-04 00:34:58 +02:00
-- Let's make moss craftable so players can more easily create mossycobble and
-- gives another useful purpose to pine needles. ~ LazyJ
minetest.register_craft({
output = "snow:moss",
recipe = {
{"snow:needles", "snow:needles"},
{"snow:needles", "snow:needles"},
},
2014-06-04 00:34:58 +02:00
})
--[[
Most snow biomes are too small to provide enough snow as a building material and
still have enough landscape snow to create the wintry surroundings of a
snow village or castle. So I added this snowblock crafting recipe as a way for
players to increase their snow supply in small increments. I considered making
the output 9 but that would make it all too quick and easy (especially for griefers) to create lots
of snowblocks (and then use them to water-grief by melting the snow blocks).
~ LazyJ
--]]
minetest.register_craft({
type = "shapeless",
output = "default:snowblock 2",
2014-06-04 00:34:58 +02:00
recipe = {
"snow:snow_cobble",
"snow:snow_cobble"
}
2014-06-04 00:34:58 +02:00
})
--[[minetest.register_craft({
2014-06-04 00:34:58 +02:00
type = "shapeless",
output = "default:snowblock 3",
2014-06-04 00:34:58 +02:00
recipe = {
"default:snowblock",
"default:snowblock"
}
})]]
2014-06-04 00:34:58 +02:00
minetest.register_craft({
output = "snow:snow_brick",
recipe = {
{"default:snowblock", "default:snowblock"},
{"default:snowblock", "default:snowblock"}
}
2014-06-04 00:34:58 +02:00
})
-- Why not recycle snow_bricks back into snowblocks? ~ LazyJ
minetest.register_craft({
output = "default:snowblock 4",
recipe = {
{"snow:snow_brick"}
}
})
minetest.register_craft({
output = "snow:ice_brick",
recipe = {
{"default:ice", "default:ice"},
{"default:ice", "default:ice"}
}
})
minetest.register_craft({
output = "snow:snow_cobble 6",
recipe = {
{"snow:ice_brick"}
}
})
--Craft icy snow.
minetest.register_craft({
type = "shapeless",
output = "snow:snow_cobble 6",
recipe = {
"default:snow",
"default:snow",
"default:snow",
"default:snow",
"default:snow",
"default:snow",
"default:ice",
"default:ice",
"default:ice"
}
})
minetest.register_craft({
type = "shapeless",
output = "snow:snow_cobble 4",
recipe = {
"default:snow",
"default:snow",
"default:snow",
"default:snow",
"default:ice",
"default:ice"
}
})
2014-06-04 00:34:58 +02:00
minetest.register_craft({
type = "shapeless",
output = "snow:snow_cobble 2",
recipe = {
"default:snow",
"default:snow",
"default:ice"
}
})
2014-06-04 00:34:58 +02:00
minetest.register_craft({
type = "shapeless",
output = "snow:snow_cobble",
recipe = {
"default:snow",
"default:ice"
}
2014-06-04 00:34:58 +02:00
})
-- Recycle basic, half-block, slabs back into full blocks
-- A little "list" magic here. Instead of writing four crafts I only have to write two. ~ LazyJ
local recycle_default_slabs = {
"ice",
"snowblock",
}
for _, name in pairs(recycle_default_slabs) do
local subname_default = name
-- This craft is for default snowblocks and default ice.
-- 1 crafting recipe handles 2, default blocks. ~ LazyJ
minetest.register_craft({
type = "shapeless",
output = "default:"..subname_default,
recipe = {
"snow:slab_"..subname_default,
"snow:slab_"..subname_default,
2015-05-23 19:53:30 +02:00
}
2014-06-04 00:34:58 +02:00
})
end
-- Similar list magic here too. I couldn't successfully combine these in the first list
-- because we are dealing with slabs/blocks from two different mods, the "Snow" mod and
-- minetest_game's "Default" mod. ~ LazyJ
local recycle_snowmod_slabs = {
"snow_brick",
"snow_cobble",
}
for _, name in pairs(recycle_snowmod_slabs) do
local subname_snowmod = name
-- This craft is for the Snow mod's full-sized blocks.
-- 1 crafting recipe handles 2, or more, Snow mod blocks. ~ LazyJ
minetest.register_craft({
type = "shapeless",
output = "snow:"..subname_snowmod,
recipe = {
"snow:slab_"..subname_snowmod,
"snow:slab_"..subname_snowmod,
2015-05-23 19:53:30 +02:00
}
2014-06-04 00:34:58 +02:00
})
end