2015-09-29 20:19:14 +02:00
|
|
|
--
|
|
|
|
-- Partial blocks mod
|
|
|
|
-- By Kaadmy, for Pixture
|
|
|
|
--
|
|
|
|
|
|
|
|
partialblocks = {}
|
|
|
|
|
2015-10-04 02:07:04 +02:00
|
|
|
function partialblocks.register_material(name, desc, node, can_burn)
|
2017-05-12 04:29:55 +02:00
|
|
|
local nodedef = minetest.registered_nodes[node]
|
2015-09-29 20:19:14 +02:00
|
|
|
|
|
|
|
if nodedef == nil then
|
2017-05-12 04:29:55 +02:00
|
|
|
minetest.log("warning", "Cannot find node for partialblock: " .. node)
|
2017-05-16 20:12:49 +02:00
|
|
|
|
2015-09-29 20:19:14 +02:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Slab
|
2017-05-16 20:12:49 +02:00
|
|
|
|
2017-05-12 04:29:55 +02:00
|
|
|
minetest.register_node(
|
2015-09-29 20:19:14 +02:00
|
|
|
"partialblocks:" .. name .. "_slab",
|
|
|
|
{
|
|
|
|
tiles = nodedef.tiles,
|
|
|
|
groups = nodedef.groups,
|
|
|
|
sounds = nodedef.sounds,
|
|
|
|
|
|
|
|
description = desc .. " slab",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
|
|
|
|
node_box = {
|
|
|
|
type = "wallmounted",
|
|
|
|
wall_top = {-0.5, 0, -0.5, 0.5, 0.5, 0.5},
|
|
|
|
wall_side = {-0.5, -0.5, -0.5, 0, 0.5, 0.5},
|
|
|
|
wall_bottom = {-0.5, -0.5, -0.5, 0.5, 0, 0.5}
|
|
|
|
},
|
|
|
|
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "wallmounted",
|
2017-05-16 20:12:49 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
crafting.register_craft( -- Craft to
|
2015-09-29 20:19:14 +02:00
|
|
|
{
|
2015-09-29 22:33:18 +02:00
|
|
|
output = "partialblocks:" .. name .. "_slab 3",
|
2017-05-16 20:12:49 +02:00
|
|
|
items = {
|
|
|
|
node .. " 3",
|
2015-09-29 20:19:14 +02:00
|
|
|
},
|
2017-05-16 20:12:49 +02:00
|
|
|
})
|
2015-09-29 20:19:14 +02:00
|
|
|
|
2015-10-04 02:07:04 +02:00
|
|
|
if can_burn then
|
2017-05-12 04:29:55 +02:00
|
|
|
minetest.register_craft( -- Fuel
|
2015-10-04 02:07:04 +02:00
|
|
|
{
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "partialblocks:" .. name .. "_slab",
|
|
|
|
burntime = 7,
|
2017-05-16 20:12:49 +02:00
|
|
|
})
|
2015-10-04 02:07:04 +02:00
|
|
|
end
|
|
|
|
|
2015-09-29 20:19:14 +02:00
|
|
|
-- Stair
|
2017-05-16 20:12:49 +02:00
|
|
|
|
2017-05-12 04:29:55 +02:00
|
|
|
minetest.register_node(
|
2015-09-29 20:19:14 +02:00
|
|
|
"partialblocks:" .. name .. "_stair",
|
|
|
|
{
|
|
|
|
tiles = nodedef.tiles,
|
|
|
|
groups = nodedef.groups,
|
|
|
|
sounds = nodedef.sounds,
|
|
|
|
|
|
|
|
description = desc .. " stair",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
|
|
|
|
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},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
2017-05-16 20:12:49 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
crafting.register_craft( -- Craft to
|
2015-09-29 20:19:14 +02:00
|
|
|
{
|
|
|
|
output = "partialblocks:" .. name .. "_stair 6",
|
2017-05-16 20:12:49 +02:00
|
|
|
items = {
|
|
|
|
node .. " 6",
|
2015-09-29 20:19:14 +02:00
|
|
|
},
|
2017-05-16 20:12:49 +02:00
|
|
|
})
|
2015-10-04 02:07:04 +02:00
|
|
|
|
|
|
|
if can_burn then
|
2017-05-12 04:29:55 +02:00
|
|
|
minetest.register_craft( -- Fuel
|
2015-10-04 02:07:04 +02:00
|
|
|
{
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "partialblocks:" .. name .. "_stair",
|
|
|
|
burntime = 7,
|
2017-05-16 20:12:49 +02:00
|
|
|
})
|
2015-10-04 02:07:04 +02:00
|
|
|
end
|
2015-09-29 20:19:14 +02:00
|
|
|
end
|
|
|
|
|
2017-05-16 20:12:49 +02:00
|
|
|
-- Stonelike materials
|
|
|
|
|
|
|
|
partialblocks.register_material(
|
|
|
|
"cobble", "Cobble", "default:cobble", false)
|
|
|
|
|
|
|
|
partialblocks.register_material(
|
|
|
|
"stone", "Stone", "default:stone", false)
|
|
|
|
|
|
|
|
partialblocks.register_material(
|
|
|
|
"brick", "Brick", "default:brick", false)
|
|
|
|
|
|
|
|
-- Woodlike
|
|
|
|
|
|
|
|
partialblocks.register_material(
|
|
|
|
"wood", "Wood", "default:planks", true)
|
|
|
|
|
|
|
|
partialblocks.register_material(
|
|
|
|
"oak", "Oak", "default:planks_oak", true)
|
|
|
|
|
|
|
|
partialblocks.register_material(
|
|
|
|
"birch", "Birch", "default:planks_birch", true)
|
|
|
|
|
|
|
|
-- Frames
|
|
|
|
|
|
|
|
partialblocks.register_material(
|
|
|
|
"frame", "Frame", "default:frame", true)
|
|
|
|
|
|
|
|
partialblocks.register_material(
|
|
|
|
"reinforced_frame", "Reinforced Frame", "default:reinforced_frame", true)
|
|
|
|
|
|
|
|
partialblocks.register_material(
|
|
|
|
"reinforced_cobble", "Reinforced Cobble", "default:reinforced_cobble", false)
|
|
|
|
|
|
|
|
-- Misc. blocks
|
|
|
|
|
|
|
|
partialblocks.register_material(
|
|
|
|
"coal", "Coal", "default:block_coal", false)
|
|
|
|
|
|
|
|
partialblocks.register_material(
|
|
|
|
"steel", "Steel", "default:block_steel", false)
|
|
|
|
|
|
|
|
partialblocks.register_material(
|
|
|
|
"compressed_sandstone", "Compressed Sandstone", "default:compressed_sandstone", false)
|
2016-06-21 13:57:38 +02:00
|
|
|
|
|
|
|
default.log("mod:partialblocks", "loaded")
|