Ability to show or hide Stairs+ nodes in creative inventory, thanks pitriss

This commit is contained in:
Calinou 2013-10-12 19:55:42 +02:00
parent 26e7268a5e
commit 621948c70a
2 changed files with 55 additions and 45 deletions

View File

@ -7,8 +7,11 @@
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- Whether to direct wood based on player yaw when placing the block -- Whether to direct wood based on player yaw when placing the block (true or false)
wood_facedir = true wood_facedir = true
-- Allow stair/slab crafting without a circular saw or not -- Allow stair/slab crafting without a circular saw or not (true or false)
allow_stair_slab_crafting = true allow_stair_slab_crafting = true
-- Show stairs/slabs/panels/microblocks in creative inventory (true or false)
show_stairsplus_creative_inv = false

View File

@ -1,3 +1,5 @@
dofile(minetest.get_modpath("moreblocks").."/_config.txt")
-- Nodes will be called <modname>:{stair,slab,panel,micro}_<subname> -- Nodes will be called <modname>:{stair,slab,panel,micro}_<subname>
if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then
@ -149,150 +151,155 @@ function stairsplus_rotate_and_place(itemstack, placer, pointed_thing, onwall)
end end
function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, images, description, drop, light) function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, images, description, drop, light)
register_stair(modname, subname, recipeitem, groups, images, description, drop, light) if show_stairsplus_creative_inv then
register_slab( modname, subname, recipeitem, groups, images, description, drop, light) groups.not_in_creative_inventory = 0
register_panel(modname, subname, recipeitem, groups, images, description, drop, light) else
register_micro(modname, subname, recipeitem, groups, images, description, drop, light) groups.not_in_creative_inventory = 1
register_6dfacedir_conversion(modname, subname) end
register_stair(modname, subname, recipeitem, groups, images, description, drop, light)
register_slab( modname, subname, recipeitem, groups, images, description, drop, light)
register_panel(modname, subname, recipeitem, groups, images, description, drop, light)
register_micro(modname, subname, recipeitem, groups, images, description, drop, light)
register_6dfacedir_conversion(modname, subname)
end end
-- Default stairs/slabs/panels/microblocks -- Default stairs/slabs/panels/microblocks
register_stair_slab_panel_micro("moreblocks", "wood", "default:wood", register_stair_slab_panel_micro("moreblocks", "wood", "default:wood",
{not_in_creative_inventory=1,snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
{"default_wood.png"}, {"default_wood.png"},
"Wooden", "Wooden",
"wood", "wood",
0) 0)
register_stair_slab_panel_micro("moreblocks", "stone", "default:stone", register_stair_slab_panel_micro("moreblocks", "stone", "default:stone",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"default_stone.png"}, {"default_stone.png"},
"Stone", "Stone",
"cobble", "cobble",
0) 0)
register_stair_slab_panel_micro("moreblocks", "cobble", "default:cobble", register_stair_slab_panel_micro("moreblocks", "cobble", "default:cobble",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"default_cobble.png"}, {"default_cobble.png"},
"Cobblestone", "Cobblestone",
"cobble", "cobble",
0) 0)
register_stair_slab_panel_micro("moreblocks", "mossycobble", "default:mossycobble", register_stair_slab_panel_micro("moreblocks", "mossycobble", "default:mossycobble",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"default_mossycobble.png"}, {"default_mossycobble.png"},
"Mossy Cobblestone", "Mossy Cobblestone",
"mossycobble", "mossycobble",
0) 0)
register_stair_slab_panel_micro("moreblocks", "brick", "default:brick", register_stair_slab_panel_micro("moreblocks", "brick", "default:brick",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"default_brick.png"}, {"default_brick.png"},
"Brick", "Brick",
"brick", "brick",
0) 0)
register_stair_slab_panel_micro("moreblocks", "sandstone", "default:sandstone", register_stair_slab_panel_micro("moreblocks", "sandstone", "default:sandstone",
{not_in_creative_inventory=1,crumbly=2,cracky=2}, {crumbly=2,cracky=2},
{"default_sandstone.png"}, {"default_sandstone.png"},
"Sandstone", "Sandstone",
"sandstone", "sandstone",
0) 0)
register_stair_slab_panel_micro("moreblocks", "steelblock", "default:steelblock", register_stair_slab_panel_micro("moreblocks", "steelblock", "default:steelblock",
{not_in_creative_inventory=1,cracky=1,level=2}, {cracky=1,level=2},
{"default_steel_block.png"}, {"default_steel_block.png"},
"Steel Block", "Steel Block",
"steelblock", "steelblock",
0) 0)
register_stair_slab_panel_micro("moreblocks", "goldblock", "default:goldblock", register_stair_slab_panel_micro("moreblocks", "goldblock", "default:goldblock",
{not_in_creative_inventory=1,cracky=1}, {cracky=1},
{"default_gold_block.png"}, {"default_gold_block.png"},
"Gold Block", "Gold Block",
"goldblock", "goldblock",
0) 0)
register_stair_slab_panel_micro("moreblocks", "copperblock", "default:copperblock", register_stair_slab_panel_micro("moreblocks", "copperblock", "default:copperblock",
{not_in_creative_inventory=1,cracky=1,level=2}, {cracky=1,level=2},
{"default_copper_block.png"}, {"default_copper_block.png"},
"Copper Block", "Copper Block",
"copperblock", "copperblock",
0) 0)
register_stair_slab_panel_micro("moreblocks", "bronzeblock", "default:bronzeblock", register_stair_slab_panel_micro("moreblocks", "bronzeblock", "default:bronzeblock",
{not_in_creative_inventory=1,cracky=1,level=2}, {cracky=1,level=2},
{"default_bronze_block.png"}, {"default_bronze_block.png"},
"Bronze Block", "Bronze Block",
"bronzeblock", "bronzeblock",
0) 0)
register_stair_slab_panel_micro("moreblocks", "diamondblock", "default:diamondblock", register_stair_slab_panel_micro("moreblocks", "diamondblock", "default:diamondblock",
{not_in_creative_inventory=1,cracky=1,level=3}, {cracky=1,level=3},
{"default_diamond_block.png"}, {"default_diamond_block.png"},
"Diamond Block", "Diamond Block",
"diamondblock", "diamondblock",
0) 0)
register_stair_slab_panel_micro("moreblocks", "desert_stone", "default:desert_stone", register_stair_slab_panel_micro("moreblocks", "desert_stone", "default:desert_stone",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"default_desert_stone.png"}, {"default_desert_stone.png"},
"Desert Stone", "Desert Stone",
"desert_stone", "desert_stone",
0) 0)
register_stair_slab_panel_micro("moreblocks", "glass", "default:glass", register_stair_slab_panel_micro("moreblocks", "glass", "default:glass",
{not_in_creative_inventory=1,snappy=2,cracky=3,oddly_breakable_by_hand=3}, {snappy=2,cracky=3,oddly_breakable_by_hand=3},
{"moreblocks_glass_stairsplus.png"}, {"moreblocks_glass_stairsplus.png"},
"Glass", "Glass",
"glass", "glass",
0) 0)
register_stair_slab_panel_micro("moreblocks", "tree", "default:tree", register_stair_slab_panel_micro("moreblocks", "tree", "default:tree",
{not_in_creative_inventory=1,tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
{"default_tree_top.png", "default_tree_top.png", "default_tree.png"}, {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
"Tree", "Tree",
"tree", "tree",
0) 0)
register_stair_slab_panel_micro("moreblocks", "jungletree", "default:jungletree", register_stair_slab_panel_micro("moreblocks", "jungletree", "default:jungletree",
{not_in_creative_inventory=1,tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
{"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"}, {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"},
"Jungle Tree", "Jungle Tree",
"jungletree", "jungletree",
0) 0)
register_stair_slab_panel_micro("moreblocks", "obsidian", "default:obsidian", register_stair_slab_panel_micro("moreblocks", "obsidian", "default:obsidian",
{not_in_creative_inventory=1,cracky=1,level=2}, {cracky=1,level=2},
{"default_obsidian.png"}, {"default_obsidian.png"},
"Obsidian", "Obsidian",
"obsidian", "obsidian",
0) 0)
register_stair_slab_panel_micro("moreblocks", "obsidian_glass", "default:obsidian_glass", register_stair_slab_panel_micro("moreblocks", "obsidian_glass", "default:obsidian_glass",
{not_in_creative_inventory=1,cracky=3,oddly_breakable_by_hand=3}, {cracky=3,oddly_breakable_by_hand=3},
{"moreblocks_obsidian_glass_stairsplus.png"}, {"moreblocks_obsidian_glass_stairsplus.png"},
"Obsidian Glass", "Obsidian Glass",
"obsidian_glass", "obsidian_glass",
0) 0)
register_stair_slab_panel_micro("moreblocks", "stonebrick", "default:stonebrick", register_stair_slab_panel_micro("moreblocks", "stonebrick", "default:stonebrick",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"default_stone_brick.png"}, {"default_stone_brick.png"},
"Stone Bricks", "Stone Bricks",
"stone_bricks", "stone_bricks",
0) 0)
register_stair_slab_panel_micro("moreblocks", "desert_stonebrick", "default:desert_stonebrick", register_stair_slab_panel_micro("moreblocks", "desert_stonebrick", "default:desert_stonebrick",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"default_desert_stone_brick.png"}, {"default_desert_stone_brick.png"},
"Desert Stone Bricks", "Desert Stone Bricks",
"desert_stonebrick", "desert_stonebrick",
0) 0)
register_stair_slab_panel_micro("moreblocks", "sandstonebrick", "default:sandstonebrick", register_stair_slab_panel_micro("moreblocks", "sandstonebrick", "default:sandstonebrick",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"default_sandstone_brick.png"}, {"default_sandstone_brick.png"},
"Sandstone Bricks", "Sandstone Bricks",
"sandstonebrick", "sandstonebrick",
@ -301,42 +308,42 @@ register_stair_slab_panel_micro("moreblocks", "sandstonebrick", "default:sandsto
-- More Blocks stairs/slabs/panels/microblocks -- More Blocks stairs/slabs/panels/microblocks
register_stair_slab_panel_micro("moreblocks", "circle_stone_bricks", "moreblocks:circle_stone_bricks", register_stair_slab_panel_micro("moreblocks", "circle_stone_bricks", "moreblocks:circle_stone_bricks",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"moreblocks_circle_stone_bricks.png"}, {"moreblocks_circle_stone_bricks.png"},
"Circle Stone Bricks", "Circle Stone Bricks",
"circle_stone_bricks", "circle_stone_bricks",
0) 0)
register_stair_slab_panel_micro("moreblocks", "iron_stone_bricks", "moreblocks:iron_stone_bricks", register_stair_slab_panel_micro("moreblocks", "iron_stone_bricks", "moreblocks:iron_stone_bricks",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"moreblocks_iron_stone_bricks.png"}, {"moreblocks_iron_stone_bricks.png"},
"Iron Stone Bricks", "Iron Stone Bricks",
"iron_stone_bricks", "iron_stone_bricks",
0) 0)
register_stair_slab_panel_micro("moreblocks", "stone_tile", "moreblocks:stone_tile", register_stair_slab_panel_micro("moreblocks", "stone_tile", "moreblocks:stone_tile",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"moreblocks_stone_tile.png"}, {"moreblocks_stone_tile.png"},
"Stonesquare", "Stonesquare",
"stone_tile", "stone_tile",
0) 0)
register_stair_slab_panel_micro("moreblocks", "split_stone_tile", "moreblocks:split_stone_tile", register_stair_slab_panel_micro("moreblocks", "split_stone_tile", "moreblocks:split_stone_tile",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"moreblocks_split_stone_tile_top.png", "moreblocks_split_stone_tile.png"}, {"moreblocks_split_stone_tile_top.png", "moreblocks_split_stone_tile.png"},
"Split Stonesquare", "Split Stonesquare",
"split_stone_tile", "split_stone_tile",
0) 0)
register_stair_slab_panel_micro("moreblocks", "jungle_wood", "default:junglewood", register_stair_slab_panel_micro("moreblocks", "jungle_wood", "default:junglewood",
{not_in_creative_inventory=1,snappy=1, choppy=2, oddly_breakable_by_hand=2,flammable=3}, {snappy=1, choppy=2, oddly_breakable_by_hand=2,flammable=3},
{"default_junglewood.png"}, {"default_junglewood.png"},
"Jungle Wood", "Jungle Wood",
"jungle_wood", "jungle_wood",
0) 0)
register_stair_slab_panel_micro("moreblocks", "plankstone", "moreblocks:plankstone", register_stair_slab_panel_micro("moreblocks", "plankstone", "moreblocks:plankstone",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"moreblocks_plankstone.png", "moreblocks_plankstone.png", "moreblocks_plankstone.png", {"moreblocks_plankstone.png", "moreblocks_plankstone.png", "moreblocks_plankstone.png",
"moreblocks_plankstone.png", "moreblocks_plankstone.png^[transformR90", "moreblocks_plankstone.png^[transformR90"}, "moreblocks_plankstone.png", "moreblocks_plankstone.png^[transformR90", "moreblocks_plankstone.png^[transformR90"},
"Plankstone", "Plankstone",
@ -344,7 +351,7 @@ register_stair_slab_panel_micro("moreblocks", "plankstone", "moreblocks:planksto
0) 0)
register_stair_slab_panel_micro("moreblocks", "coal_checker", "moreblocks:coal_checker", register_stair_slab_panel_micro("moreblocks", "coal_checker", "moreblocks:coal_checker",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"moreblocks_coal_checker.png", "moreblocks_coal_checker.png", "moreblocks_coal_checker.png", {"moreblocks_coal_checker.png", "moreblocks_coal_checker.png", "moreblocks_coal_checker.png",
"moreblocks_coal_checker.png", "moreblocks_coal_checker.png^[transformR90", "moreblocks_coal_checker.png^[transformR90"}, "moreblocks_coal_checker.png", "moreblocks_coal_checker.png^[transformR90", "moreblocks_coal_checker.png^[transformR90"},
"Coal Checker", "Coal Checker",
@ -352,7 +359,7 @@ register_stair_slab_panel_micro("moreblocks", "coal_checker", "moreblocks:coal_c
0) 0)
register_stair_slab_panel_micro("moreblocks", "iron_checker", "moreblocks:iron_checker", register_stair_slab_panel_micro("moreblocks", "iron_checker", "moreblocks:iron_checker",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"moreblocks_iron_checker.png", "moreblocks_iron_checker.png", "moreblocks_iron_checker.png", {"moreblocks_iron_checker.png", "moreblocks_iron_checker.png", "moreblocks_iron_checker.png",
"moreblocks_iron_checker.png", "moreblocks_iron_checker.png^[transformR90", "moreblocks_iron_checker.png^[transformR90"}, "moreblocks_iron_checker.png", "moreblocks_iron_checker.png^[transformR90", "moreblocks_iron_checker.png^[transformR90"},
"Iron Checker", "Iron Checker",
@ -360,7 +367,7 @@ register_stair_slab_panel_micro("moreblocks", "iron_checker", "moreblocks:iron_c
0) 0)
register_stair_slab_panel_micro("moreblocks", "cactus_checker", "moreblocks:cactus_checker", register_stair_slab_panel_micro("moreblocks", "cactus_checker", "moreblocks:cactus_checker",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"moreblocks_cactus_checker.png", "moreblocks_cactus_checker.png", "moreblocks_cactus_checker.png", {"moreblocks_cactus_checker.png", "moreblocks_cactus_checker.png", "moreblocks_cactus_checker.png",
"moreblocks_cactus_checker.png", "moreblocks_cactus_checker.png^[transformR90", "moreblocks_cactus_checker.png^[transformR90"}, "moreblocks_cactus_checker.png", "moreblocks_cactus_checker.png^[transformR90", "moreblocks_cactus_checker.png^[transformR90"},
"Cactus Checker", "Cactus Checker",
@ -368,49 +375,49 @@ register_stair_slab_panel_micro("moreblocks", "cactus_checker", "moreblocks:cact
0) 0)
register_stair_slab_panel_micro("moreblocks", "coal_stone", "moreblocks:coal_stone", register_stair_slab_panel_micro("moreblocks", "coal_stone", "moreblocks:coal_stone",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"moreblocks_coal_stone.png"}, {"moreblocks_coal_stone.png"},
"Coal Stone", "Coal Stone",
"coal_stone", "coal_stone",
0) 0)
register_stair_slab_panel_micro("moreblocks", "iron_stone", "moreblocks:iron_stone", register_stair_slab_panel_micro("moreblocks", "iron_stone", "moreblocks:iron_stone",
{not_in_creative_inventory=1,cracky=3}, {cracky=3},
{"moreblocks_iron_stone.png"}, {"moreblocks_iron_stone.png"},
"Iron Stone", "Iron Stone",
"iron_stone", "iron_stone",
0) 0)
register_stair_slab_panel_micro("moreblocks", "glow_glass", "moreblocks:glow_glass", register_stair_slab_panel_micro("moreblocks", "glow_glass", "moreblocks:glow_glass",
{not_in_creative_inventory=1,snappy=2,cracky=3,oddly_breakable_by_hand=3}, {snappy=2,cracky=3,oddly_breakable_by_hand=3},
{"moreblocks_glow_glass_stairsplus.png"}, {"moreblocks_glow_glass_stairsplus.png"},
"Glow Glass", "Glow Glass",
"glow_glass", "glow_glass",
11) 11)
register_stair_slab_panel_micro("moreblocks", "super_glow_glass", "moreblocks:super_glow_glass", register_stair_slab_panel_micro("moreblocks", "super_glow_glass", "moreblocks:super_glow_glass",
{not_in_creative_inventory=1,snappy=2, cracky=3, oddly_breakable_by_hand=3}, {snappy=2, cracky=3, oddly_breakable_by_hand=3},
{"moreblocks_super_glow_glass_stairsplus.png"}, {"moreblocks_super_glow_glass_stairsplus.png"},
"Super Glow Glass", "Super Glow Glass",
"super_glow_glass", "super_glow_glass",
15) 15)
register_stair_slab_panel_micro("moreblocks", "coal_glass", "moreblocks:coal_glass", register_stair_slab_panel_micro("moreblocks", "coal_glass", "moreblocks:coal_glass",
{not_in_creative_inventory=1,snappy=2, cracky=3, oddly_breakable_by_hand=3}, {snappy=2, cracky=3, oddly_breakable_by_hand=3},
{"moreblocks_coal_glass_stairsplus.png"}, {"moreblocks_coal_glass_stairsplus.png"},
"Coal Glass", "Coal Glass",
"coal_glass", "coal_glass",
0) 0)
register_stair_slab_panel_micro("moreblocks", "iron_glass", "moreblocks:iron_glass", register_stair_slab_panel_micro("moreblocks", "iron_glass", "moreblocks:iron_glass",
{not_in_creative_inventory=1,snappy=2,cracky=3,oddly_breakable_by_hand=3}, {snappy=2,cracky=3,oddly_breakable_by_hand=3},
{"moreblocks_iron_glass_stairsplus.png"}, {"moreblocks_iron_glass_stairsplus.png"},
"Iron Glass", "Iron Glass",
"iron_glass", "iron_glass",
0) 0)
register_stair_slab_panel_micro("moreblocks", "wood_tile", "moreblocks:wood_tile", register_stair_slab_panel_micro("moreblocks", "wood_tile", "moreblocks:wood_tile",
{not_in_creative_inventory=1,snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
{"moreblocks_wood_tile.png", "moreblocks_wood_tile.png", "moreblocks_wood_tile.png", {"moreblocks_wood_tile.png", "moreblocks_wood_tile.png", "moreblocks_wood_tile.png",
"moreblocks_wood_tile.png", "moreblocks_wood_tile.png^[transformR90", "moreblocks_wood_tile.png^[transformR90"}, "moreblocks_wood_tile.png", "moreblocks_wood_tile.png^[transformR90", "moreblocks_wood_tile.png^[transformR90"},
"Wooden Tile", "Wooden Tile",
@ -418,7 +425,7 @@ register_stair_slab_panel_micro("moreblocks", "wood_tile", "moreblocks:wood_tile
0) 0)
register_stair_slab_panel_micro("moreblocks", "wood_tile_center", "moreblocks:wood_tile_center", register_stair_slab_panel_micro("moreblocks", "wood_tile_center", "moreblocks:wood_tile_center",
{not_in_creative_inventory=1,snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
{"moreblocks_wood_tile_center.png", "moreblocks_wood_tile_center.png", "moreblocks_wood_tile_center.png", {"moreblocks_wood_tile_center.png", "moreblocks_wood_tile_center.png", "moreblocks_wood_tile_center.png",
"moreblocks_wood_tile_center.png", "moreblocks_wood_tile_center.png^[transformR90", "moreblocks_wood_tile_center.png^[transformR90"}, "moreblocks_wood_tile_center.png", "moreblocks_wood_tile_center.png^[transformR90", "moreblocks_wood_tile_center.png^[transformR90"},
"Centered Wooden Tile", "Centered Wooden Tile",
@ -426,7 +433,7 @@ register_stair_slab_panel_micro("moreblocks", "wood_tile_center", "moreblocks:wo
0) 0)
register_stair_slab_panel_micro("moreblocks", "wood_tile_full", "moreblocks:wood_tile_full", register_stair_slab_panel_micro("moreblocks", "wood_tile_full", "moreblocks:wood_tile_full",
{not_in_creative_inventory=1,snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
{"moreblocks_wood_tile_full.png", "moreblocks_wood_tile_full.png", "moreblocks_wood_tile_full.png", {"moreblocks_wood_tile_full.png", "moreblocks_wood_tile_full.png", "moreblocks_wood_tile_full.png",
"moreblocks_wood_tile_full.png", "moreblocks_wood_tile_full.png^[transformR90", "moreblocks_wood_tile_full.png^[transformR90"}, "moreblocks_wood_tile_full.png", "moreblocks_wood_tile_full.png^[transformR90", "moreblocks_wood_tile_full.png^[transformR90"},
"Full Wooden Tile", "Full Wooden Tile",