Aaron Suen 77de117ea1 Place certain stacks as nodes.
If a node is specially tagges with the stack_as_node group, and
the stack size is exactly 1, place as a real node instead of a
stack node.

This reinstates logic from WAY back in the super-early pre-alpha
days, except only for nodes explicitly tagged this way.

This should be applied only to nodes that aren't transformed in
any non-desirable way when placed as nodes instead of stacks, and
can be dug the same ways as stacks (i.e. snappy = 1 or
crumbly = 1).

Currently applied to sticks, staves, leaves, ladders/frames,
and torches.  Ladder/frame placement offers some interesting
possibilities in terms of throwing ladders to rappel down holes.
2019-10-01 18:59:53 -04:00

76 lines
1.8 KiB
Lua

-- LUALOCALS < ---------------------------------------------------------
local minetest, nodecore
= minetest, nodecore
-- LUALOCALS > ---------------------------------------------------------
local modname = minetest.get_current_modname()
local lt = 1/16
local lw = 3/16
local ll = 1/2
local tt = "nc_tree_tree_side.png^(nc_tree_tree_top.png^[mask:nc_woodwork_ladder_mask.png)"
minetest.register_node(modname .. ":ladder", {
description = "Wooden Ladder",
drawtype = "nodebox",
node_box = nodecore.fixedbox(
{-lt, -ll, -lt, lt, ll, lt},
{-lw, -lt, -lt, lw, lt, lt},
{-lt, -lt, -lw, lt, lt, lw}
),
tiles = {tt},
groups = {
snappy = 1,
flammable = 2,
fire_fuel = 1,
falling_node = 1,
stack_as_node = 1
},
crush_damage = 0.25,
paramtype = "light",
sunlight_propagates = true,
climbable = true,
sounds = nodecore.sounds("nc_tree_sticky")
})
nodecore.register_craft({
label = "assemble wood ladder",
normal = {x = 1},
nodes = {
{match = "nc_tree:stick", replace = "air"},
{x = -1, match = modname .. ":staff", replace = modname .. ":ladder"},
}
})
minetest.register_node(modname .. ":frame", {
description = "Wooden Frame",
drawtype = "nodebox",
node_box = nodecore.fixedbox(
{-lt, -ll, -lt, lt, ll, lt},
{-ll, -lt, -lt, ll, lt, lt},
{-lt, -lt, -ll, lt, lt, ll}
),
tiles = {tt},
groups = {
snappy = 1,
flammable = 2,
fire_fuel = 1,
stack_as_node = 1
},
paramtype = "light",
climbable = true,
sunlight_propagates = true,
sounds = nodecore.sounds("nc_tree_sticky")
})
nodecore.register_craft({
label = "assemble wood frame",
normal = {x = 1},
nodes = {
{match = modname .. ":staff", replace = "air"},
{x = -1, match = modname .. ":staff", replace = modname .. ":frame"},
}
})