From 2a46c530e9ff6bf346cde0dfcc5de507675e5973 Mon Sep 17 00:00:00 2001
From: Someone <someone@somenet.org>
Date: Mon, 21 Oct 2024 15:52:16 +0200
Subject: [PATCH] RELEASE 2.0.0 - Initial compatibility with Factorio 2.0

---
 changelog.txt |  7 +++++
 data.lua      | 77 +++++++++++++++++++++++++++++++++++++--------------
 info.json     |  8 ++----
 3 files changed, 66 insertions(+), 26 deletions(-)

diff --git a/changelog.txt b/changelog.txt
index f07f9ee..b1b799b 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.0.0
 Date: 2024-01-06
diff --git a/data.lua b/data.lua
index 8e45bf9..4500e3a 100644
--- a/data.lua
+++ b/data.lua
@@ -6,25 +6,8 @@ data:extend(
   {
     type = "electric-energy-interface",
     name = "crash-site-spaceship",
-    icon = "__base__/graphics/icons/crash-site-spaceship.png",
-    icon_size = 64, icon_mipmaps = 4,
-    flags = {
-      "placeable-player",
-      "player-creation",
-      "hidden",
-      "not-rotatable",
-      "placeable-off-grid",
-      "not-blueprintable",
-      "not-deconstructable"
-    },
-    map_color = {r = 0, g = 0.365, b = 0.58, a = 1},
-    max_health = 600,
     alert_when_damaged = true,
-    allow_copy_paste = false,
-    resistances =
-    {
-      {type = "fire", percent = 100}
-    },
+    hidden = true,
     gui_mode = "none",
     energy_source =
     {
@@ -35,6 +18,22 @@ data:extend(
     energy_production = "150kW",
     energy_usage = "0kW",
     enable_inventory_bar = false,
+    -- /custom
+
+    icon = "__base__/graphics/icons/crash-site-spaceship.png",
+    flags = wreck_flags,
+    hidden = true,
+    map_color = {r = 0, g = 0.365, b = 0.58, a = 1},
+    max_health = 600,
+    -- alert_when_damaged = false,
+    allow_copy_paste = false,
+    default_status = "broken",
+    resistances =
+    {
+      {type = "fire", percent = 100}
+    },
+    inventory_size = 5,
+    inventory_type = "normal",
     minable =
     {
       mining_time = 2.3
@@ -43,8 +42,44 @@ data:extend(
     selection_box = {{-8.7, -3.3}, {6.9, 4.5}},
     dying_explosion = "nuke-explosion",
     integration_patch_render_layer = "decals",
-    integration_patch = oldship.integration_patch,
-    picture = oldship.picture,
-    vehicle_impact_sound = oldship.vehicle_impact_sound
+    integration_patch =
+    {
+      filename = "__base__/graphics/entity/crash-site-spaceship/spaceship-ground.png",
+      priority = "very-low",
+      width = 1330,
+      height = 786,
+      shift = util.by_pixel(-50, 61),
+      dice_x = 4,
+      dice_y = 3,
+      scale = 0.5
+    },
+
+    picture =
+    {
+      layers =
+      {
+        {
+          filename = "__base__/graphics/entity/crash-site-spaceship/spaceship.png",
+          priority = "very-low",
+          width = 1228,
+          height = 790,
+          shift = util.by_pixel(-13, 34),
+          dice_x = 4,
+          dice_y = 3,
+          scale = 0.5
+        },
+        {
+          filename = "__base__/graphics/entity/crash-site-spaceship/spaceship-shadow.png",
+          priority = "very-low",
+          width = 1340,
+          height = 842,
+          shift = util.by_pixel(-23, 50),
+          scale = 0.5,
+          dice_x = 5,
+          dice_y = 4,
+          draw_as_shadow = true
+        }
+      }
+    }
   }
 })
diff --git a/info.json b/info.json
index b853887..8a63f36 100644
--- a/info.json
+++ b/info.json
@@ -1,12 +1,10 @@
 {
     "name": "some-spaceship-wreck-generator",
-    "version": "1.1.0",
+    "version": "2.0.0",
     "title": "Spaceship APU survived the crash",
     "author": "someone1337",
     "homepage": "https://git.somenet.org/factorio/some-spaceship-wreck-generator.git",
     "description": "The spaceship is wrecked, but thankfully the Auxiliary Power Unit is still working and can be used as a tiny infinite power source generator.",
-    "factorio_version": "1.1",
-    "dependencies": [
-        "base>=1.1.0"
-    ]
+    "factorio_version": "2.0",
+    "dependencies": ["base>=2.0.0"]
 }
-- 
2.43.0