diff --git a/mods_2.0/010_upcycler/changelog.txt b/mods_2.0/010_upcycler/changelog.txt index c8bf1169..c39a23c1 100644 --- a/mods_2.0/010_upcycler/changelog.txt +++ b/mods_2.0/010_upcycler/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 1.1.3 +Date: 2024. 12. 30 + Info: + - Support even pickier dollies (#25) +--------------------------------------------------------------------------------------------------- Version: 1.1.2 Date: 2024. 12. 09 Info: diff --git a/mods_2.0/010_upcycler/control.lua b/mods_2.0/010_upcycler/control.lua index 7fa980ad..1710eb25 100644 --- a/mods_2.0/010_upcycler/control.lua +++ b/mods_2.0/010_upcycler/control.lua @@ -5,6 +5,26 @@ local mod_surface_name = "upcycler" local Handler = {} +local function on_epd_event(event) + local entity = event.moved_entity + if entity.name == "upcycler" then + local struct = storage.structs[entity.unit_number] + + -- move the chest within bounds, then reposition it normally + struct.entities.upcycler_input.teleport(entity.position) + Handler.get_or_create_linkedchest_then_move(entity) + end +end + +local function init_epd_event() + local epd_api = remote.interfaces['PickerDollies'] + if epd_api == nil then return end + + local epd_event_id = remote.call("PickerDollies", "dolly_moved_entity_id") + + script.on_event(epd_event_id, on_epd_event) +end + local function reset_items_per_next_quality() storage.items_per_next_quality = { upcycler = settings.global["upcycling-items-per-next-quality"].value, @@ -30,6 +50,7 @@ function Handler.init() } Handler.reset_on_created_entity_listeners() + init_epd_event() end function Handler.on_configuration_changed() @@ -152,6 +173,7 @@ end script.on_load(function() Handler.reset_on_created_entity_listeners() + init_epd_event() end) function Handler.get_or_create_linkedchest_then_move(entity) diff --git a/mods_2.0/010_upcycler/info.json b/mods_2.0/010_upcycler/info.json index d3f45826..4b4ab610 100644 --- a/mods_2.0/010_upcycler/info.json +++ b/mods_2.0/010_upcycler/info.json @@ -3,7 +3,7 @@ "title": "Upcycler", "description": "No quality modules, sacrifice x (configurable) items to get the next tier.", - "version": "1.1.2", + "version": "1.1.3", "author": "Quezler", "factorio_version": "2.0", @@ -22,6 +22,8 @@ "quality", "? space-age", + "? even-pickier-dollies", + "! awesome-sink" ] }