From 38d66e07698c25d0aaa3413066840954787298be Mon Sep 17 00:00:00 2001 From: Someone Date: Wed, 23 Oct 2024 16:12:44 +0200 Subject: [PATCH] RELEASE 2.0.0 - Initial compatibility with Factorio 2.0 --- changelog.txt | 7 +++++++ control.lua | 7 ++++++- info.json | 10 ++++++---- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/changelog.txt b/changelog.txt index 4e5be26..9cc6f8d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +--------------------------------------------------------------------------------------------------- +Version: 2.0.0 +Date: 2024-10-21 + + Changed: + - Initial compatibility with Factorio 2.0 + --------------------------------------------------------------------------------------------------- Version: 1.1.2 Date: 2024-01-02 diff --git a/control.lua b/control.lua index 2335b75..f23d52f 100644 --- a/control.lua +++ b/control.lua @@ -1,5 +1,10 @@ -- Iterate over every tile in the new chunk and spam with random resources, if empty and possible. script.on_event(defines.events.on_chunk_generated, function (event) + -- this mod is intended as an early game challenge. Therefore do nothing on non-nauvis. + if not event.surface.planet.name == "nauvis" then + return + end + -- prevent one big continuous patch if (event.area.left_top.x/32)%10 == 5 or (event.area.left_top.y/32)%10 == 5 then return @@ -9,7 +14,7 @@ script.on_event(defines.events.on_chunk_generated, function (event) ores = {"stone", "iron-ore", "copper-ore", "coal"} for x=event.area.left_top.x+0, event.area.right_bottom.x-1 do for y=event.area.left_top.y+0, event.area.right_bottom.y-1 do - if event.surface.get_tile(x, y).collides_with("ground-tile") + if event.surface.get_tile(x, y).collides_with("ground_tile") and #event.surface.find_entities_filtered{area={{x,y}, {x+1, y+1}}, type="resource"} == 0 and #event.surface.find_entities_filtered{area={{x-1, y-1}, {x+1, y+1}}, name="cliff"} == 0 then diff --git a/info.json b/info.json index 99f8808..deabd8e 100644 --- a/info.json +++ b/info.json @@ -1,10 +1,12 @@ { "name": "some-resourcespam", - "version": "1.1.2", + "version": "2.0.0", "title": "Some resource spam", "author": "someone1337", "homepage": "https://git.somenet.org/factorio/some-resourcespam.git", - "description": "Spam resources everywhere. But as is with spam: it adds little of real value and you get the joy of having to split ores.", - "dependencies": ["base>=1.1.0"], - "factorio_version": "1.1" + "description": "Spam resources everywhere on nauvis-planet-type surfaces. But as is with spam: it adds little of real value and you get the joy of having to split ores.", + "factorio_version": "2.0", + "dependencies": [ + "base>=2.0.0" + ] } -- 2.43.0