CraftSystem: TappingNode: add get_staticdata method, enable static_save`

This commit is contained in:
Van
2026-02-17 21:40:42 +03:00
parent 6156a4bb6f
commit 00633226cf

View File

@@ -25,7 +25,7 @@ local tappingNode = ImmersiveCraftNode:new({
initial_properties = {
visual = 'wielditem',
visual_size = {x=0.4, y=0.4, z=0.4},
static_save = false,
--static_save = false,
},
_item_name = '',
@@ -58,11 +58,24 @@ local tappingNode = ImmersiveCraftNode:new({
on_punch = function(luaEntity, puncher, time_from_last_punch, tool_capabilities, dir, damage)
-- We simply trigger the event that the player hits the crafting node, bound to the work station with coordinates.
Events.call(('craft_system:punch_tapping_node:%s:%s'):format(
luaEntity._craft_name, luaEntity._stage_name), luaEntity._work_station_pos, puncher)
luaEntity._craft_name, luaEntity._stage_name), luaEntity._work_station_pos, puncher, luaEntity)
return false
end,
---@param luaEntity CraftSystem.ImmersiveCraftNode.LuaTappingNode
get_staticdata = function(luaEntity)
---@type CraftSystem.ImmersiveCraftStage.TappingNode.InitParams?
local params = {
targetItem = luaEntity._item_name,
craftName = luaEntity._craft_name,
stageName = luaEntity._stage_name,
WorkStationPos = luaEntity._work_station_pos
}
return core.serialize(params)
end,
---Sets the entity display of the item. If the item stack was not transferred, `self._item_name` is used.
---@param luaEntity CraftSystem.ImmersiveCraftNode.LuaTappingNode
---@param itemName ItemStackString?