77de117ea1
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.
34 lines
890 B
Lua
34 lines
890 B
Lua
-- LUALOCALS < ---------------------------------------------------------
|
|
local minetest, nodecore
|
|
= minetest, nodecore
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
minetest.register_node(modname .. ":stick", {
|
|
description = "Stick",
|
|
drawtype = "nodebox",
|
|
node_box = nodecore.fixedbox(-1/16, -0.5, -1/16, 1/16, 0, 1/16),
|
|
tiles = {
|
|
modname .. "_tree_top.png",
|
|
modname .. "_tree_top.png",
|
|
modname .. "_tree_side.png"
|
|
},
|
|
paramtype = "light",
|
|
sunlight_propagates = true,
|
|
groups = {
|
|
firestick = 1,
|
|
snappy = 1,
|
|
flammable = 2,
|
|
falling_repose = 1,
|
|
stack_as_node = 1
|
|
},
|
|
sounds = nodecore.sounds("nc_tree_sticky")
|
|
})
|
|
|
|
nodecore.register_leaf_drops(function(_, node, list)
|
|
list[#list + 1] = {
|
|
name = modname .. ":stick",
|
|
prob = 0.2 * (node.param2 * node.param2)}
|
|
end)
|