Non-deterministic facedir for craft output
Craft output nodes are rotate in a random (but still upright) direction if they're facedir, and the param2 is not specified by the recipe. Currenly only affects optic prisms.
This commit is contained in:
parent
952c1bc63e
commit
4ea48c025c
@ -17,9 +17,6 @@ ISSUES-GAME: Gameplay-affecting issues
|
||||
rather than pre-material?
|
||||
- https://discord.com/channels/507234450615042048/507234451085066248/963498043708178522
|
||||
|
||||
- Facedir nodes should get a random facedir (top-up, random cardinal
|
||||
orientation) after crafting.
|
||||
|
||||
- /snuff should probably snuff torches too
|
||||
- General snuffable/on_snuff API?
|
||||
- Merge with growtrees for a general on_cheat API?
|
||||
|
@ -144,8 +144,15 @@ local function craftcheck(recipe, pos, node, data, xx, xz, zx, zz)
|
||||
nodecore.stack_set(p, ItemStack(""))
|
||||
end
|
||||
if r then
|
||||
local n = minetest.get_node(p)
|
||||
r.param2 = n.param2
|
||||
if not r.param2 then
|
||||
local rd = minetest.registered_nodes[r.name]
|
||||
if rd and rd.paramtype2 == "facedir" then
|
||||
r.param2 = math_random(0, 3)
|
||||
else
|
||||
local n = minetest.get_node(p)
|
||||
r.param2 = n.param2
|
||||
end
|
||||
end
|
||||
nodecore.set_loud(p, r)
|
||||
nodecore.fallcheck(p)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user