Added new aliases for screwdriver and circular saw, new microblocks/panels, circular saw now has 4 rows with 8 items each

This commit is contained in:
Calinou 2013-10-27 09:57:21 +01:00
parent f322bb1bc1
commit 1333faa48b
4 changed files with 347 additions and 34 deletions

View File

@ -50,16 +50,12 @@ minetest.register_alias("stonebricks", "default:stonebrick")
minetest.register_alias("stone_brick", "default:stonebrick")
minetest.register_alias("stone_bricks", "default:stonebrick")
minetest.register_alias("sweeper", "moreblocks:sweeper")
minetest.register_alias("circularsaw", "moreblocks:circular_saw")
minetest.register_alias("circular_saw", "moreblocks:circular_saw")
minetest.register_alias("screwdriver", "moreblocks:screwdriver")
minetest.register_alias("screw_driver", "moreblocks:screw_driver")
minetest.register_alias("screwdrive", "moreblocks:screw_driver")
minetest.register_alias("screw_drive", "moreblocks:screw_driver")
minetest.register_alias("sweep", "moreblocks:sweeper")
minetest.register_alias("junglestick", "moreblocks:jungle_stick")
minetest.register_alias("jungle_stick", "moreblocks:jungle_stick")
minetest.register_alias("screwdriver", "screwdriver:screwdriver")
minetest.register_alias("screw_driver", "screwdriver:screw_driver")
minetest.register_alias("screwdrive", "screwdriver:screw_driver")
minetest.register_alias("screw_drive", "screwdriver:screw_driver")
minetest.register_alias("sd", "screwdriver:screw_driver")
minetest.register_alias("obsidian", "default:obsidian")
minetest.register_alias("obsidianglass", "default:obsidian_glass")
@ -76,6 +72,15 @@ minetest.register_alias("circle_stonebricks", "moreblocks:circle_stone_bricks")
minetest.register_alias("circle_stone_brick", "moreblocks:circle_stone_bricks")
minetest.register_alias("circle_stone_bricks", "moreblocks:circle_stone_bricks")
minetest.register_alias("sweeper", "moreblocks:sweeper")
minetest.register_alias("circularsaw", "moreblocks:circular_saw")
minetest.register_alias("circular_saw", "moreblocks:circular_saw")
minetest.register_alias("cs", "moreblocks:circular_saw")
minetest.register_alias("sweep", "moreblocks:sweeper")
minetest.register_alias("junglestick", "moreblocks:jungle_stick")
minetest.register_alias("jungle_stick", "moreblocks:jungle_stick")
minetest.register_alias("stonesquare", "moreblocks:stone_tile")
minetest.register_alias("stonesquares", "moreblocks:stone_tile")
minetest.register_alias("stone_square", "moreblocks:stone_tile")

View File

@ -29,10 +29,10 @@ end
-- How many microblocks does this shape at the output inventory cost?
circular_saw.cost_in_microblocks = { 6, 7, 5, 3, 2, 4, 6,
2, 1, 4, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0 };
circular_saw.cost_in_microblocks = { 1, 1, 1, 1, 1, 1, 1, 2,
2, 3, 2, 4, 2, 4, 5, 6,
7, 1, 1, 2, 4, 6, 7, 8,
3, 4, 0, 0, 0, 0, 0, 0, };
-- anz: amount of input material in microblocks
circular_saw.get_stair_output_inv = function(modname, material, anz, max)
@ -55,14 +55,26 @@ circular_saw.get_stair_output_inv = function(modname, material, anz, max)
end
return {
modname .. ":micro_" .. material .. "_bottom " .. math.min(math.floor(anz/1), max_offered),
modname .. ":panel_" .. material .. "_bottom " .. math.min(math.floor(anz/2), max_offered),
modname .. ":stair_" .. material .. "_half " .. math.min(math.floor(anz/3), max_offered),
modname .. ":stair_" .. material .. "_alt " .. math.min(math.floor(anz/4), max_offered),
modname .. ":micro_" .. material .. "_1 " .. math.min(math.floor(anz/1), max_offered),
modname .. ":panel_" .. material .. "_1 " .. math.min(math.floor(anz/1), max_offered),
modname .. ":micro_" .. material .. "_2 " .. math.min(math.floor(anz/1), max_offered),
modname .. ":panel_" .. material .. "_2 " .. math.min(math.floor(anz/1), max_offered),
modname .. ":micro_" .. material .. "_4 " .. math.min(math.floor(anz/1), max_offered),
modname .. ":panel_" .. material .. "_4 " .. math.min(math.floor(anz/1), max_offered),
modname .. ":micro_" .. material .. " " .. math.min(math.floor(anz/1), max_offered),
modname .. ":panel_" .. material .. " " .. math.min(math.floor(anz/2), max_offered),
modname .. ":micro_" .. material .. "_12 " .. math.min(math.floor(anz/2), max_offered),
modname .. ":panel_" .. material .. "_12 " .. math.min(math.floor(anz/3), max_offered),
modname .. ":micro_" .. material .. "_14 " .. math.min(math.floor(anz/2), max_offered),
modname .. ":panel_" .. material .. "_14 " .. math.min(math.floor(anz/4), max_offered),
modname .. ":micro_" .. material .. "_15 " .. math.min(math.floor(anz/2), max_offered),
modname .. ":panel_" .. material .. "_15 " .. math.min(math.floor(anz/4), max_offered),
modname .. ":stair_" .. material .. "_outer " .. math.min(math.floor(anz/5), max_offered),
modname .. ":stair_" .. material .. " " .. math.min(math.floor(anz/6), max_offered),
modname .. ":stair_" .. material .. "_inner " .. math.min(math.floor(anz/7), max_offered),
modname .. ":slab_" .. material .. "_1 " .. math.min(math.floor(anz/1), max_offered),
modname .. ":slab_" .. material .. "_2 " .. math.min(math.floor(anz/1), max_offered),
modname .. ":slab_" .. material .. "_quarter " .. math.min(math.floor(anz/2), max_offered),
@ -71,6 +83,9 @@ circular_saw.get_stair_output_inv = function(modname, material, anz, max)
modname .. ":slab_" .. material .. "_14 " .. math.min(math.floor(anz/7), max_offered),
modname .. ":slab_" .. material .. "_15 " .. math.min(math.floor(anz/8), max_offered),
modname .. ":stair_" .. material .. "_half " .. math.min(math.floor(anz/3), max_offered),
modname .. ":stair_" .. material .. "_alt " .. math.min(math.floor(anz/4), max_offered),
"",
}
end
@ -267,7 +282,7 @@ circular_saw.on_construct_init = function(pos, formspec)
inv:set_size("input", 1) -- Input slot for full blocks of material x
inv:set_size("micro", 1) -- Storage for 1-7 surplus microblocks
inv:set_size("recycle", 1) -- Surplus partial blocks can be placed here
inv:set_size("output", 28) -- 4*7 versions of stair-parts of material x
inv:set_size("output", 32) -- 4*7 versions of stair-parts of material x
circular_saw.reset_circular_saw(pos);
end
@ -305,19 +320,6 @@ minetest.register_node("moreblocks:circular_saw", {
{-0.25, -0.0625, -0.25, 0.25, 0.25, 0.25}, -- Motor case
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.4, -0.5, -0.4, -0.25, 0.25, -0.25}, -- Leg
{0.25, -0.5, 0.25, 0.4, 0.25, 0.4}, -- Leg
{-0.4, -0.5, 0.25, -0.25, 0.25, 0.4}, -- Leg
{0.25, -0.5, -0.4, 0.4, 0.25, -0.25}, -- Leg
{-0.5, 0.25, -0.5, 0.5, 0.375, 0.5}, -- Tabletop
{-0.01, 0.4375, -0.125, 0.01, 0.5, 0.125}, -- Saw blade (top)
{-0.01, 0.375, -0.1875, 0.01, 0.4375, 0.1875}, -- Saw blade (bottom)
{-0.25, -0.0625, -0.25, 0.25, 0.25, 0.25}, -- Motor case
},
},
tiles = {"moreblocks_circular_saw_top.png", "moreblocks_circular_saw_bottom.png", "moreblocks_circular_saw_side.png"},
paramtype = "light",
sunlight_propagates = true,
@ -334,7 +336,7 @@ minetest.register_node("moreblocks:circular_saw", {
"button[1,2;1,1;Set;Set]" ..
"list[current_name;recycle;0,3;1,1;]" ..
"label[0,3;Recycle output]" ..
"list[current_name;output;2,0;7,4;]" ..
"list[current_name;output;2,0;8,4;]" ..
"list[current_player;main;1,5;8,4;]");
end,

View File

@ -37,6 +37,162 @@ function register_micro(modname, subname, recipeitem, groups, images, descriptio
return itemstack
end
})
minetest.register_node(":"..modname .. ":micro_" .. subname .. "_1", {
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.4375, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0, -0.4375, 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 .. ":micro_" .. subname .. "_2", {
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.375, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0, -0.375, 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 .. ":micro_" .. subname .. "_4", {
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.25, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0, -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 .. ":micro_" .. subname .. "_12", {
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.25, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0, 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 .. ":micro_" .. subname .. "_14", {
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.375, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0, 0.375, 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 .. ":micro_" .. subname .. "_15", {
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.4375, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0, 0.4375, 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

View File

@ -36,6 +36,156 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
return itemstack
end
})
minetest.register_node(":" .. modname .. ":panel_" .. subname .. "_1", {
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.4375, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, -0.4375, 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_node(":" .. modname .. ":panel_" .. subname .. "_2", {
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.375, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, -0.375, 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_node(":" .. modname .. ":panel_" .. subname .. "_4", {
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.25, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, -0.25, 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_node(":" .. modname .. ":panel_" .. subname .. "_12", {
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.25, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0.25, 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_node(":" .. modname .. ":panel_" .. subname .. "_14", {
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.375, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0.375, 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_node(":" .. modname .. ":panel_" .. subname .. "_15", {
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.4375, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0.4375, 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