More Blocks

This commit is contained in:
Calinou
2013-07-11 20:33:02 +02:00
parent f9bddb6dda
commit 85aea72376
66 changed files with 2809 additions and 2 deletions

61
stairsplus/aliases.lua Normal file
View File

@ -0,0 +1,61 @@
function register_stairsplus_alias(modname, origname, newname)
minetest.register_alias(modname .. ":slab_" .. origname, "moreblocks:slab_" .. newname)
minetest.register_alias(modname .. ":slab_" .. origname .. "_inverted", "moreblocks:slab_" .. newname .. "_inverted")
minetest.register_alias(modname .. ":slab_" .. origname .. "_wall", "moreblocks:slab_" .. newname .. "_wall")
minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter", "moreblocks:slab_" .. newname .. "_quarter")
minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter_inverted", "moreblocks:slab_" .. newname .. "_quarter_inverted")
minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter_wall", "moreblocks:slab_" .. newname .. "_quarter_wall")
minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter", "moreblocks:slab_" .. newname .. "_three_quarter")
minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter_inverted", "moreblocks:slab_" .. newname .. "_three_quarter_inverted")
minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter_wall", "moreblocks:slab_" .. newname .. "_three_quarter_wall")
minetest.register_alias(modname .. ":stair_" .. origname, "moreblocks:stair_" .. newname)
minetest.register_alias(modname .. ":stair_" .. origname .. "_inverted", "moreblocks:stair_" .. newname .. "_inverted")
minetest.register_alias(modname .. ":stair_" .. origname .. "_wall", "moreblocks:stair_" .. newname .. "_wall")
minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half", "moreblocks:stair_" .. newname .. "_wall_half")
minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half_inverted", "moreblocks:stair_" .. newname .. "_wall_half_inverted")
minetest.register_alias(modname .. ":stair_" .. origname .. "_half", "moreblocks:stair_" .. newname .. "_half")
minetest.register_alias(modname .. ":stair_" .. origname .. "_half_inverted", "moreblocks:stair_" .. newname .. "_half_inverted")
minetest.register_alias(modname .. ":stair_" .. origname .. "_right_half", "moreblocks:stair_" .. newname .. "_right_half")
minetest.register_alias(modname .. ":stair_" .. origname .. "_right_half_inverted", "moreblocks:stair_" .. newname .. "_right_half_inverted")
minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half", "moreblocks:stair_" .. newname .. "_wall_half")
minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half_inverted", "moreblocks:stair_" .. newname .. "_wall_half_inverted")
minetest.register_alias(modname .. ":stair_" .. origname .. "_inner", "moreblocks:stair_" .. newname .. "_inner")
minetest.register_alias(modname .. ":stair_" .. origname .. "_inner_inverted", "moreblocks:stair_" .. newname .. "_inner_inverted")
minetest.register_alias(modname .. ":stair_" .. origname .. "_outer", "moreblocks:stair_" .. newname .. "_outer")
minetest.register_alias(modname .. ":stair_" .. origname .. "_outer_inverted", "moreblocks:stair_" .. newname .. "_outer_inverted")
minetest.register_alias(modname .. ":panel_" .. origname .. "_bottom", "moreblocks:panel_" .. newname .. "_bottom")
minetest.register_alias(modname .. ":panel_" .. origname .. "_top", "moreblocks:panel_" .. newname .. "_top")
minetest.register_alias(modname .. ":panel_" .. origname .. "_vertical", "moreblocks:panel_" .. newname .. "_vertical")
minetest.register_alias(modname .. ":micro_" .. origname .. "_bottom", "moreblocks:micro_" .. newname .. "_bottom")
minetest.register_alias(modname .. ":micro_" .. origname .. "_top", "moreblocks:micro_" .. newname .. "_top")
end
register_stairsplus_alias("stairsplus", "stone", "stone")
register_stairsplus_alias("stairsplus", "wood", "wood")
register_stairsplus_alias("stairsplus", "cobble", "cobble")
register_stairsplus_alias("stairsplus", "brick", "brick")
register_stairsplus_alias("stairsplus", "sandstone", "sandstone")
register_stairsplus_alias("stairsplus", "glass", "glass")
register_stairsplus_alias("stairsplus", "tree", "tree")
register_stairsplus_alias("stairsplus", "jungletree", "jungletree")
register_stairsplus_alias("stairsplus", "desert_stone", "desert_stone")
register_stairsplus_alias("stairsplus", "steelblock", "steelblock")
register_stairsplus_alias("stairsplus", "mossycobble", "mossycobble")
register_stairsplus_alias("moreblocks", "coalstone", "coal_stone")
register_stairsplus_alias("moreblocks", "junglewood", "jungle_wood")
register_stairsplus_alias("moreblocks", "circlestonebrick", "circle_stone_bricks")
register_stairsplus_alias("moreblocks", "ironstone", "iron_stone")
register_stairsplus_alias("moreblocks", "coalglass", "coal_glass")
register_stairsplus_alias("moreblocks", "ironglass", "iron_glass")
register_stairsplus_alias("moreblocks", "glowglass", "glow_glass")
register_stairsplus_alias("moreblocks", "superglowglass", "super_glow_glass")
register_stairsplus_alias("moreblocks", "coalchecker", "coal_checker")
register_stairsplus_alias("moreblocks", "ironchecker", "iron_checker")
register_stairsplus_alias("moreblocks", "cactuschecker", "cactus_checker")
register_stairsplus_alias("moreblocks", "ironstonebrick", "iron_stone_bricks")
register_stairsplus_alias("moreblocks", "stonesquare", "stone_tile")
register_stairsplus_alias("moreblocks", "splitstonesquare", "split_stone_tile")
register_stairsplus_alias("moreblocks", "woodtile", "wood_tile")
register_stairsplus_alias("moreblocks", "woodtile_centered", "wood_tile_centered")
register_stairsplus_alias("moreblocks", "woodtile_full", "wood_tile_full")

View File

@ -0,0 +1,43 @@
-- Load translation library if intllib is installed
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
-- Node will be called <modname>micro_<subname>
function register_micro(modname, subname, recipeitem, groups, images, description, drop, light)
minetest.register_node(":"..modname .. ":micro_" .. subname, {
description = S("%s Microblock"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
drop = modname .. ":micro_" .. drop,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0, 0, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0, 0, 0.5},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_alias(modname..":micro_"..subname.."_bottom", modname..":micro_"..subname)
end

42
stairsplus/panels.lua Normal file
View File

@ -0,0 +1,42 @@
-- Load translation library if intllib is installed
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
-- Node will be called <modname>panel_<subname>
function register_panel(modname, subname, recipeitem, groups, images, description, drop, light)
minetest.register_node(":" .. modname .. ":panel_" .. subname, {
description = S("%s Panel"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
drop = modname .. ":panel_" .. drop,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5},
},
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_alias(modname..":panel_"..subname.."_bottom", modname..":panel_"..subname)
end

127
stairsplus/slabs.lua Normal file
View File

@ -0,0 +1,127 @@
-- Load translation library if intllib is installed
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
-- Node will be called <modname>slab_<subname>
function register_slab(modname, subname, recipeitem, groups, images, description, drop, light)
minetest.register_node(":" .. modname .. ":slab_" .. subname, {
description = S("%s Slab"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
drop = modname .. ":slab_" .. drop,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_node(":stairs:slab_" .. subname, {
description = S("%s Slab"):format(S(description)),
drawtype = "nodebox",
tiles = images,
drop = modname .. ":slab_" .. drop,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_node(":"..modname .. ":slab_" .. subname .. "_quarter", {
description = S("%s Slab"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
drop = modname .. ":slab_" .. drop .. "_quarter",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_node(":"..modname .. ":slab_" .. subname .. "_three_quarter", {
description = S("%s Slab"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
drop = modname .. ":slab_" .. drop .. "_three_quarter",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.25, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.25, 0.5},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
-- Unregister default recipes
minetest.register_craft({
output = "moreblocks:nothing 1",
recipe = {
{recipeitem, recipeitem, recipeitem},
},
})
end

248
stairsplus/stairs.lua Normal file
View File

@ -0,0 +1,248 @@
-- Load translation library if intllib is installed
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
-- Node will be called <modname>:stair_<subname>
function register_stair(modname, subname, recipeitem, groups, images, description, drop, light)
minetest.register_node(":" .. modname .. ":stair_" .. subname, {
description = S("%s Stairs"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.5, 0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.5, 0.5},
},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_node(":stairs:stair_" .. subname, {
description = S("%s Stairs"):format(S(description)),
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky=3, not_in_creative_inventory=1},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.5, 0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.5, 0.5},
},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_node(":" .. modname .. ":stair_" .. subname .. "_half", {
description = S("%s Stairs"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0, 0, 0.5},
{-0.5, 0, 0, 0, 0.5, 0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0, 0, 0.5},
{-0.5, 0, 0, 0, 0.5, 0.5},
},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_node(":"..modname .. ":stair_" .. subname .. "_right_half", {
description = S("%s Stairs"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {
{0, -0.5, -0.5, 0.5, 0, 0.5},
{0, 0, 0, 0.5, 0.5, 0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{0, -0.5, -0.5, 0.5, 0, 0.5},
{0, 0, 0, 0.5, 0.5, 0.5},
},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_node(":"..modname .. ":stair_" .. subname .. "_inner", {
description = S("%s Stairs"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
drop = modname .. ":stair_" .. drop .. "_inner",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.5, 0.5},
{-0.5, 0, -0.5, 0, 0.5, 0},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.5, 0.5},
{-0.5, 0, -0.5, 0, 0.5, 0},
},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_node(":"..modname .. ":stair_" .. subname .. "_outer", {
description = S("%s Stairs"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
drop = modname .. ":stair_" .. drop .. "_outer",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0, 0.5, 0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0, 0.5, 0.5},
},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_node(":" .. modname .. ":stair_" .. subname .. "_alt", {
description = S("%s Stairs"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0},
{-0.5, 0, 0, 0.5, 0.5, 0.5},
},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
-- Unregister default recipes
minetest.register_craft({
output = "moreblocks:nothing 1",
recipe = {
{recipeitem, "", ""},
{recipeitem, recipeitem, ""},
{recipeitem, recipeitem, recipeitem},
},
})
minetest.register_craft({
output = "moreblocks:nothing 1",
recipe = {
{"", "", recipeitem},
{"", recipeitem, recipeitem},
{recipeitem, recipeitem, recipeitem},
},
})
end