Fix mattock crafting issue.
This commit is contained in:
parent
58b4e09bab
commit
3b16be70d4
@ -9,11 +9,6 @@ ISSUES: Bugs, Cleanup and Refinements
|
||||
# # # # # # # # # # # #
|
||||
#### # #### # ###### ###### # # ####
|
||||
|
||||
- Mattock recipes broken by pez logic. after_destruct is shifting stacks
|
||||
downwards during node replacement in crafting recipes. Need to look
|
||||
for an after_dig hook or something instead, or suspend the logic while
|
||||
recipes are operating.
|
||||
|
||||
- Design principles doc is badly out of date, needs to reflect lessons
|
||||
learned and things observed about where the game is headed.
|
||||
|
||||
|
@ -5,6 +5,18 @@ local ItemStack, minetest, nodecore
|
||||
|
||||
local modname = minetest.get_current_modname()
|
||||
|
||||
local function pezdispense(pos)
|
||||
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local node = minetest.get_node(above)
|
||||
if node.name ~= modname .. ":stack" then
|
||||
return nodecore.visinv_update_ents(pos)
|
||||
end
|
||||
nodecore.place_stack(pos, nodecore.stack_get(above))
|
||||
minetest.remove_node(above)
|
||||
nodecore.visinv_update_ents(pos)
|
||||
return pezdispense(above)
|
||||
end
|
||||
|
||||
minetest.register_node(modname .. ":stack", {
|
||||
drawtype = "nodebox",
|
||||
node_box = nodecore.fixedbox(
|
||||
@ -51,16 +63,7 @@ minetest.register_node(modname .. ":stack", {
|
||||
end)
|
||||
return nodecore.visinv_on_construct(pos, ...)
|
||||
end,
|
||||
after_destruct = function(pos)
|
||||
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local node = minetest.get_node(above)
|
||||
if node.name ~= modname .. ":stack" then
|
||||
return nodecore.visinv_update_ents(pos)
|
||||
end
|
||||
nodecore.place_stack(pos, nodecore.stack_get(above))
|
||||
minetest.remove_node(above)
|
||||
return nodecore.visinv_update_ents(pos)
|
||||
end
|
||||
after_dig_node = pezdispense
|
||||
})
|
||||
|
||||
function nodecore.place_stack(pos, stack, placer, pointed_thing)
|
||||
|
Loading…
x
Reference in New Issue
Block a user