Add craft abort support & fixes visual tappingCraftNode

This commit is contained in:
Van
2026-02-20 21:46:45 +03:00
parent 5be847bf58
commit 5c936025f1
7 changed files with 73 additions and 41 deletions

View File

@@ -79,6 +79,18 @@ function WorkStation:new(name, def)
end
end
callbacks.on_punch = function(pos, node, puncher, pointed_thing)
if Smc.workStationIsFree(pos) then
return
end
local craftData = Smc.getCraftDataByPos(pos)
assert(craftData ~= nil, 'Immersive crafting data is empty.')
local craft = ImmersiveCraftHandler:getCraftByName(craftData.craftName)
craft:abortCraft(pos)
end
callbacks.on_dig = function(pos, node, digger)
if Smc.workStationIsFree(pos) then
return core.node_dig(pos, node, digger)
@@ -190,6 +202,22 @@ ImmersiveCraftHandler:registerCraft('bricks', {
targetItem = 'rocks:sylite',
type = 'tapping',
clicksNeed = 3,
nextStage = 'tapping_2',
},
---@type CraftSystem.ImmersiveCraftStage.TappingStageDef
{
name = 'tapping_2',
targetItem = 'rocks:sylite_block',
type = 'tapping',
clicksNeed = 5,
nextStage = 'tapping_3',
},
---@type CraftSystem.ImmersiveCraftStage.TappingStageDef
{
name = 'tapping_3',
targetItem = 'rocks:sylite_bricks',
type = 'tapping',
clicksNeed = 1,
}
},
})