mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-06-28 06:11:47 +02:00
Move MFF-only craft recipes, craftitems, mapgen to [mff_classic]
Also fixes aliasing...
This commit is contained in:
@ -1,5 +1,15 @@
|
||||
local modname = minetest.get_current_modname()
|
||||
|
||||
local alias
|
||||
if minetest.setting_get(modname .. '.output_alias_list') == 'true' then
|
||||
alias = function(from, to)
|
||||
minetest.log('action', "[" .. modname .. "] " .. from .. " -> " .. to)
|
||||
minetest.register_alias(from, to)
|
||||
end
|
||||
else
|
||||
alias = minetest.register_alias
|
||||
end
|
||||
|
||||
do -- default
|
||||
local aliases = {
|
||||
'mg_cherry_sapling', 'acid_source', 'acid_flowing', 'sand_source', 'sand_flowing',
|
||||
@ -9,12 +19,12 @@ do -- default
|
||||
'desert_stone_with_silver', 'silverblock', 'meze', 'stone_with_mithril', 'mithrilblock',
|
||||
'stone_with_coin', 'ladder_obsidian', 'fence_cobble', 'fence_desert_cobble',
|
||||
'fence_steelblock', 'fence_brick', 'nyancat', 'nyancat_rainbow', 'obsidian_cooled',
|
||||
'cobble_cooled'
|
||||
'cobble_cooled', 'scorched_stuff'
|
||||
}
|
||||
for node in pairs(aliases) do
|
||||
minetest.register_alias('default:' .. node, modname .. ':' .. node)
|
||||
for _, node in pairs(aliases) do
|
||||
alias('default:' .. node, modname .. ':' .. node)
|
||||
end
|
||||
minetest.register_alias('default:meze_block', modname .. ':meze')
|
||||
alias('default:meze_block', modname .. ':meze')
|
||||
end
|
||||
|
||||
do -- moreores
|
||||
@ -23,18 +33,19 @@ do -- moreores
|
||||
'sword_silver', 'sword_mithril', 'mithril_ingot', 'silver_ingot', 'tin_ingot', 'mithril_lump',
|
||||
'silver_lump', 'tin_lump'
|
||||
}
|
||||
for node in pairs(aliases) do
|
||||
minetest.register_alias('moreores:' .. node, modname .. ':' .. node)
|
||||
for _, node in pairs(aliases) do
|
||||
alias('moreores:' .. node, modname .. ':' .. node)
|
||||
alias('default:' .. node, modname .. ':' .. node)
|
||||
end
|
||||
minetest.register_alias('mineral_silver', modname .. ':stone_with_silver')
|
||||
minetest.register_alias('mineral_tin', modname .. ':stone_with_tin')
|
||||
minetest.register_alias('mineral_mithril', modname .. ':stone_with_mithril')
|
||||
minetest.register_alias('mithril_block', modname .. ':mithrilblock')
|
||||
minetest.register_alias('silver_block', modname .. ':silverblock')
|
||||
minetest.register_alias('tin_block', modname .. ':tinblock')
|
||||
alias('mineral_silver', modname .. ':stone_with_silver')
|
||||
alias('mineral_tin', modname .. ':stone_with_tin')
|
||||
alias('mineral_mithril', modname .. ':stone_with_mithril')
|
||||
alias('mithril_block', modname .. ':mithrilblock')
|
||||
alias('silver_block', modname .. ':silverblock')
|
||||
alias('tin_block', modname .. ':tinblock')
|
||||
end
|
||||
|
||||
minetest.register_alias('bucket_acid', modname .. ':bucket_acid')
|
||||
minetest.register_alias('bucket:bucket_acid', modname .. ':bucket_acid')
|
||||
minetest.register_alias('bucket_sand', modname .. ':bucket_sand')
|
||||
minetest.register_alias('bucket:bucket_sand', modname .. ':bucket_sand')
|
||||
alias('bucket_acid', modname .. ':bucket_acid')
|
||||
alias('bucket:bucket_acid', modname .. ':bucket_acid')
|
||||
alias('bucket_sand', modname .. ':bucket_sand')
|
||||
alias('bucket:bucket_sand', modname .. ':bucket_sand')
|
||||
|
316
mods/mff/mff_classic/crafting.lua
Normal file
316
mods/mff/mff_classic/crafting.lua
Normal file
@ -0,0 +1,316 @@
|
||||
local modname = minetest.get_current_modname()
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
output = modname .. ':mithril_ingot',
|
||||
recipe = modname .. ':mithril_lump',
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
output = modname .. ':clay_burned',
|
||||
recipe = 'default:clay',
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'fuel',
|
||||
recipe = 'group:stick',
|
||||
burntime = 1,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
output = modname .. ':tin_ingot',
|
||||
recipe = modname .. ':tin_lump',
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'cooking',
|
||||
output = modname .. ':silver_ingot',
|
||||
recipe = modname .. ':silver_lump',
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':pick_silver',
|
||||
recipe = {
|
||||
{modname .. ':silver_ingot', modname .. ':silver_ingot', modname .. ':silver_ingot'},
|
||||
{'', 'group:stick', ''},
|
||||
{'', 'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':pick_gold',
|
||||
recipe = {
|
||||
{modname .. ':gold_ingot', modname .. ':gold_ingot', modname .. ':gold_ingot'},
|
||||
{'', 'group:stick', ''},
|
||||
{'', 'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'maptools:superapple',
|
||||
type = 'shapeless',
|
||||
recipe = {'default:apple', 'default:mese', 'default:mese'},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':cherry_plank 6',
|
||||
recipe = {
|
||||
{modname .. ':cherry_log'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':pick_mithril',
|
||||
recipe = {
|
||||
{modname .. ':mithril_ingot', modname .. ':mithril_ingot', modname .. ':mithril_ingot'},
|
||||
{'', 'group:stick', ''},
|
||||
{'', 'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':pick_nyan',
|
||||
recipe = {
|
||||
{modname .. ':nyancat', modname .. ':nyancat', modname .. ':nyancat'},
|
||||
{'', 'group:stick', ''},
|
||||
{'', 'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':shovel_silver',
|
||||
recipe = {
|
||||
{modname .. ':silver_ingot'},
|
||||
{'group:stick'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':shovel_gold',
|
||||
recipe = {
|
||||
{'default:gold_ingot'},
|
||||
{'group:stick'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':shovel_mithril',
|
||||
recipe = {
|
||||
{modname .. ':mithril_ingot'},
|
||||
{'group:stick'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':shovel_nyan',
|
||||
recipe = {
|
||||
{modname .. ':nyancat'},
|
||||
{'group:stick'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':axe_silver',
|
||||
recipe = {
|
||||
{modname .. ':silver_ingot', modname .. ':silver_ingot'},
|
||||
{modname .. ':silver_ingot', 'group:stick'},
|
||||
{'', 'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':axe_gold',
|
||||
recipe = {
|
||||
{modname .. ':gold_ingot', modname .. ':gold_ingot'},
|
||||
{modname .. ':gold_ingot', 'group:stick'},
|
||||
{'', 'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':axe_mithril',
|
||||
recipe = {
|
||||
{modname .. ':mithril_ingot', modname .. ':mithril_ingot'},
|
||||
{modname .. ':mithril_ingot', 'group:stick'},
|
||||
{'', 'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':axe_nyan',
|
||||
recipe = {
|
||||
{modname .. ':nyancat', modname .. ':nyancat'},
|
||||
{modname .. ':nyancat', 'group:stick'},
|
||||
{'', 'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':axe_silver',
|
||||
recipe = {
|
||||
{modname .. ':silver_ingot', modname .. ':silver_ingot'},
|
||||
{'group:stick', modname .. ':silver_ingot'},
|
||||
{'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':axe_gold',
|
||||
recipe = {
|
||||
{'default:gold_ingot', 'default:gold_ingot'},
|
||||
{'group:stick', 'default:gold_ingot'},
|
||||
{'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':axe_mithril',
|
||||
recipe = {
|
||||
{modname .. ':mithril_ingot', modname .. ':mithril_ingot'},
|
||||
{'group:stick', modname .. ':mithril_ingot'},
|
||||
{'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':axe_nyan',
|
||||
recipe = {
|
||||
{modname .. ':nyancat', modname .. ':nyancat'},
|
||||
{'group:stick', modname .. ':nyancat'},
|
||||
{'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':sword_silver',
|
||||
recipe = {
|
||||
{modname .. ':silver_ingot'},
|
||||
{modname .. ':silver_ingot'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':sword_gold',
|
||||
recipe = {
|
||||
{'default:gold_ingot'},
|
||||
{'default:gold_ingot'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':sword_mithril',
|
||||
recipe = {
|
||||
{modname .. ':mithril_ingot'},
|
||||
{modname .. ':mithril_ingot'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':sword_nyan',
|
||||
recipe = {
|
||||
{modname .. ':nyancat'},
|
||||
{modname .. ':nyancat'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({ -- Ultimate Warrior weapon
|
||||
output = modname .. ':dungeon_master_s_blood_sword',
|
||||
recipe = {
|
||||
{'mobs:dungeon_master_blood', 'nether:white', 'mobs:dungeon_master_blood'},
|
||||
{'mobs:dungeon_master_blood', 'mobs:dungeon_master_diamond', 'mobs:dungeon_master_blood'},
|
||||
{modname .. ':mithrilblock', 'mobs:zombie_tibia', modname .. ':mithril_block'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'shapeless',
|
||||
output = 'default:bronze_ingot 3',
|
||||
recipe = {
|
||||
modname .. ':tin_ingot',
|
||||
'default:copper_ingot',
|
||||
'default:copper_ingot',
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':tinblock',
|
||||
recipe = {
|
||||
{modname .. ':tin_ingot', modname .. ':tin_ingot', modname .. ':tin_ingot'},
|
||||
{modname .. ':tin_ingot', modname .. ':tin_ingot', modname .. ':tin_ingot'},
|
||||
{modname .. ':tin_ingot', modname .. ':tin_ingot', modname .. ':tin_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':tin_ingot 9',
|
||||
recipe = {
|
||||
{modname .. ':tinblock'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':silverblock',
|
||||
recipe = {
|
||||
{modname .. ':silver_ingot', modname .. ':silver_ingot', modname .. ':silver_ingot'},
|
||||
{modname .. ':silver_ingot', modname .. ':silver_ingot', modname .. ':silver_ingot'},
|
||||
{modname .. ':silver_ingot', modname .. ':silver_ingot', modname .. ':silver_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':silver_ingot 9',
|
||||
recipe = {
|
||||
{modname .. ':silverblock'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':mithrilblock',
|
||||
recipe = {
|
||||
{modname .. ':mithril_ingot', modname .. ':mithril_ingot', modname .. ':mithril_ingot'},
|
||||
{modname .. ':mithril_ingot', modname .. ':mithril_ingot', modname .. ':mithril_ingot'},
|
||||
{modname .. ':mithril_ingot', modname .. ':mithril_ingot', modname .. ':mithril_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ':mithril_ingot 9',
|
||||
recipe = {
|
||||
{modname .. ':mithrilblock'},
|
||||
}
|
||||
})
|
||||
|
||||
-- Utility crafts
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:dirt 4',
|
||||
type = 'shapeless',
|
||||
recipe = {'default:gravel', 'default:gravel', 'default:gravel', 'default:gravel'}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:gravel',
|
||||
recipe = {
|
||||
{'default:cobble'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:desert_stone 2',
|
||||
recipe = {
|
||||
{'default:desert_sand', 'default:desert_sand'},
|
||||
{'default:desert_sand', 'default:desert_sand'},
|
||||
}
|
||||
})
|
||||
|
39
mods/mff/mff_classic/craftitems.lua
Normal file
39
mods/mff/mff_classic/craftitems.lua
Normal file
@ -0,0 +1,39 @@
|
||||
local modname = minetest.get_current_modname()
|
||||
|
||||
minetest.register_craftitem(modname .. ':tin_lump', {
|
||||
description = "Tin Lump",
|
||||
inventory_image = 'default_tin_lump.png',
|
||||
})
|
||||
|
||||
minetest.register_craftitem(modname .. ':silver_lump', {
|
||||
description = "Silver Lump",
|
||||
inventory_image = 'default_silver_lump.png',
|
||||
})
|
||||
|
||||
minetest.register_craftitem(modname .. ':mithril_lump', {
|
||||
description = "Mithril Lump",
|
||||
inventory_image = 'default_mithril_lump.png',
|
||||
})
|
||||
|
||||
minetest.register_craftitem(modname .. ':tin_ingot', {
|
||||
description = "Tin Ingot",
|
||||
inventory_image = 'default_tin_ingot.png',
|
||||
groups = {ingot = 1},
|
||||
})
|
||||
|
||||
minetest.register_craftitem(modname .. ':silver_ingot', {
|
||||
description = "Silver Ingot",
|
||||
inventory_image = 'default_silver_ingot.png',
|
||||
groups = {ingot = 1},
|
||||
})
|
||||
|
||||
minetest.register_craftitem(modname .. ':mithril_ingot', {
|
||||
description = "Mithril Ingot",
|
||||
groups = {ingot = 1},
|
||||
inventory_image = 'default_mithril_ingot.png',
|
||||
})
|
||||
|
||||
minetest.register_craftitem(modname .. ':scorched_stuff', {
|
||||
description = "Scorched Stuff",
|
||||
inventory_image = 'default_scorched_stuff.png',
|
||||
})
|
@ -4,11 +4,18 @@ local modpath = minetest.get_modpath(modname)
|
||||
local thismod = {}
|
||||
_G[modname] = thismod
|
||||
|
||||
local start = os.time()
|
||||
minetest.log('action', "[" .. modname .. "] Loading")
|
||||
|
||||
dofile(modpath .. '/aliases.lua')
|
||||
|
||||
dofile(modpath .. '/abms.lua')
|
||||
dofile(modpath .. '/biomes.lua')
|
||||
dofile(modpath .. '/mapgen.lua')
|
||||
dofile(modpath .. '/nodes.lua')
|
||||
dofile(modpath .. '/trees.lua')
|
||||
dofile(modpath .. '/craftitems.lua')
|
||||
dofile(modpath .. '/registers.lua')
|
||||
dofile(modpath .. '/crafting.lua')
|
||||
dofile(modpath .. '/mapgen.lua')
|
||||
|
||||
minetest.log('action', "[" .. modname .. "] Loaded in " .. (os.time() - start) .. " seconds")
|
||||
|
@ -1,4 +1,5 @@
|
||||
local modname = minetest.get_current_modname()
|
||||
local thismod = _G[modname]
|
||||
|
||||
-- Beware of Meze
|
||||
|
||||
@ -134,3 +135,100 @@ minetest.register_ore({
|
||||
y_max = 0,
|
||||
flags = 'absheight',
|
||||
})
|
||||
|
||||
-- Cherry tree
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = 'simple',
|
||||
place_on = 'default:dirt_with_grass"',
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0,
|
||||
scale = 0.005,
|
||||
spread = {x=100, y=100, z=100},
|
||||
seed = 278,
|
||||
octaves = 2,
|
||||
persist = 0.7
|
||||
},
|
||||
decoration = modname .. ':mg_cherry_sapling',
|
||||
height = 1,
|
||||
})
|
||||
|
||||
-- More ores, MORE ORES!!!
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = 'scatter',
|
||||
ore = 'default:stone_with_coal',
|
||||
wherein = 'default:stone',
|
||||
clust_scarcity = 32 * 32 * 32,
|
||||
clust_num_ores = 40,
|
||||
clust_size = 4,
|
||||
y_max = 64,
|
||||
y_min = -30000,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = 'scatter',
|
||||
ore = 'default:stone_with_iron',
|
||||
wherein = 'default:stone',
|
||||
clust_scarcity = 12 * 12 * 12,
|
||||
clust_num_ores = 3,
|
||||
clust_size = 2,
|
||||
y_min = -15,
|
||||
y_max = 2,
|
||||
})
|
||||
|
||||
--
|
||||
-- Generate nyan cats
|
||||
--
|
||||
|
||||
-- All mapgens except singlenode
|
||||
|
||||
function thismod.make_nyancat(pos, facedir, length)
|
||||
local tailvec = {x = 0, y = 0, z = 0}
|
||||
if facedir == 0 then
|
||||
tailvec.z = 1
|
||||
elseif facedir == 1 then
|
||||
tailvec.x = 1
|
||||
elseif facedir == 2 then
|
||||
tailvec.z = -1
|
||||
elseif facedir == 3 then
|
||||
tailvec.x = -1
|
||||
else
|
||||
facedir = 0
|
||||
tailvec.z = 1
|
||||
end
|
||||
local p = {x = pos.x, y = pos.y, z = pos.z}
|
||||
minetest.set_node(p, {name = modname .. ':nyancat', param2 = facedir})
|
||||
for i = 1, length do
|
||||
p.x = p.x + tailvec.x
|
||||
p.z = p.z + tailvec.z
|
||||
minetest.set_node(p, {name = modname .. ':nyancat_rainbow', param2 = facedir})
|
||||
end
|
||||
end
|
||||
|
||||
function thismod.generate_nyancats(minp, maxp, seed)
|
||||
local height_min = -19600
|
||||
local height_max = 30000
|
||||
if maxp.y < height_min or minp.y > height_max then
|
||||
return
|
||||
end
|
||||
local y_min = math.max(minp.y, height_min)
|
||||
local y_max = math.min(maxp.y, height_max)
|
||||
local volume = (maxp.x - minp.x + 1) * (y_max - y_min + 1) * (maxp.z - minp.z + 1)
|
||||
local pr = PseudoRandom(seed + 9324342)
|
||||
local max_num_nyancats = math.floor(volume / (16 * 16 * 16))
|
||||
for i = 1, max_num_nyancats do
|
||||
if pr:next(0, 1000) == 0 then
|
||||
local x0 = pr:next(minp.x, maxp.x)
|
||||
local y0 = pr:next(minp.y, maxp.y)
|
||||
local z0 = pr:next(minp.z, maxp.z)
|
||||
local p0 = {x = x0, y = y0, z = z0}
|
||||
default.make_nyancat(p0, pr:next(0, 3), pr:next(10, 15))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if minetest.setting_get(modname .. '.disable_nyancat_mapgen') ~= 'true' then
|
||||
minetest.register_on_generated(thismod.generate_nyancats)
|
||||
end
|
||||
|
Reference in New Issue
Block a user