mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2026-05-12 21:08:43 +09:00
.
This commit is contained in:
+2
-4
@@ -1,5 +1,4 @@
|
||||
local cargo_landing_pad = require('control/cargo-landing-pad')
|
||||
local cargo_landing_chest = require('control/cargo-landing-chest')
|
||||
local cargo_landing = require('control/cargo-landing')
|
||||
local lab = require('control/lab')
|
||||
local rail_support = require('control/rail-support')
|
||||
local trash = require('control/trash')
|
||||
@@ -53,8 +52,7 @@ local function gui_update(player, entity)
|
||||
end
|
||||
|
||||
local function entity_build(event)
|
||||
cargo_landing_pad.build(event)
|
||||
cargo_landing_chest.build(event)
|
||||
cargo_landing.build(event)
|
||||
lab.build(event)
|
||||
rail_support.build(event)
|
||||
trash.build(event)
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
local main = {}
|
||||
|
||||
function main.build(event)
|
||||
if event.entity.type ~= 'cargo-landing-pad' then
|
||||
return
|
||||
end
|
||||
|
||||
if event.entity.name ~= 'cargo-landing-pad' then
|
||||
return
|
||||
end
|
||||
if not prototypes.entity['proxy-cargo-landing-chest'] then
|
||||
return
|
||||
end
|
||||
|
||||
local ec = game.surfaces[event.entity.surface].find_entities_filtered{type='cargo-landing-pad'}
|
||||
|
||||
if #ec > 1 then
|
||||
return
|
||||
end
|
||||
|
||||
local ep = game.surfaces[event.entity.surface].find_entities_filtered{type='proxy-container', name='proxy-cargo-landing-chest'}
|
||||
|
||||
for _, v in pairs(ep) do
|
||||
v.proxy_target_entity = ec[1]
|
||||
v.proxy_target_inventory = defines.inventory.cargo_landing_pad_main
|
||||
end
|
||||
end
|
||||
|
||||
return main
|
||||
@@ -1,26 +0,0 @@
|
||||
local main = {}
|
||||
|
||||
function main.build(event)
|
||||
if event.entity.type ~= 'proxy-container' then
|
||||
return
|
||||
end
|
||||
|
||||
if event.entity.name ~= 'proxy-cargo-landing-chest' then
|
||||
return
|
||||
end
|
||||
|
||||
if not prototypes.entity['cargo-landing-pad'] then
|
||||
return
|
||||
end
|
||||
|
||||
local ec = game.surfaces[event.entity.surface].find_entities_filtered{type='cargo-landing-pad'}
|
||||
|
||||
if not ec then
|
||||
return
|
||||
end
|
||||
|
||||
event.entity.proxy_target_entity = ec[1]
|
||||
event.entity.proxy_target_inventory = defines.inventory.cargo_landing_pad_main
|
||||
end
|
||||
|
||||
return main
|
||||
@@ -0,0 +1,45 @@
|
||||
local main = {}
|
||||
|
||||
function main.build(event)
|
||||
if event.entity.type == 'proxy-container' then
|
||||
if event.entity.name ~= 'proxy-cargo-landing-chest' then
|
||||
return
|
||||
end
|
||||
|
||||
if not prototypes.entity['cargo-landing-pad'] then
|
||||
return
|
||||
end
|
||||
|
||||
local ec = game.surfaces[event.entity.surface].find_entities_filtered{type='cargo-landing-pad'}
|
||||
|
||||
if not ec then
|
||||
return
|
||||
end
|
||||
|
||||
event.entity.proxy_target_entity = ec[1]
|
||||
event.entity.proxy_target_inventory = defines.inventory.cargo_landing_pad_main
|
||||
|
||||
elseif event.entity.type == 'cargo-landing-pad' then
|
||||
if event.entity.name ~= 'cargo-landing-pad' then
|
||||
return
|
||||
end
|
||||
if not prototypes.entity['proxy-cargo-landing-chest'] then
|
||||
return
|
||||
end
|
||||
|
||||
local ec = game.surfaces[event.entity.surface].find_entities_filtered{type='cargo-landing-pad'}
|
||||
|
||||
if #ec > 1 then
|
||||
return
|
||||
end
|
||||
|
||||
local ep = game.surfaces[event.entity.surface].find_entities_filtered{type='proxy-container', name='proxy-cargo-landing-chest'}
|
||||
|
||||
for _, v in pairs(ep) do
|
||||
v.proxy_target_entity = ec[1]
|
||||
v.proxy_target_inventory = defines.inventory.cargo_landing_pad_main
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return main
|
||||
@@ -208,7 +208,7 @@ end
|
||||
for _, v in pairs(data.raw['inserter']) do
|
||||
if v.energy_source and v.energy_source.type and (v.energy_source.type == 'electric' or v.energy_source.type == 'void' or v.energy_source.type == 'burner') then
|
||||
v.allow_custom_vectors = true
|
||||
v.flags = {'placeable-neutral', 'placeable-player', 'player-creation', ((v.hand_size and v.hand_size < 1) and 'building-direction-8-way') or 'building-direction-16-way'}
|
||||
v.flags = {'placeable-neutral', 'placeable-player', 'player-creation', ((v.hand_size and v.hand_size > 0.8) and 'building-direction-16-way') or 'building-direction-8-way'}
|
||||
|
||||
if v.energy_source.type == 'burner' then
|
||||
v.allow_burner_leech = true
|
||||
|
||||
Reference in New Issue
Block a user