forked from mtcontrib/columnia
Reindent code.
This commit is contained in:
parent
5385fde565
commit
98fc60bf76
168
init.lua
168
init.lua
@ -4,22 +4,27 @@
|
||||
columnia = {}
|
||||
|
||||
-- The Blueprint
|
||||
minetest.register_craftitem("columnia:blueprint", {
|
||||
minetest.register_craftitem(
|
||||
"columnia:blueprint",
|
||||
{
|
||||
description = "Column Blueprint",
|
||||
inventory_image = "columnia_blueprint.png",
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft(
|
||||
{
|
||||
output = 'columnia:blueprint',
|
||||
recipe = {
|
||||
{'default:paper', 'group:stick', 'default:paper'},
|
||||
{'default:paper', 'default:coal_lump', 'default:paper'},
|
||||
{'default:paper', 'group:stick', 'default:paper'},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
-- Bracket
|
||||
minetest.register_node("columnia:bracket", {
|
||||
minetest.register_node(
|
||||
"columnia:bracket",
|
||||
{
|
||||
description = 'Bracket (Column)',
|
||||
tiles = {"columnia_rusty.png",},
|
||||
drawtype = "nodebox",
|
||||
@ -39,9 +44,10 @@ minetest.register_node("columnia:bracket", {
|
||||
},
|
||||
groups = {choppy=2, oddly_breakable_by_hand=2,},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft(
|
||||
{
|
||||
output = 'columnia:bracket 4',
|
||||
recipe = {
|
||||
{"default:steel_ingot", "columnia:blueprint", ""},
|
||||
@ -49,10 +55,12 @@ minetest.register_craft({
|
||||
{"", "default:steel_ingot", ""},
|
||||
},
|
||||
replacements = {{"columnia:blueprint", "columnia:blueprint"}},
|
||||
})
|
||||
})
|
||||
|
||||
-- Lamp
|
||||
minetest.register_node("columnia:lamp_ceiling", {
|
||||
minetest.register_node(
|
||||
"columnia:lamp_ceiling",
|
||||
{
|
||||
description = "Ceiling Lamp (Column)",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
@ -74,9 +82,10 @@ minetest.register_node("columnia:lamp_ceiling", {
|
||||
},
|
||||
},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft(
|
||||
{
|
||||
output = 'columnia:lamp_ceiling 4',
|
||||
recipe = {
|
||||
{"columnia:blueprint", "default:steel_ingot", ""},
|
||||
@ -84,19 +93,22 @@ minetest.register_craft({
|
||||
{"", "default:glass", ""},
|
||||
},
|
||||
replacements = {{"columnia:blueprint", "columnia:blueprint"}},
|
||||
})
|
||||
})
|
||||
|
||||
-- Rusty_Block
|
||||
|
||||
minetest.register_node("columnia:rusty_block", {
|
||||
minetest.register_node(
|
||||
"columnia:rusty_block",
|
||||
{
|
||||
description = "Rusty Block",
|
||||
tiles = {"columnia_rusty_block.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1,level=2},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft(
|
||||
{
|
||||
output = 'columnia:rusty_block 8',
|
||||
recipe = {
|
||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||
@ -104,12 +116,14 @@ minetest.register_craft({
|
||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||
},
|
||||
replacements = {{"columnia:blueprint", "columnia:blueprint"}},
|
||||
})
|
||||
})
|
||||
|
||||
-- Now the Column
|
||||
-- Node will be called columnia:column_mid_<subname>
|
||||
function columnia.register_column_mid(subname, recipeitem, groups, images, description, sounds)
|
||||
minetest.register_node(":columnia:column_mid_" .. subname, {
|
||||
minetest.register_node(
|
||||
":columnia:column_mid_" .. subname,
|
||||
{
|
||||
description = description,
|
||||
drawtype = "nodebox",
|
||||
tiles = images,
|
||||
@ -157,12 +171,15 @@ function columnia.register_column_mid(subname, recipeitem, groups, images, descr
|
||||
})
|
||||
|
||||
-- for replace ABM
|
||||
minetest.register_node(":columnia:column_mid_" .. subname.."upside_down", {
|
||||
minetest.register_node(
|
||||
":columnia:column_mid_" .. subname.."upside_down",
|
||||
{
|
||||
replace_name = "columnia:column_mid_" .. subname,
|
||||
groups = {slabs_replace=1},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft(
|
||||
{
|
||||
output = 'columnia:column_mid_' .. subname .. ' 2',
|
||||
recipe = {
|
||||
{"", recipeitem, ""},
|
||||
@ -173,10 +190,11 @@ function columnia.register_column_mid(subname, recipeitem, groups, images, descr
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
-- Node will be called columnia:column_top_<subname>
|
||||
function columnia.register_column_top(subname, recipeitem, groups, images, description, sounds)
|
||||
minetest.register_node(":columnia:column_top_" .. subname, {
|
||||
minetest.register_node(
|
||||
":columnia:column_top_" .. subname,
|
||||
{
|
||||
description = description,
|
||||
drawtype = "nodebox",
|
||||
tiles = images,
|
||||
@ -226,12 +244,15 @@ function columnia.register_column_top(subname, recipeitem, groups, images, descr
|
||||
})
|
||||
|
||||
-- for replace ABM
|
||||
minetest.register_node(":columnia:column_top_" .. subname.."upside_down", {
|
||||
minetest.register_node(
|
||||
":columnia:column_top_" .. subname.."upside_down",
|
||||
{
|
||||
replace_name = "columnia:column_top_" .. subname,
|
||||
groups = {slabs_replace=1},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft(
|
||||
{
|
||||
output = 'columnia:column_top_' .. subname .. ' 4',
|
||||
recipe = {
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
@ -244,7 +265,9 @@ end
|
||||
|
||||
-- Node will be called columnia:column_bottom_<subname>
|
||||
function columnia.register_column_bottom(subname, recipeitem, groups, images, description, sounds)
|
||||
minetest.register_node(":columnia:column_bottom_" .. subname, {
|
||||
minetest.register_node(
|
||||
":columnia:column_bottom_" .. subname,
|
||||
{
|
||||
description = description,
|
||||
drawtype = "nodebox",
|
||||
tiles = images,
|
||||
@ -294,12 +317,15 @@ function columnia.register_column_bottom(subname, recipeitem, groups, images, de
|
||||
})
|
||||
|
||||
-- for replace ABM
|
||||
minetest.register_node(":columnia:column_bottom_" .. subname.."upside_down", {
|
||||
minetest.register_node(
|
||||
":columnia:column_bottom_" .. subname.."upside_down",
|
||||
{
|
||||
replace_name = "columnia:column_bottom_" .. subname,
|
||||
groups = {slabs_replace=1},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft(
|
||||
{
|
||||
output = 'columnia:column_bottom_' .. subname .. ' 4',
|
||||
recipe = {
|
||||
{"", "columnia:blueprint", ""},
|
||||
@ -311,7 +337,9 @@ function columnia.register_column_bottom(subname, recipeitem, groups, images, de
|
||||
end
|
||||
-- Node will be called columnia:column_crosslink<subname>
|
||||
function columnia.register_column_crosslink(subname, recipeitem, groups, images, description, sounds)
|
||||
minetest.register_node(":columnia:column_crosslink_" .. subname, {
|
||||
minetest.register_node(
|
||||
":columnia:column_crosslink_" .. subname,
|
||||
{
|
||||
description = description,
|
||||
drawtype = "nodebox",
|
||||
tiles = images,
|
||||
@ -362,12 +390,15 @@ function columnia.register_column_crosslink(subname, recipeitem, groups, images,
|
||||
})
|
||||
|
||||
-- for replace ABM
|
||||
minetest.register_node(":columnia:column_crosslink_" .. subname.."upside_down", {
|
||||
minetest.register_node(
|
||||
":columnia:column_crosslink_" .. subname.."upside_down",
|
||||
{
|
||||
replace_name = "columnia:column_crosslink_" .. subname,
|
||||
groups = {slabs_replace=1},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft(
|
||||
{
|
||||
output = 'columnia:column_crosslink_' .. subname .. ' 4',
|
||||
recipe = {
|
||||
{"", recipeitem, ""},
|
||||
@ -380,7 +411,9 @@ end
|
||||
|
||||
-- Node will be called columnia:column_link<subname>
|
||||
function columnia.register_column_link(subname, recipeitem, groups, images, description, sounds)
|
||||
minetest.register_node(":columnia:column_link_" .. subname, {
|
||||
minetest.register_node(
|
||||
":columnia:column_link_" .. subname,
|
||||
{
|
||||
description = description,
|
||||
drawtype = "nodebox",
|
||||
tiles = images,
|
||||
@ -428,12 +461,15 @@ function columnia.register_column_link(subname, recipeitem, groups, images, desc
|
||||
})
|
||||
|
||||
-- for replace ABM
|
||||
minetest.register_node(":columnia:column_link_" .. subname.."upside_down", {
|
||||
minetest.register_node(
|
||||
":columnia:column_link_" .. subname.."upside_down",
|
||||
{
|
||||
replace_name = "columnia:column_link_" .. subname,
|
||||
groups = {slabs_replace=1},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft(
|
||||
{
|
||||
output = 'columnia:column_link_' .. subname .. ' 2',
|
||||
recipe = {
|
||||
{recipeitem, "columnia:blueprint", recipeitem},
|
||||
@ -446,7 +482,9 @@ end
|
||||
|
||||
-- Node will be called columnia:column_linkdown<subname>
|
||||
function columnia.register_column_linkdown(subname, recipeitem, groups, images, description, sounds)
|
||||
minetest.register_node(":columnia:column_linkdown_" .. subname, {
|
||||
minetest.register_node(
|
||||
":columnia:column_linkdown_" .. subname,
|
||||
{
|
||||
description = description,
|
||||
drawtype = "nodebox",
|
||||
tiles = images,
|
||||
@ -497,12 +535,15 @@ function columnia.register_column_linkdown(subname, recipeitem, groups, images,
|
||||
})
|
||||
|
||||
-- for replace ABM
|
||||
minetest.register_node(":columnia:column_linkdown_" .. subname.."upside_down", {
|
||||
minetest.register_node(
|
||||
":columnia:column_linkdown_" .. subname.."upside_down",
|
||||
{
|
||||
replace_name = "columnia:column_linkdown_" .. subname,
|
||||
groups = {slabs_replace=1},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft(
|
||||
{
|
||||
output = 'columnia:column_linkdown_' .. subname .. ' 3',
|
||||
recipe = {
|
||||
{recipeitem, "columnia:blueprint", recipeitem},
|
||||
@ -524,7 +565,8 @@ function columnia.register_column_ia(subname, recipeitem, groups, images, desc_c
|
||||
columnia.register_column_linkdown(subname, recipeitem, groups, images, desc_column_linkdown, sounds)
|
||||
end
|
||||
|
||||
columnia.register_column_ia("rusty_block", "columnia:rusty_block",
|
||||
columnia.register_column_ia(
|
||||
"rusty_block", "columnia:rusty_block",
|
||||
{cracky=3},
|
||||
{"columnia_rusty_block.png"},
|
||||
"Rusty Column",
|
||||
@ -534,9 +576,10 @@ columnia.register_column_ia("rusty_block", "columnia:rusty_block",
|
||||
"Rusty Column Link",
|
||||
"Rusty Column Linkdown",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
)
|
||||
|
||||
columnia.register_column_ia("stone", "default:stone",
|
||||
columnia.register_column_ia(
|
||||
"stone", "default:stone",
|
||||
{cracky=3},
|
||||
{"default_stone.png"},
|
||||
"Stone Column",
|
||||
@ -546,9 +589,10 @@ columnia.register_column_ia("stone", "default:stone",
|
||||
"Stone Column Link",
|
||||
"Stone Column Linkdown",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
)
|
||||
|
||||
columnia.register_column_ia("stonebrick", "default:stonebrick",
|
||||
columnia.register_column_ia(
|
||||
"stonebrick", "default:stonebrick",
|
||||
{cracky=3},
|
||||
{"default_stone_brick.png"},
|
||||
"Stone Brick Column",
|
||||
@ -558,9 +602,10 @@ columnia.register_column_ia("stonebrick", "default:stonebrick",
|
||||
"Stone Brick Column Link",
|
||||
"Stone Brick Column Linkdown",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
)
|
||||
|
||||
columnia.register_column_ia("desert_stonebrick", "default:desert_stonebrick",
|
||||
columnia.register_column_ia(
|
||||
"desert_stonebrick", "default:desert_stonebrick",
|
||||
{cracky=3},
|
||||
{"default_desert_stone_brick.png"},
|
||||
"Desert Stone Brick Column",
|
||||
@ -570,9 +615,10 @@ columnia.register_column_ia("desert_stonebrick", "default:desert_stonebrick",
|
||||
"Desert Stone Brick Column Link",
|
||||
"Desert Stone Brick Column Linkdown",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
)
|
||||
|
||||
columnia.register_column_ia("desert_stone", "default:desert_stone",
|
||||
columnia.register_column_ia(
|
||||
"desert_stone", "default:desert_stone",
|
||||
{cracky=3},
|
||||
{"default_desert_stone.png"},
|
||||
"Desert Stone Column",
|
||||
@ -582,9 +628,10 @@ columnia.register_column_ia("desert_stone", "default:desert_stone",
|
||||
"Desert Stone Column Link",
|
||||
"Desert Stone Column Linkdown",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
)
|
||||
|
||||
columnia.register_column_ia("cobble", "default:cobble",
|
||||
columnia.register_column_ia(
|
||||
"cobble", "default:cobble",
|
||||
{cracky=3},
|
||||
{"default_cobble.png"},
|
||||
"Cobble Column",
|
||||
@ -594,9 +641,10 @@ columnia.register_column_ia("cobble", "default:cobble",
|
||||
"Cobble Column Link",
|
||||
"Cobble Column Linkdown",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
)
|
||||
|
||||
columnia.register_column_ia("brick", "default:brick",
|
||||
columnia.register_column_ia(
|
||||
"brick", "default:brick",
|
||||
{cracky=3},
|
||||
{"default_brick.png"},
|
||||
"Brick Column",
|
||||
@ -606,9 +654,10 @@ columnia.register_column_ia("brick", "default:brick",
|
||||
"Brick Column Link",
|
||||
"Brick Column Linkdown",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
)
|
||||
|
||||
columnia.register_column_ia("sandstone", "default:sandstone",
|
||||
columnia.register_column_ia(
|
||||
"sandstone", "default:sandstone",
|
||||
{crumbly=2,cracky=2},
|
||||
{"default_sandstone.png"},
|
||||
"Sandstone Column",
|
||||
@ -618,9 +667,10 @@ columnia.register_column_ia("sandstone", "default:sandstone",
|
||||
"Sandstone Column Link",
|
||||
"Sandstone Column Linkdown",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
)
|
||||
|
||||
columnia.register_column_ia("sandstonebrick", "default:sandstonebrick",
|
||||
columnia.register_column_ia(
|
||||
"sandstonebrick", "default:sandstonebrick",
|
||||
{crumbly=2,cracky=2},
|
||||
{"default_sandstone_brick.png"},
|
||||
"Sandstone Brick Column",
|
||||
@ -630,9 +680,10 @@ columnia.register_column_ia("sandstonebrick", "default:sandstonebrick",
|
||||
"Sandstone Brick Column Link",
|
||||
"Sandstone Brick Column Linkdown",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
)
|
||||
|
||||
columnia.register_column_ia("wood", "default:wood",
|
||||
columnia.register_column_ia(
|
||||
"wood", "default:wood",
|
||||
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
{"default_wood.png"},
|
||||
"Wooden Column",
|
||||
@ -643,7 +694,8 @@ columnia.register_column_ia("wood", "default:wood",
|
||||
"Wooden Column Linkdown",
|
||||
default.node_sound_wood_defaults())
|
||||
|
||||
columnia.register_column_ia("junglewood", "default:junglewood",
|
||||
columnia.register_column_ia(
|
||||
"junglewood", "default:junglewood",
|
||||
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
{"default_junglewood.png"},
|
||||
"Junglewood Column",
|
||||
@ -654,7 +706,8 @@ columnia.register_column_ia("junglewood", "default:junglewood",
|
||||
"Junglewood Column Linkdown",
|
||||
default.node_sound_wood_defaults())
|
||||
|
||||
columnia.register_column_ia("pinewood", "default:pine_wood",
|
||||
columnia.register_column_ia(
|
||||
"pinewood", "default:pine_wood",
|
||||
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
{"default_pine_wood.png"},
|
||||
"Pinewood Column",
|
||||
@ -681,7 +734,8 @@ if core.get_modpath( 'moretrees' ) then
|
||||
}
|
||||
for _,t in pairs( morewood ) do
|
||||
print('register: '.. t.name)
|
||||
columnia.register_column_ia( t.name, 'moretrees:' .. t.name ..'_planks',
|
||||
columnia.register_column_ia(
|
||||
t.name, 'moretrees:' .. t.name ..'_planks',
|
||||
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
{ 'moretrees_' .. t.name .. '_wood.png' },
|
||||
t.description .. ' Column',
|
||||
|
Loading…
Reference in New Issue
Block a user