From a7824da9465c60da0c720fd30cdc027550002204 Mon Sep 17 00:00:00 2001
From: Someone <someone@somenet.org>
Date: Tue, 22 Oct 2024 10:29:50 +0200
Subject: [PATCH] RELEASE 2.0.0 - Initial compatibility with Factorio 2.0

---
 changelog.txt |  7 +++++++
 control.lua   | 26 +++++++++++++-------------
 info.json     |  6 +++---
 3 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/changelog.txt b/changelog.txt
index df5e3b3..015e3cc 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.3
 Date: 2024-01-02
diff --git a/control.lua b/control.lua
index 091fb88..2c2c992 100644
--- a/control.lua
+++ b/control.lua
@@ -1,24 +1,24 @@
---[[get dir of decorations under entities]]
+--[[get rid of decorations under entities]]
 script.on_event(defines.events.on_built_entity, function(event)
-	if event.created_entity.type ~= "entity-ghost" and event.created_entity.type ~= "tile-ghost" and event.created_entity.prototype.selectable_in_game then
-		game.surfaces[event.created_entity.surface_index].destroy_decoratives{area=event.created_entity.selection_box}
-	end
+    if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" and event.entity.prototype.selectable_in_game then
+        game.surfaces[event.entity.surface_index].destroy_decoratives{area=event.entity.selection_box}
+    end
 end)
 
 script.on_event(defines.events.on_robot_built_entity, function(event)
-	if event.created_entity.type ~= "entity-ghost" and event.created_entity.type ~= "tile-ghost" and event.created_entity.prototype.selectable_in_game then
-		game.surfaces[event.created_entity.surface_index].destroy_decoratives{area=event.created_entity.selection_box}
-	end
+    if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" and event.entity.prototype.selectable_in_game then
+        game.surfaces[event.entity.surface_index].destroy_decoratives{area=event.entity.selection_box}
+    end
 end)
 
 script.on_event(defines.events.script_raised_built, function(event)
-	if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" and event.entity.prototype.selectable_in_game then
-		game.surfaces[event.entity.surface_index].destroy_decoratives{area=event.entity.selection_box}
-	end
+    if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" and event.entity.prototype.selectable_in_game then
+        game.surfaces[event.entity.surface_index].destroy_decoratives{area=event.entity.selection_box}
+    end
 end)
 
 script.on_event(defines.events.script_raised_revive, function(event)
-	if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" and event.entity.prototype.selectable_in_game then
-		game.surfaces[event.entity.surface_index].destroy_decoratives{area=event.entity.selection_box}
-	end
+    if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" and event.entity.prototype.selectable_in_game then
+        game.surfaces[event.entity.surface_index].destroy_decoratives{area=event.entity.selection_box}
+    end
 end)
diff --git a/info.json b/info.json
index 5dfa89d..d6ac9c7 100644
--- a/info.json
+++ b/info.json
@@ -1,10 +1,10 @@
 {
     "name": "RealisticDecorationCleanup",
-    "version": "1.1.3",
+    "version": "2.0.0",
     "title": "Realistic Decoration Cleanup",
     "author": "someone1337",
     "homepage": "https://git.somenet.org/factorio/RealisticDecorationCleanup.git",
     "description": "Remove decorations prior to placing entities or tiles. Normally you would not build a house/road and leave the bushes below it.",
-    "dependencies": ["base>=1.1.0"],
-    "factorio_version": "1.1"
+    "factorio_version": "2.0",
+    "dependencies": ["base>=2.0.0"]
 }
-- 
2.43.0