mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 12:31:41 +09:00
Update all code styles
This commit is contained in:
@@ -7,27 +7,27 @@ local copy_items_stack = _C.copy_items_stack --- @dep expcore.common
|
||||
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||
|
||||
Commands.new_command('clear-item-on-ground', {'expcom-surface-clearing.description-ci'}, 'Clear Item On Ground')
|
||||
:add_param('range', false, 'integer-range', 1, 1000)
|
||||
:register(function(player, range)
|
||||
for _, e in pairs(player.surface.find_entities_filtered{position=player.position, radius=range, name='item-on-ground'}) do
|
||||
if e.stack then
|
||||
-- calling move_items_stack(e.stack) will crash to desktop
|
||||
-- https://forums.factorio.com/viewtopic.php?f=7&t=110322
|
||||
copy_items_stack{e.stack}
|
||||
e.stack.clear()
|
||||
Commands.new_command("clear-item-on-ground", { "expcom-surface-clearing.description-ci" }, "Clear Item On Ground")
|
||||
:add_param("range", false, "integer-range", 1, 1000)
|
||||
:register(function(player, range)
|
||||
for _, e in pairs(player.surface.find_entities_filtered{ position = player.position, radius = range, name = "item-on-ground" }) do
|
||||
if e.stack then
|
||||
-- calling move_items_stack(e.stack) will crash to desktop
|
||||
-- https://forums.factorio.com/viewtopic.php?f=7&t=110322
|
||||
copy_items_stack{ e.stack }
|
||||
e.stack.clear()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return Commands.success
|
||||
end)
|
||||
return Commands.success
|
||||
end)
|
||||
|
||||
Commands.new_command('clear-blueprint', {'expcom-surface-clearing.description-cb'}, 'Clear Blueprint')
|
||||
:add_param('range', false, 'integer-range', 1, 1000)
|
||||
:register(function(player, range)
|
||||
for _, e in pairs(player.surface.find_entities_filtered{position=player.position, radius=range, type='entity-ghost'}) do
|
||||
e.destroy()
|
||||
end
|
||||
Commands.new_command("clear-blueprint", { "expcom-surface-clearing.description-cb" }, "Clear Blueprint")
|
||||
:add_param("range", false, "integer-range", 1, 1000)
|
||||
:register(function(player, range)
|
||||
for _, e in pairs(player.surface.find_entities_filtered{ position = player.position, radius = range, type = "entity-ghost" }) do
|
||||
e.destroy()
|
||||
end
|
||||
|
||||
return Commands.success
|
||||
end)
|
||||
return Commands.success
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user