Add craft abort support & fixes visual tappingCraftNode
This commit is contained in:
@@ -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,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user