You've already forked ComfyFactorio
mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2026-06-20 16:32:28 +02:00
new module inserter_drops_pickup
Small QoL addition to pick up an item an inserter put down on the ground. If the inventory is full after mining the item, the inserter is left behind as an item-on-ground (versus not mined at all when the inventory is full)
This commit is contained in:
@@ -24,6 +24,7 @@ require 'antigrief'
|
||||
require 'modules.corpse_markers'
|
||||
require 'modules.floaty_chat'
|
||||
require 'modules.show_inventory'
|
||||
require 'modules.inserter_drops_pickup'
|
||||
require 'utils.debug.command'
|
||||
|
||||
require 'comfy_panel.main'
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
local Event = require 'utils.event'
|
||||
|
||||
Event.add(defines.events.on_player_mined_entity, function(event)
|
||||
local inserter = event.entity
|
||||
if (not inserter.valid) or (inserter.type ~= "inserter") or inserter.drop_target then return end
|
||||
|
||||
local item_entity = inserter.surface.find_entity("item-on-ground", inserter.drop_position)
|
||||
if item_entity then
|
||||
game.get_player(event.player_index).mine_entity(item_entity)
|
||||
end
|
||||
end)
|
||||
Reference in New Issue
Block a user