Provide a way to cancel a build action in on_put_item
Posted: Tue Mar 05, 2019 9:32 pm
It would be nice to have a way to cancel the player's build action in the on_put_item handler. This is useful if the mod wants to intercept or modify the build request (e.g. https://mods.factorio.com/mod/BlueprintAlignment modifies the position of a blueprint to align it to a grid).
Currently one way to do this is to take the item out of the player's cursor stack and move it back afterwards (e.g. in the on_player_cursor_stack_changed handler), but this is a rather ugly hack (and causes problems in 0.17 for toolbelt slots which are linked to the blueprint library).
Currently one way to do this is to take the item out of the player's cursor stack and move it back afterwards (e.g. in the on_player_cursor_stack_changed handler), but this is a rather ugly hack (and causes problems in 0.17 for toolbelt slots which are linked to the blueprint library).