2019-09-10 19:09:51 +02:00
|
|
|
-- stairs/init.lua
|
|
|
|
|
2013-05-18 16:05:16 +02:00
|
|
|
-- Minetest 0.4 mod: stairs
|
|
|
|
-- See README.txt for licensing and other information.
|
|
|
|
|
2015-08-14 04:00:32 +02:00
|
|
|
|
|
|
|
-- Global namespace for functions
|
|
|
|
|
2013-05-18 16:05:16 +02:00
|
|
|
stairs = {}
|
|
|
|
|
2019-09-10 19:09:51 +02:00
|
|
|
-- Load support for MT game translation.
|
|
|
|
local S = minetest.get_translator("stairs")
|
|
|
|
|
2015-08-14 04:00:32 +02:00
|
|
|
|
2015-08-16 00:30:34 +02:00
|
|
|
-- Register aliases for new pine node names
|
|
|
|
|
|
|
|
minetest.register_alias("stairs:stair_pinewood", "stairs:stair_pine_wood")
|
|
|
|
minetest.register_alias("stairs:slab_pinewood", "stairs:slab_pine_wood")
|
|
|
|
|
|
|
|
|
2015-08-14 04:00:32 +02:00
|
|
|
-- Get setting for replace ABM
|
|
|
|
|
2017-05-22 15:41:17 +02:00
|
|
|
local replace = minetest.settings:get_bool("enable_stairs_replace_abm")
|
2015-08-14 04:00:32 +02:00
|
|
|
|
2017-04-11 08:51:13 +02:00
|
|
|
local function rotate_and_place(itemstack, placer, pointed_thing)
|
|
|
|
local p0 = pointed_thing.under
|
|
|
|
local p1 = pointed_thing.above
|
|
|
|
local param2 = 0
|
|
|
|
|
2017-10-01 15:41:58 +02:00
|
|
|
if placer then
|
2018-07-01 21:44:03 +02:00
|
|
|
local placer_pos = placer:get_pos()
|
2017-10-01 15:41:58 +02:00
|
|
|
if placer_pos then
|
|
|
|
param2 = minetest.dir_to_facedir(vector.subtract(p1, placer_pos))
|
|
|
|
end
|
2017-04-11 08:51:13 +02:00
|
|
|
|
2017-10-01 15:41:58 +02:00
|
|
|
local finepos = minetest.pointed_thing_to_face_pos(placer, pointed_thing)
|
|
|
|
local fpos = finepos.y % 1
|
2017-04-11 08:51:13 +02:00
|
|
|
|
2017-10-01 15:41:58 +02:00
|
|
|
if p0.y - 1 == p1.y or (fpos > 0 and fpos < 0.5)
|
|
|
|
or (fpos < -0.5 and fpos > -0.999999999) then
|
|
|
|
param2 = param2 + 20
|
|
|
|
if param2 == 21 then
|
|
|
|
param2 = 23
|
|
|
|
elseif param2 == 23 then
|
|
|
|
param2 = 21
|
|
|
|
end
|
2017-04-11 08:51:13 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
return minetest.item_place(itemstack, placer, pointed_thing, param2)
|
|
|
|
end
|
2015-08-14 04:00:32 +02:00
|
|
|
|
2019-07-30 11:19:22 +02:00
|
|
|
local function warn_if_exists(nodename)
|
|
|
|
if minetest.registered_nodes[nodename] then
|
|
|
|
minetest.log("warning", "Overwriting stairs node: " .. nodename)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-12-05 06:40:16 +01:00
|
|
|
|
|
|
|
-- Register stair
|
2013-05-18 16:05:16 +02:00
|
|
|
-- Node will be called stairs:stair_<subname>
|
2015-08-14 04:00:32 +02:00
|
|
|
|
2018-10-04 01:33:11 +02:00
|
|
|
function stairs.register_stair(subname, recipeitem, groups, images, description,
|
|
|
|
sounds, worldaligntex)
|
2017-11-02 05:30:19 +01:00
|
|
|
-- Set backface culling and world-aligned textures
|
2017-06-07 18:42:44 +02:00
|
|
|
local stair_images = {}
|
|
|
|
for i, image in ipairs(images) do
|
|
|
|
if type(image) == "string" then
|
|
|
|
stair_images[i] = {
|
|
|
|
name = image,
|
|
|
|
backface_culling = true,
|
|
|
|
}
|
2018-10-04 01:33:11 +02:00
|
|
|
if worldaligntex then
|
|
|
|
stair_images[i].align_style = "world"
|
|
|
|
end
|
2017-11-02 05:30:19 +01:00
|
|
|
else
|
2017-06-07 18:42:44 +02:00
|
|
|
stair_images[i] = table.copy(image)
|
2017-11-02 05:30:19 +01:00
|
|
|
if stair_images[i].backface_culling == nil then
|
|
|
|
stair_images[i].backface_culling = true
|
|
|
|
end
|
2018-10-04 01:33:11 +02:00
|
|
|
if worldaligntex and stair_images[i].align_style == nil then
|
2017-11-02 05:30:19 +01:00
|
|
|
stair_images[i].align_style = "world"
|
|
|
|
end
|
2017-06-07 18:42:44 +02:00
|
|
|
end
|
|
|
|
end
|
2018-01-31 20:49:27 +01:00
|
|
|
local new_groups = table.copy(groups)
|
|
|
|
new_groups.stair = 1
|
2019-07-30 11:19:22 +02:00
|
|
|
warn_if_exists("stairs:stair_" .. subname)
|
2013-05-18 16:05:16 +02:00
|
|
|
minetest.register_node(":stairs:stair_" .. subname, {
|
|
|
|
description = description,
|
2017-11-02 05:30:19 +01:00
|
|
|
drawtype = "nodebox",
|
2017-06-07 18:42:44 +02:00
|
|
|
tiles = stair_images,
|
2013-05-18 16:05:16 +02:00
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
2015-06-14 05:58:54 +02:00
|
|
|
is_ground_content = false,
|
2018-01-31 20:49:27 +01:00
|
|
|
groups = new_groups,
|
2013-05-18 16:05:16 +02:00
|
|
|
sounds = sounds,
|
2017-11-02 05:30:19 +01:00
|
|
|
node_box = {
|
2013-05-18 16:05:16 +02:00
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
2017-11-02 05:30:19 +01:00
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
|
|
|
|
{-0.5, 0.0, 0.0, 0.5, 0.5, 0.5},
|
2013-05-18 16:05:16 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
if pointed_thing.type ~= "node" then
|
|
|
|
return itemstack
|
|
|
|
end
|
2013-10-05 02:33:41 +02:00
|
|
|
|
2017-04-11 08:51:13 +02:00
|
|
|
return rotate_and_place(itemstack, placer, pointed_thing)
|
2013-05-18 16:05:16 +02:00
|
|
|
end,
|
|
|
|
})
|
2013-10-05 02:33:41 +02:00
|
|
|
|
2013-09-11 16:32:32 +02:00
|
|
|
-- for replace ABM
|
2015-08-14 04:00:32 +02:00
|
|
|
if replace then
|
|
|
|
minetest.register_node(":stairs:stair_" .. subname .. "upside_down", {
|
|
|
|
replace_name = "stairs:stair_" .. subname,
|
|
|
|
groups = {slabs_replace = 1},
|
|
|
|
})
|
|
|
|
end
|
2013-05-18 16:05:16 +02:00
|
|
|
|
2016-05-30 21:03:55 +02:00
|
|
|
if recipeitem then
|
2017-06-03 23:41:39 +02:00
|
|
|
-- Recipe matches appearence in inventory
|
2016-05-30 21:03:55 +02:00
|
|
|
minetest.register_craft({
|
2019-08-01 03:40:39 +02:00
|
|
|
output = "stairs:stair_" .. subname .. " 8",
|
2016-05-30 21:03:55 +02:00
|
|
|
recipe = {
|
|
|
|
{"", "", recipeitem},
|
|
|
|
{"", recipeitem, recipeitem},
|
|
|
|
{recipeitem, recipeitem, recipeitem},
|
|
|
|
},
|
|
|
|
})
|
Add and edit fuel registrations
Edited fuels: fences, wooden ladder.
New fuels:
boat, paper, book, dry shrub, stick, vessels shelf, wooden tools,
wooden door, trapdoor, fence gates, farming crops, stairs, slabs, beds.
2016-10-30 11:29:58 +01:00
|
|
|
|
2017-05-22 03:20:10 +02:00
|
|
|
-- Use stairs to craft full blocks again (1:1)
|
|
|
|
minetest.register_craft({
|
2019-08-01 03:40:39 +02:00
|
|
|
output = recipeitem .. " 3",
|
2017-05-22 03:20:10 +02:00
|
|
|
recipe = {
|
2019-08-01 03:40:39 +02:00
|
|
|
{"stairs:stair_" .. subname, "stairs:stair_" .. subname},
|
|
|
|
{"stairs:stair_" .. subname, "stairs:stair_" .. subname},
|
2017-05-22 03:20:10 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
Add and edit fuel registrations
Edited fuels: fences, wooden ladder.
New fuels:
boat, paper, book, dry shrub, stick, vessels shelf, wooden tools,
wooden door, trapdoor, fence gates, farming crops, stairs, slabs, beds.
2016-10-30 11:29:58 +01:00
|
|
|
-- Fuel
|
|
|
|
local baseburntime = minetest.get_craft_result({
|
|
|
|
method = "fuel",
|
|
|
|
width = 1,
|
|
|
|
items = {recipeitem}
|
|
|
|
}).time
|
|
|
|
if baseburntime > 0 then
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
2019-08-01 03:40:39 +02:00
|
|
|
recipe = "stairs:stair_" .. subname,
|
Add and edit fuel registrations
Edited fuels: fences, wooden ladder.
New fuels:
boat, paper, book, dry shrub, stick, vessels shelf, wooden tools,
wooden door, trapdoor, fence gates, farming crops, stairs, slabs, beds.
2016-10-30 11:29:58 +01:00
|
|
|
burntime = math.floor(baseburntime * 0.75),
|
|
|
|
})
|
|
|
|
end
|
2016-05-30 21:03:55 +02:00
|
|
|
end
|
2013-05-18 16:05:16 +02:00
|
|
|
end
|
|
|
|
|
2015-08-14 04:00:32 +02:00
|
|
|
|
2017-12-05 06:40:16 +01:00
|
|
|
-- Register slab
|
2013-05-18 16:05:16 +02:00
|
|
|
-- Node will be called stairs:slab_<subname>
|
2015-08-14 04:00:32 +02:00
|
|
|
|
2018-10-04 01:33:11 +02:00
|
|
|
function stairs.register_slab(subname, recipeitem, groups, images, description,
|
|
|
|
sounds, worldaligntex)
|
2017-11-02 05:30:19 +01:00
|
|
|
-- Set world-aligned textures
|
|
|
|
local slab_images = {}
|
|
|
|
for i, image in ipairs(images) do
|
|
|
|
if type(image) == "string" then
|
|
|
|
slab_images[i] = {
|
|
|
|
name = image,
|
|
|
|
}
|
2018-10-04 01:33:11 +02:00
|
|
|
if worldaligntex then
|
|
|
|
slab_images[i].align_style = "world"
|
|
|
|
end
|
2017-11-02 05:30:19 +01:00
|
|
|
else
|
|
|
|
slab_images[i] = table.copy(image)
|
2018-10-04 01:33:11 +02:00
|
|
|
if worldaligntex and image.align_style == nil then
|
2017-11-02 05:30:19 +01:00
|
|
|
slab_images[i].align_style = "world"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2018-01-31 20:49:27 +01:00
|
|
|
local new_groups = table.copy(groups)
|
|
|
|
new_groups.slab = 1
|
2019-07-30 11:19:22 +02:00
|
|
|
warn_if_exists("stairs:slab_" .. subname)
|
2013-05-18 16:05:16 +02:00
|
|
|
minetest.register_node(":stairs:slab_" .. subname, {
|
|
|
|
description = description,
|
|
|
|
drawtype = "nodebox",
|
2017-11-02 05:30:19 +01:00
|
|
|
tiles = slab_images,
|
2013-05-18 16:05:16 +02:00
|
|
|
paramtype = "light",
|
2013-09-11 16:32:32 +02:00
|
|
|
paramtype2 = "facedir",
|
2015-06-14 05:58:54 +02:00
|
|
|
is_ground_content = false,
|
2018-01-31 20:49:27 +01:00
|
|
|
groups = new_groups,
|
2013-05-18 16:05:16 +02:00
|
|
|
sounds = sounds,
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
|
|
|
},
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
2016-01-25 13:45:25 +01:00
|
|
|
local under = minetest.get_node(pointed_thing.under)
|
|
|
|
local wield_item = itemstack:get_name()
|
2017-10-01 15:41:58 +02:00
|
|
|
local player_name = placer and placer:get_player_name() or ""
|
2017-03-29 21:02:26 +02:00
|
|
|
local creative_enabled = (creative and creative.is_enabled_for
|
2017-10-01 15:41:58 +02:00
|
|
|
and creative.is_enabled_for(player_name))
|
2013-05-18 16:05:16 +02:00
|
|
|
|
2018-09-03 04:34:56 +02:00
|
|
|
if under and under.name:find("^stairs:slab_") then
|
2016-01-25 13:45:25 +01:00
|
|
|
-- place slab using under node orientation
|
|
|
|
local dir = minetest.dir_to_facedir(vector.subtract(
|
|
|
|
pointed_thing.above, pointed_thing.under), true)
|
2013-10-05 02:33:41 +02:00
|
|
|
|
2016-01-25 13:45:25 +01:00
|
|
|
local p2 = under.param2
|
2013-10-05 02:33:41 +02:00
|
|
|
|
2016-01-25 13:45:25 +01:00
|
|
|
-- Placing a slab on an upside down slab should make it right-side up.
|
|
|
|
if p2 >= 20 and dir == 8 then
|
|
|
|
p2 = p2 - 20
|
|
|
|
-- same for the opposite case: slab below normal slab
|
|
|
|
elseif p2 <= 3 and dir == 4 then
|
|
|
|
p2 = p2 + 20
|
|
|
|
end
|
2013-10-05 02:33:41 +02:00
|
|
|
|
2016-01-25 13:45:25 +01:00
|
|
|
-- else attempt to place node with proper param2
|
|
|
|
minetest.item_place_node(ItemStack(wield_item), placer, pointed_thing, p2)
|
2017-03-29 21:02:26 +02:00
|
|
|
if not creative_enabled then
|
2016-01-25 13:45:25 +01:00
|
|
|
itemstack:take_item()
|
|
|
|
end
|
|
|
|
return itemstack
|
|
|
|
else
|
2017-04-11 08:51:13 +02:00
|
|
|
return rotate_and_place(itemstack, placer, pointed_thing)
|
2016-01-25 13:45:25 +01:00
|
|
|
end
|
2013-05-18 16:05:16 +02:00
|
|
|
end,
|
|
|
|
})
|
2013-10-05 02:33:41 +02:00
|
|
|
|
2013-09-11 16:32:32 +02:00
|
|
|
-- for replace ABM
|
2015-08-14 04:00:32 +02:00
|
|
|
if replace then
|
|
|
|
minetest.register_node(":stairs:slab_" .. subname .. "upside_down", {
|
|
|
|
replace_name = "stairs:slab_".. subname,
|
|
|
|
groups = {slabs_replace = 1},
|
|
|
|
})
|
|
|
|
end
|
2013-05-18 16:05:16 +02:00
|
|
|
|
2016-05-30 21:03:55 +02:00
|
|
|
if recipeitem then
|
|
|
|
minetest.register_craft({
|
2019-08-01 03:40:39 +02:00
|
|
|
output = "stairs:slab_" .. subname .. " 6",
|
2016-05-30 21:03:55 +02:00
|
|
|
recipe = {
|
|
|
|
{recipeitem, recipeitem, recipeitem},
|
|
|
|
},
|
|
|
|
})
|
Add and edit fuel registrations
Edited fuels: fences, wooden ladder.
New fuels:
boat, paper, book, dry shrub, stick, vessels shelf, wooden tools,
wooden door, trapdoor, fence gates, farming crops, stairs, slabs, beds.
2016-10-30 11:29:58 +01:00
|
|
|
|
2017-05-22 03:20:10 +02:00
|
|
|
-- Use 2 slabs to craft a full block again (1:1)
|
|
|
|
minetest.register_craft({
|
|
|
|
output = recipeitem,
|
|
|
|
recipe = {
|
2019-08-01 03:40:39 +02:00
|
|
|
{"stairs:slab_" .. subname},
|
|
|
|
{"stairs:slab_" .. subname},
|
2017-05-22 03:20:10 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
Add and edit fuel registrations
Edited fuels: fences, wooden ladder.
New fuels:
boat, paper, book, dry shrub, stick, vessels shelf, wooden tools,
wooden door, trapdoor, fence gates, farming crops, stairs, slabs, beds.
2016-10-30 11:29:58 +01:00
|
|
|
-- Fuel
|
|
|
|
local baseburntime = minetest.get_craft_result({
|
|
|
|
method = "fuel",
|
|
|
|
width = 1,
|
|
|
|
items = {recipeitem}
|
|
|
|
}).time
|
|
|
|
if baseburntime > 0 then
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
2019-08-01 03:40:39 +02:00
|
|
|
recipe = "stairs:slab_" .. subname,
|
Add and edit fuel registrations
Edited fuels: fences, wooden ladder.
New fuels:
boat, paper, book, dry shrub, stick, vessels shelf, wooden tools,
wooden door, trapdoor, fence gates, farming crops, stairs, slabs, beds.
2016-10-30 11:29:58 +01:00
|
|
|
burntime = math.floor(baseburntime * 0.5),
|
|
|
|
})
|
|
|
|
end
|
2016-05-30 21:03:55 +02:00
|
|
|
end
|
2013-05-18 16:05:16 +02:00
|
|
|
end
|
|
|
|
|
2013-09-11 16:32:32 +02:00
|
|
|
|
2015-08-14 04:00:32 +02:00
|
|
|
-- Optionally replace old "upside_down" nodes with new param2 versions.
|
|
|
|
-- Disabled by default.
|
|
|
|
|
|
|
|
if replace then
|
|
|
|
minetest.register_abm({
|
2016-08-08 11:56:13 +02:00
|
|
|
label = "Slab replace",
|
2015-08-14 04:00:32 +02:00
|
|
|
nodenames = {"group:slabs_replace"},
|
2016-02-13 09:33:58 +01:00
|
|
|
interval = 16,
|
2015-08-14 04:00:32 +02:00
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node)
|
|
|
|
node.name = minetest.registered_nodes[node.name].replace_name
|
|
|
|
node.param2 = node.param2 + 20
|
|
|
|
if node.param2 == 21 then
|
|
|
|
node.param2 = 23
|
|
|
|
elseif node.param2 == 23 then
|
|
|
|
node.param2 = 21
|
|
|
|
end
|
|
|
|
minetest.set_node(pos, node)
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2017-12-05 06:40:16 +01:00
|
|
|
|
|
|
|
-- Register inner stair
|
2017-07-05 19:35:26 +02:00
|
|
|
-- Node will be called stairs:stair_inner_<subname>
|
|
|
|
|
2018-10-04 01:33:11 +02:00
|
|
|
function stairs.register_stair_inner(subname, recipeitem, groups, images,
|
2019-09-12 19:03:10 +02:00
|
|
|
description, sounds, worldaligntex, full_description)
|
2017-11-02 05:30:19 +01:00
|
|
|
-- Set backface culling and world-aligned textures
|
2017-07-05 19:35:26 +02:00
|
|
|
local stair_images = {}
|
|
|
|
for i, image in ipairs(images) do
|
|
|
|
if type(image) == "string" then
|
|
|
|
stair_images[i] = {
|
|
|
|
name = image,
|
|
|
|
backface_culling = true,
|
|
|
|
}
|
2018-10-04 01:33:11 +02:00
|
|
|
if worldaligntex then
|
|
|
|
stair_images[i].align_style = "world"
|
|
|
|
end
|
2017-11-02 05:30:19 +01:00
|
|
|
else
|
2017-07-05 19:35:26 +02:00
|
|
|
stair_images[i] = table.copy(image)
|
2017-11-02 05:30:19 +01:00
|
|
|
if stair_images[i].backface_culling == nil then
|
|
|
|
stair_images[i].backface_culling = true
|
|
|
|
end
|
2018-10-04 01:33:11 +02:00
|
|
|
if worldaligntex and stair_images[i].align_style == nil then
|
2017-11-02 05:30:19 +01:00
|
|
|
stair_images[i].align_style = "world"
|
|
|
|
end
|
2017-07-05 19:35:26 +02:00
|
|
|
end
|
|
|
|
end
|
2018-01-31 20:49:27 +01:00
|
|
|
local new_groups = table.copy(groups)
|
|
|
|
new_groups.stair = 1
|
2019-09-12 19:03:10 +02:00
|
|
|
if full_description then
|
|
|
|
description = full_description
|
|
|
|
else
|
|
|
|
description = "Inner " .. description
|
|
|
|
end
|
2019-07-30 11:19:22 +02:00
|
|
|
warn_if_exists("stairs:stair_inner_" .. subname)
|
2017-07-05 19:35:26 +02:00
|
|
|
minetest.register_node(":stairs:stair_inner_" .. subname, {
|
2019-09-12 19:03:10 +02:00
|
|
|
description = description,
|
2017-11-02 05:30:19 +01:00
|
|
|
drawtype = "nodebox",
|
2017-07-05 19:35:26 +02:00
|
|
|
tiles = stair_images,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
is_ground_content = false,
|
2018-01-31 20:49:27 +01:00
|
|
|
groups = new_groups,
|
2017-07-05 19:35:26 +02:00
|
|
|
sounds = sounds,
|
2017-11-02 05:30:19 +01:00
|
|
|
node_box = {
|
2017-07-05 19:35:26 +02:00
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
2017-11-02 05:30:19 +01:00
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
|
|
|
|
{-0.5, 0.0, 0.0, 0.5, 0.5, 0.5},
|
|
|
|
{-0.5, 0.0, -0.5, 0.0, 0.5, 0.0},
|
2017-07-05 19:35:26 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
if pointed_thing.type ~= "node" then
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
|
|
|
|
return rotate_and_place(itemstack, placer, pointed_thing)
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
if recipeitem then
|
|
|
|
minetest.register_craft({
|
2019-08-01 03:40:39 +02:00
|
|
|
output = "stairs:stair_inner_" .. subname .. " 7",
|
2017-07-05 19:35:26 +02:00
|
|
|
recipe = {
|
2019-01-02 12:40:32 +01:00
|
|
|
{"", recipeitem, ""},
|
|
|
|
{recipeitem, "", recipeitem},
|
2017-07-05 19:35:26 +02:00
|
|
|
{recipeitem, recipeitem, recipeitem},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Fuel
|
|
|
|
local baseburntime = minetest.get_craft_result({
|
|
|
|
method = "fuel",
|
|
|
|
width = 1,
|
|
|
|
items = {recipeitem}
|
|
|
|
}).time
|
|
|
|
if baseburntime > 0 then
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
2019-08-01 03:40:39 +02:00
|
|
|
recipe = "stairs:stair_inner_" .. subname,
|
2017-07-05 19:35:26 +02:00
|
|
|
burntime = math.floor(baseburntime * 0.875),
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-12-05 06:40:16 +01:00
|
|
|
|
|
|
|
-- Register outer stair
|
2017-07-05 19:35:26 +02:00
|
|
|
-- Node will be called stairs:stair_outer_<subname>
|
|
|
|
|
2018-10-04 01:33:11 +02:00
|
|
|
function stairs.register_stair_outer(subname, recipeitem, groups, images,
|
2019-09-12 19:03:10 +02:00
|
|
|
description, sounds, worldaligntex, full_description)
|
2017-11-02 05:30:19 +01:00
|
|
|
-- Set backface culling and world-aligned textures
|
2017-07-05 19:35:26 +02:00
|
|
|
local stair_images = {}
|
|
|
|
for i, image in ipairs(images) do
|
|
|
|
if type(image) == "string" then
|
|
|
|
stair_images[i] = {
|
|
|
|
name = image,
|
|
|
|
backface_culling = true,
|
|
|
|
}
|
2018-10-04 01:33:11 +02:00
|
|
|
if worldaligntex then
|
|
|
|
stair_images[i].align_style = "world"
|
|
|
|
end
|
2017-11-02 05:30:19 +01:00
|
|
|
else
|
2017-07-05 19:35:26 +02:00
|
|
|
stair_images[i] = table.copy(image)
|
2017-11-02 05:30:19 +01:00
|
|
|
if stair_images[i].backface_culling == nil then
|
|
|
|
stair_images[i].backface_culling = true
|
|
|
|
end
|
2018-10-04 01:33:11 +02:00
|
|
|
if worldaligntex and stair_images[i].align_style == nil then
|
2017-11-02 05:30:19 +01:00
|
|
|
stair_images[i].align_style = "world"
|
|
|
|
end
|
2017-07-05 19:35:26 +02:00
|
|
|
end
|
|
|
|
end
|
2018-01-31 20:49:27 +01:00
|
|
|
local new_groups = table.copy(groups)
|
|
|
|
new_groups.stair = 1
|
2019-09-12 19:03:10 +02:00
|
|
|
if full_description then
|
|
|
|
description = full_description
|
|
|
|
else
|
|
|
|
description = "Outer " .. description
|
|
|
|
end
|
2019-07-30 11:19:22 +02:00
|
|
|
warn_if_exists("stairs:stair_outer_" .. subname)
|
2017-07-05 19:35:26 +02:00
|
|
|
minetest.register_node(":stairs:stair_outer_" .. subname, {
|
2019-09-12 19:03:10 +02:00
|
|
|
description = description,
|
2017-11-02 05:30:19 +01:00
|
|
|
drawtype = "nodebox",
|
2017-07-05 19:35:26 +02:00
|
|
|
tiles = stair_images,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
is_ground_content = false,
|
2018-01-31 20:49:27 +01:00
|
|
|
groups = new_groups,
|
2017-07-05 19:35:26 +02:00
|
|
|
sounds = sounds,
|
2017-11-02 05:30:19 +01:00
|
|
|
node_box = {
|
2017-07-05 19:35:26 +02:00
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
2017-11-02 05:30:19 +01:00
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
|
|
|
|
{-0.5, 0.0, 0.0, 0.0, 0.5, 0.5},
|
2017-07-05 19:35:26 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
if pointed_thing.type ~= "node" then
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
|
|
|
|
return rotate_and_place(itemstack, placer, pointed_thing)
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
if recipeitem then
|
|
|
|
minetest.register_craft({
|
2019-08-01 03:40:39 +02:00
|
|
|
output = "stairs:stair_outer_" .. subname .. " 6",
|
2017-07-05 19:35:26 +02:00
|
|
|
recipe = {
|
2019-01-02 12:40:32 +01:00
|
|
|
{"", recipeitem, ""},
|
2017-07-05 19:35:26 +02:00
|
|
|
{recipeitem, recipeitem, recipeitem},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Fuel
|
|
|
|
local baseburntime = minetest.get_craft_result({
|
|
|
|
method = "fuel",
|
|
|
|
width = 1,
|
|
|
|
items = {recipeitem}
|
|
|
|
}).time
|
|
|
|
if baseburntime > 0 then
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
2019-08-01 03:40:39 +02:00
|
|
|
recipe = "stairs:stair_outer_" .. subname,
|
2017-07-05 19:35:26 +02:00
|
|
|
burntime = math.floor(baseburntime * 0.625),
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-08-14 04:00:32 +02:00
|
|
|
|
2017-12-05 06:40:16 +01:00
|
|
|
|
2015-08-14 04:00:32 +02:00
|
|
|
-- Stair/slab registration function.
|
2013-05-18 16:05:16 +02:00
|
|
|
-- Nodes will be called stairs:{stair,slab}_<subname>
|
2015-08-14 04:00:32 +02:00
|
|
|
|
2018-10-04 01:33:11 +02:00
|
|
|
function stairs.register_stair_and_slab(subname, recipeitem, groups, images,
|
2020-09-22 00:38:49 +02:00
|
|
|
desc_stair, desc_slab, sounds, worldaligntex,
|
|
|
|
desc_stair_inner, desc_stair_outer)
|
2018-10-04 01:33:11 +02:00
|
|
|
stairs.register_stair(subname, recipeitem, groups, images, desc_stair,
|
|
|
|
sounds, worldaligntex)
|
2020-09-22 00:38:49 +02:00
|
|
|
stairs.register_stair_inner(subname, recipeitem, groups, images,
|
|
|
|
desc_stair, sounds, worldaligntex, desc_stair_inner)
|
|
|
|
stairs.register_stair_outer(subname, recipeitem, groups, images,
|
|
|
|
desc_stair, sounds, worldaligntex, desc_stair_outer)
|
2018-10-04 01:33:11 +02:00
|
|
|
stairs.register_slab(subname, recipeitem, groups, images, desc_slab,
|
|
|
|
sounds, worldaligntex)
|
2013-05-18 16:05:16 +02:00
|
|
|
end
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
-- Local function so we can apply translations
|
|
|
|
local function my_register_stair_and_slab(subname, recipeitem, groups, images,
|
|
|
|
desc_stair, desc_slab, sounds, worldaligntex)
|
|
|
|
stairs.register_stair(subname, recipeitem, groups, images, S(desc_stair),
|
|
|
|
sounds, worldaligntex)
|
|
|
|
stairs.register_stair_inner(subname, recipeitem, groups, images, "",
|
|
|
|
sounds, worldaligntex, S("Inner " .. desc_stair))
|
|
|
|
stairs.register_stair_outer(subname, recipeitem, groups, images, "",
|
|
|
|
sounds, worldaligntex, S("Outer " .. desc_stair))
|
|
|
|
stairs.register_slab(subname, recipeitem, groups, images, S(desc_slab),
|
|
|
|
sounds, worldaligntex)
|
|
|
|
end
|
|
|
|
|
2017-12-05 06:40:16 +01:00
|
|
|
|
2015-08-14 04:00:32 +02:00
|
|
|
-- Register default stairs and slabs
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"wood",
|
|
|
|
"default:wood",
|
2016-08-27 03:41:31 +02:00
|
|
|
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
2016-06-26 04:57:30 +02:00
|
|
|
{"default_wood.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Wooden Stair",
|
|
|
|
"Wooden Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_wood_defaults(),
|
|
|
|
false
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"junglewood",
|
|
|
|
"default:junglewood",
|
2016-08-27 03:41:31 +02:00
|
|
|
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
2016-06-26 04:57:30 +02:00
|
|
|
{"default_junglewood.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Jungle Wood Stair",
|
|
|
|
"Jungle Wood Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_wood_defaults(),
|
|
|
|
false
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"pine_wood",
|
|
|
|
"default:pine_wood",
|
2016-08-27 03:41:31 +02:00
|
|
|
{choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
|
2016-06-26 04:57:30 +02:00
|
|
|
{"default_pine_wood.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Pine Wood Stair",
|
|
|
|
"Pine Wood Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_wood_defaults(),
|
|
|
|
false
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"acacia_wood",
|
|
|
|
"default:acacia_wood",
|
2016-08-27 03:41:31 +02:00
|
|
|
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
2016-06-26 04:57:30 +02:00
|
|
|
{"default_acacia_wood.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Acacia Wood Stair",
|
|
|
|
"Acacia Wood Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_wood_defaults(),
|
|
|
|
false
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"aspen_wood",
|
|
|
|
"default:aspen_wood",
|
2016-08-27 03:41:31 +02:00
|
|
|
{choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
|
2016-06-26 04:57:30 +02:00
|
|
|
{"default_aspen_wood.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Aspen Wood Stair",
|
|
|
|
"Aspen Wood Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_wood_defaults(),
|
|
|
|
false
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"stone",
|
|
|
|
"default:stone",
|
|
|
|
{cracky = 3},
|
|
|
|
{"default_stone.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Stone Stair",
|
|
|
|
"Stone Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"cobble",
|
|
|
|
"default:cobble",
|
|
|
|
{cracky = 3},
|
|
|
|
{"default_cobble.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Cobblestone Stair",
|
|
|
|
"Cobblestone Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"mossycobble",
|
2017-06-22 20:38:02 +02:00
|
|
|
"default:mossycobble",
|
2016-06-26 04:57:30 +02:00
|
|
|
{cracky = 3},
|
|
|
|
{"default_mossycobble.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Mossy Cobblestone Stair",
|
|
|
|
"Mossy Cobblestone Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"stonebrick",
|
|
|
|
"default:stonebrick",
|
|
|
|
{cracky = 2},
|
|
|
|
{"default_stone_brick.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Stone Brick Stair",
|
|
|
|
"Stone Brick Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
false
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"stone_block",
|
|
|
|
"default:stone_block",
|
|
|
|
{cracky = 2},
|
|
|
|
{"default_stone_block.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Stone Block Stair",
|
|
|
|
"Stone Block Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"desert_stone",
|
|
|
|
"default:desert_stone",
|
|
|
|
{cracky = 3},
|
|
|
|
{"default_desert_stone.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Desert Stone Stair",
|
|
|
|
"Desert Stone Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"desert_cobble",
|
|
|
|
"default:desert_cobble",
|
|
|
|
{cracky = 3},
|
|
|
|
{"default_desert_cobble.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Desert Cobblestone Stair",
|
|
|
|
"Desert Cobblestone Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"desert_stonebrick",
|
|
|
|
"default:desert_stonebrick",
|
|
|
|
{cracky = 2},
|
|
|
|
{"default_desert_stone_brick.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Desert Stone Brick Stair",
|
|
|
|
"Desert Stone Brick Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
false
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"desert_stone_block",
|
|
|
|
"default:desert_stone_block",
|
|
|
|
{cracky = 2},
|
|
|
|
{"default_desert_stone_block.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Desert Stone Block Stair",
|
|
|
|
"Desert Stone Block Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"sandstone",
|
|
|
|
"default:sandstone",
|
|
|
|
{crumbly = 1, cracky = 3},
|
|
|
|
{"default_sandstone.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Sandstone Stair",
|
|
|
|
"Sandstone Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"sandstonebrick",
|
|
|
|
"default:sandstonebrick",
|
|
|
|
{cracky = 2},
|
|
|
|
{"default_sandstone_brick.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Sandstone Brick Stair",
|
|
|
|
"Sandstone Brick Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
false
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"sandstone_block",
|
|
|
|
"default:sandstone_block",
|
|
|
|
{cracky = 2},
|
|
|
|
{"default_sandstone_block.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Sandstone Block Stair",
|
|
|
|
"Sandstone Block Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2017-03-07 04:03:30 +01:00
|
|
|
"desert_sandstone",
|
|
|
|
"default:desert_sandstone",
|
|
|
|
{crumbly = 1, cracky = 3},
|
|
|
|
{"default_desert_sandstone.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Desert Sandstone Stair",
|
|
|
|
"Desert Sandstone Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2017-03-07 04:03:30 +01:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2017-03-07 04:03:30 +01:00
|
|
|
"desert_sandstone_brick",
|
|
|
|
"default:desert_sandstone_brick",
|
|
|
|
{cracky = 2},
|
|
|
|
{"default_desert_sandstone_brick.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Desert Sandstone Brick Stair",
|
|
|
|
"Desert Sandstone Brick Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
false
|
2017-03-07 04:03:30 +01:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2017-03-07 04:03:30 +01:00
|
|
|
"desert_sandstone_block",
|
|
|
|
"default:desert_sandstone_block",
|
|
|
|
{cracky = 2},
|
|
|
|
{"default_desert_sandstone_block.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Desert Sandstone Block Stair",
|
|
|
|
"Desert Sandstone Block Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2017-03-07 04:03:30 +01:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2017-03-07 04:03:30 +01:00
|
|
|
"silver_sandstone",
|
|
|
|
"default:silver_sandstone",
|
|
|
|
{crumbly = 1, cracky = 3},
|
|
|
|
{"default_silver_sandstone.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Silver Sandstone Stair",
|
|
|
|
"Silver Sandstone Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2017-03-07 04:03:30 +01:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2017-03-07 04:03:30 +01:00
|
|
|
"silver_sandstone_brick",
|
|
|
|
"default:silver_sandstone_brick",
|
|
|
|
{cracky = 2},
|
|
|
|
{"default_silver_sandstone_brick.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Silver Sandstone Brick Stair",
|
|
|
|
"Silver Sandstone Brick Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
false
|
2017-03-07 04:03:30 +01:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2017-03-07 04:03:30 +01:00
|
|
|
"silver_sandstone_block",
|
|
|
|
"default:silver_sandstone_block",
|
|
|
|
{cracky = 2},
|
|
|
|
{"default_silver_sandstone_block.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Silver Sandstone Block Stair",
|
|
|
|
"Silver Sandstone Block Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2017-03-07 04:03:30 +01:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"obsidian",
|
|
|
|
"default:obsidian",
|
|
|
|
{cracky = 1, level = 2},
|
|
|
|
{"default_obsidian.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Obsidian Stair",
|
|
|
|
"Obsidian Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"obsidianbrick",
|
|
|
|
"default:obsidianbrick",
|
|
|
|
{cracky = 1, level = 2},
|
|
|
|
{"default_obsidian_brick.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Obsidian Brick Stair",
|
|
|
|
"Obsidian Brick Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
false
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"obsidian_block",
|
|
|
|
"default:obsidian_block",
|
|
|
|
{cracky = 1, level = 2},
|
|
|
|
{"default_obsidian_block.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Obsidian Block Stair",
|
|
|
|
"Obsidian Block Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"brick",
|
|
|
|
"default:brick",
|
|
|
|
{cracky = 3},
|
|
|
|
{"default_brick.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Brick Stair",
|
|
|
|
"Brick Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_stone_defaults(),
|
|
|
|
false
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"steelblock",
|
|
|
|
"default:steelblock",
|
|
|
|
{cracky = 1, level = 2},
|
|
|
|
{"default_steel_block.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Steel Block Stair",
|
|
|
|
"Steel Block Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_metal_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2017-07-07 23:21:14 +02:00
|
|
|
"tinblock",
|
|
|
|
"default:tinblock",
|
|
|
|
{cracky = 1, level = 2},
|
|
|
|
{"default_tin_block.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Tin Block Stair",
|
|
|
|
"Tin Block Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_metal_defaults(),
|
|
|
|
true
|
2017-07-07 23:21:14 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"copperblock",
|
|
|
|
"default:copperblock",
|
|
|
|
{cracky = 1, level = 2},
|
|
|
|
{"default_copper_block.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Copper Block Stair",
|
|
|
|
"Copper Block Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_metal_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"bronzeblock",
|
|
|
|
"default:bronzeblock",
|
|
|
|
{cracky = 1, level = 2},
|
|
|
|
{"default_bronze_block.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Bronze Block Stair",
|
|
|
|
"Bronze Block Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_metal_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2016-06-26 04:57:30 +02:00
|
|
|
"goldblock",
|
|
|
|
"default:goldblock",
|
|
|
|
{cracky = 1},
|
|
|
|
{"default_gold_block.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Gold Block Stair",
|
|
|
|
"Gold Block Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_metal_defaults(),
|
|
|
|
true
|
2016-06-26 04:57:30 +02:00
|
|
|
)
|
2017-03-27 22:55:53 +02:00
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2017-03-27 22:55:53 +02:00
|
|
|
"ice",
|
|
|
|
"default:ice",
|
2018-12-08 05:00:38 +01:00
|
|
|
{cracky = 3, cools_lava = 1, slippery = 3},
|
2017-03-27 22:55:53 +02:00
|
|
|
{"default_ice.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Ice Stair",
|
|
|
|
"Ice Slab",
|
2020-08-29 02:16:36 +02:00
|
|
|
default.node_sound_ice_defaults(),
|
2018-10-04 01:33:11 +02:00
|
|
|
true
|
2017-03-27 22:55:53 +02:00
|
|
|
)
|
|
|
|
|
2019-09-12 19:03:10 +02:00
|
|
|
my_register_stair_and_slab(
|
2017-03-27 22:55:53 +02:00
|
|
|
"snowblock",
|
|
|
|
"default:snowblock",
|
2018-12-08 05:00:38 +01:00
|
|
|
{crumbly = 3, cools_lava = 1, snowy = 1},
|
2017-03-27 22:55:53 +02:00
|
|
|
{"default_snow.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"Snow Block Stair",
|
|
|
|
"Snow Block Slab",
|
2018-10-04 01:33:11 +02:00
|
|
|
default.node_sound_snow_defaults(),
|
|
|
|
true
|
2017-03-27 22:55:53 +02:00
|
|
|
)
|
2018-10-09 21:44:15 +02:00
|
|
|
|
|
|
|
-- Glass stair nodes need to be registered individually to utilize specialized textures.
|
|
|
|
|
|
|
|
stairs.register_stair(
|
|
|
|
"glass",
|
|
|
|
"default:glass",
|
2020-05-10 13:37:37 +02:00
|
|
|
{cracky = 3, oddly_breakable_by_hand = 3},
|
2018-10-09 21:44:15 +02:00
|
|
|
{"stairs_glass_split.png", "default_glass.png",
|
|
|
|
"stairs_glass_stairside.png^[transformFX", "stairs_glass_stairside.png",
|
|
|
|
"default_glass.png", "stairs_glass_split.png"},
|
2019-09-10 19:09:51 +02:00
|
|
|
S("Glass Stair"),
|
2018-10-09 21:44:15 +02:00
|
|
|
default.node_sound_glass_defaults(),
|
|
|
|
false
|
|
|
|
)
|
|
|
|
|
|
|
|
stairs.register_slab(
|
|
|
|
"glass",
|
|
|
|
"default:glass",
|
2020-05-10 13:37:37 +02:00
|
|
|
{cracky = 3, oddly_breakable_by_hand = 3},
|
2018-10-09 21:44:15 +02:00
|
|
|
{"default_glass.png", "default_glass.png", "stairs_glass_split.png"},
|
2019-09-10 19:09:51 +02:00
|
|
|
S("Glass Slab"),
|
2018-10-09 21:44:15 +02:00
|
|
|
default.node_sound_glass_defaults(),
|
|
|
|
false
|
|
|
|
)
|
|
|
|
|
|
|
|
stairs.register_stair_inner(
|
|
|
|
"glass",
|
|
|
|
"default:glass",
|
2020-05-10 13:37:37 +02:00
|
|
|
{cracky = 3, oddly_breakable_by_hand = 3},
|
2018-10-09 21:44:15 +02:00
|
|
|
{"stairs_glass_stairside.png^[transformR270", "default_glass.png",
|
|
|
|
"stairs_glass_stairside.png^[transformFX", "default_glass.png",
|
|
|
|
"default_glass.png", "stairs_glass_stairside.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"",
|
2018-10-09 21:44:15 +02:00
|
|
|
default.node_sound_glass_defaults(),
|
2019-09-12 19:03:10 +02:00
|
|
|
false,
|
|
|
|
S("Inner Glass Stair")
|
2018-10-09 21:44:15 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
stairs.register_stair_outer(
|
|
|
|
"glass",
|
|
|
|
"default:glass",
|
2020-05-10 13:37:37 +02:00
|
|
|
{cracky = 3, oddly_breakable_by_hand = 3},
|
2018-10-09 21:44:15 +02:00
|
|
|
{"stairs_glass_stairside.png^[transformR90", "default_glass.png",
|
|
|
|
"stairs_glass_outer_stairside.png", "stairs_glass_stairside.png",
|
|
|
|
"stairs_glass_stairside.png^[transformR90","stairs_glass_outer_stairside.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"",
|
2018-10-09 21:44:15 +02:00
|
|
|
default.node_sound_glass_defaults(),
|
2019-09-12 19:03:10 +02:00
|
|
|
false,
|
|
|
|
S("Outer Glass Stair")
|
2018-10-09 21:44:15 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
stairs.register_stair(
|
|
|
|
"obsidian_glass",
|
|
|
|
"default:obsidian_glass",
|
|
|
|
{cracky = 3},
|
|
|
|
{"stairs_obsidian_glass_split.png", "default_obsidian_glass.png",
|
|
|
|
"stairs_obsidian_glass_stairside.png^[transformFX", "stairs_obsidian_glass_stairside.png",
|
|
|
|
"default_obsidian_glass.png", "stairs_obsidian_glass_split.png"},
|
2019-09-10 19:09:51 +02:00
|
|
|
S("Obsidian Glass Stair"),
|
2018-10-09 21:44:15 +02:00
|
|
|
default.node_sound_glass_defaults(),
|
|
|
|
false
|
|
|
|
)
|
|
|
|
|
|
|
|
stairs.register_slab(
|
|
|
|
"obsidian_glass",
|
|
|
|
"default:obsidian_glass",
|
|
|
|
{cracky = 3},
|
|
|
|
{"default_obsidian_glass.png", "default_obsidian_glass.png", "stairs_obsidian_glass_split.png"},
|
2019-09-10 19:09:51 +02:00
|
|
|
S("Obsidian Glass Slab"),
|
2018-10-09 21:44:15 +02:00
|
|
|
default.node_sound_glass_defaults(),
|
|
|
|
false
|
|
|
|
)
|
|
|
|
|
|
|
|
stairs.register_stair_inner(
|
|
|
|
"obsidian_glass",
|
|
|
|
"default:obsidian_glass",
|
|
|
|
{cracky = 3},
|
|
|
|
{"stairs_obsidian_glass_stairside.png^[transformR270", "default_obsidian_glass.png",
|
|
|
|
"stairs_obsidian_glass_stairside.png^[transformFX", "default_obsidian_glass.png",
|
|
|
|
"default_obsidian_glass.png", "stairs_obsidian_glass_stairside.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"",
|
2018-10-09 21:44:15 +02:00
|
|
|
default.node_sound_glass_defaults(),
|
2019-09-12 19:03:10 +02:00
|
|
|
false,
|
|
|
|
S("Inner Obsidian Glass Stair")
|
2018-10-09 21:44:15 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
stairs.register_stair_outer(
|
|
|
|
"obsidian_glass",
|
|
|
|
"default:obsidian_glass",
|
|
|
|
{cracky = 3},
|
|
|
|
{"stairs_obsidian_glass_stairside.png^[transformR90", "default_obsidian_glass.png",
|
|
|
|
"stairs_obsidian_glass_outer_stairside.png", "stairs_obsidian_glass_stairside.png",
|
|
|
|
"stairs_obsidian_glass_stairside.png^[transformR90","stairs_obsidian_glass_outer_stairside.png"},
|
2019-09-12 19:03:10 +02:00
|
|
|
"",
|
2018-10-09 21:44:15 +02:00
|
|
|
default.node_sound_glass_defaults(),
|
2019-09-12 19:03:10 +02:00
|
|
|
false,
|
|
|
|
S("Outer Obsidian Glass Stair")
|
2018-10-09 21:44:15 +02:00
|
|
|
)
|
2019-09-12 19:03:10 +02:00
|
|
|
|
|
|
|
-- Dummy calls to S() to allow translation scripts to detect the strings.
|
|
|
|
-- To update this add this code to my_register_stair_and_slab:
|
|
|
|
-- for _,x in ipairs({"","Inner ","Outer "}) do print(("S(%q)"):format(x..desc_stair)) end
|
|
|
|
-- print(("S(%q)"):format(desc_slab))
|
|
|
|
|
|
|
|
--[[
|
|
|
|
S("Wooden Stair")
|
|
|
|
S("Inner Wooden Stair")
|
|
|
|
S("Outer Wooden Stair")
|
|
|
|
S("Wooden Slab")
|
|
|
|
S("Jungle Wood Stair")
|
|
|
|
S("Inner Jungle Wood Stair")
|
|
|
|
S("Outer Jungle Wood Stair")
|
|
|
|
S("Jungle Wood Slab")
|
|
|
|
S("Pine Wood Stair")
|
|
|
|
S("Inner Pine Wood Stair")
|
|
|
|
S("Outer Pine Wood Stair")
|
|
|
|
S("Pine Wood Slab")
|
|
|
|
S("Acacia Wood Stair")
|
|
|
|
S("Inner Acacia Wood Stair")
|
|
|
|
S("Outer Acacia Wood Stair")
|
|
|
|
S("Acacia Wood Slab")
|
|
|
|
S("Aspen Wood Stair")
|
|
|
|
S("Inner Aspen Wood Stair")
|
|
|
|
S("Outer Aspen Wood Stair")
|
|
|
|
S("Aspen Wood Slab")
|
|
|
|
S("Stone Stair")
|
|
|
|
S("Inner Stone Stair")
|
|
|
|
S("Outer Stone Stair")
|
|
|
|
S("Stone Slab")
|
|
|
|
S("Cobblestone Stair")
|
|
|
|
S("Inner Cobblestone Stair")
|
|
|
|
S("Outer Cobblestone Stair")
|
|
|
|
S("Cobblestone Slab")
|
|
|
|
S("Mossy Cobblestone Stair")
|
|
|
|
S("Inner Mossy Cobblestone Stair")
|
|
|
|
S("Outer Mossy Cobblestone Stair")
|
|
|
|
S("Mossy Cobblestone Slab")
|
|
|
|
S("Stone Brick Stair")
|
|
|
|
S("Inner Stone Brick Stair")
|
|
|
|
S("Outer Stone Brick Stair")
|
|
|
|
S("Stone Brick Slab")
|
|
|
|
S("Stone Block Stair")
|
|
|
|
S("Inner Stone Block Stair")
|
|
|
|
S("Outer Stone Block Stair")
|
|
|
|
S("Stone Block Slab")
|
|
|
|
S("Desert Stone Stair")
|
|
|
|
S("Inner Desert Stone Stair")
|
|
|
|
S("Outer Desert Stone Stair")
|
|
|
|
S("Desert Stone Slab")
|
|
|
|
S("Desert Cobblestone Stair")
|
|
|
|
S("Inner Desert Cobblestone Stair")
|
|
|
|
S("Outer Desert Cobblestone Stair")
|
|
|
|
S("Desert Cobblestone Slab")
|
|
|
|
S("Desert Stone Brick Stair")
|
|
|
|
S("Inner Desert Stone Brick Stair")
|
|
|
|
S("Outer Desert Stone Brick Stair")
|
|
|
|
S("Desert Stone Brick Slab")
|
|
|
|
S("Desert Stone Block Stair")
|
|
|
|
S("Inner Desert Stone Block Stair")
|
|
|
|
S("Outer Desert Stone Block Stair")
|
|
|
|
S("Desert Stone Block Slab")
|
|
|
|
S("Sandstone Stair")
|
|
|
|
S("Inner Sandstone Stair")
|
|
|
|
S("Outer Sandstone Stair")
|
|
|
|
S("Sandstone Slab")
|
|
|
|
S("Sandstone Brick Stair")
|
|
|
|
S("Inner Sandstone Brick Stair")
|
|
|
|
S("Outer Sandstone Brick Stair")
|
|
|
|
S("Sandstone Brick Slab")
|
|
|
|
S("Sandstone Block Stair")
|
|
|
|
S("Inner Sandstone Block Stair")
|
|
|
|
S("Outer Sandstone Block Stair")
|
|
|
|
S("Sandstone Block Slab")
|
|
|
|
S("Desert Sandstone Stair")
|
|
|
|
S("Inner Desert Sandstone Stair")
|
|
|
|
S("Outer Desert Sandstone Stair")
|
|
|
|
S("Desert Sandstone Slab")
|
|
|
|
S("Desert Sandstone Brick Stair")
|
|
|
|
S("Inner Desert Sandstone Brick Stair")
|
|
|
|
S("Outer Desert Sandstone Brick Stair")
|
|
|
|
S("Desert Sandstone Brick Slab")
|
|
|
|
S("Desert Sandstone Block Stair")
|
|
|
|
S("Inner Desert Sandstone Block Stair")
|
|
|
|
S("Outer Desert Sandstone Block Stair")
|
|
|
|
S("Desert Sandstone Block Slab")
|
|
|
|
S("Silver Sandstone Stair")
|
|
|
|
S("Inner Silver Sandstone Stair")
|
|
|
|
S("Outer Silver Sandstone Stair")
|
|
|
|
S("Silver Sandstone Slab")
|
|
|
|
S("Silver Sandstone Brick Stair")
|
|
|
|
S("Inner Silver Sandstone Brick Stair")
|
|
|
|
S("Outer Silver Sandstone Brick Stair")
|
|
|
|
S("Silver Sandstone Brick Slab")
|
|
|
|
S("Silver Sandstone Block Stair")
|
|
|
|
S("Inner Silver Sandstone Block Stair")
|
|
|
|
S("Outer Silver Sandstone Block Stair")
|
|
|
|
S("Silver Sandstone Block Slab")
|
|
|
|
S("Obsidian Stair")
|
|
|
|
S("Inner Obsidian Stair")
|
|
|
|
S("Outer Obsidian Stair")
|
|
|
|
S("Obsidian Slab")
|
|
|
|
S("Obsidian Brick Stair")
|
|
|
|
S("Inner Obsidian Brick Stair")
|
|
|
|
S("Outer Obsidian Brick Stair")
|
|
|
|
S("Obsidian Brick Slab")
|
|
|
|
S("Obsidian Block Stair")
|
|
|
|
S("Inner Obsidian Block Stair")
|
|
|
|
S("Outer Obsidian Block Stair")
|
|
|
|
S("Obsidian Block Slab")
|
|
|
|
S("Brick Stair")
|
|
|
|
S("Inner Brick Stair")
|
|
|
|
S("Outer Brick Stair")
|
|
|
|
S("Brick Slab")
|
|
|
|
S("Steel Block Stair")
|
|
|
|
S("Inner Steel Block Stair")
|
|
|
|
S("Outer Steel Block Stair")
|
|
|
|
S("Steel Block Slab")
|
|
|
|
S("Tin Block Stair")
|
|
|
|
S("Inner Tin Block Stair")
|
|
|
|
S("Outer Tin Block Stair")
|
|
|
|
S("Tin Block Slab")
|
|
|
|
S("Copper Block Stair")
|
|
|
|
S("Inner Copper Block Stair")
|
|
|
|
S("Outer Copper Block Stair")
|
|
|
|
S("Copper Block Slab")
|
|
|
|
S("Bronze Block Stair")
|
|
|
|
S("Inner Bronze Block Stair")
|
|
|
|
S("Outer Bronze Block Stair")
|
|
|
|
S("Bronze Block Slab")
|
|
|
|
S("Gold Block Stair")
|
|
|
|
S("Inner Gold Block Stair")
|
|
|
|
S("Outer Gold Block Stair")
|
|
|
|
S("Gold Block Slab")
|
|
|
|
S("Ice Stair")
|
|
|
|
S("Inner Ice Stair")
|
|
|
|
S("Outer Ice Stair")
|
|
|
|
S("Ice Slab")
|
|
|
|
S("Snow Block Stair")
|
|
|
|
S("Inner Snow Block Stair")
|
|
|
|
S("Outer Snow Block Stair")
|
|
|
|
S("Snow Block Slab")
|
|
|
|
--]]
|