diff --git a/LandfillPainting/data.lua b/LandfillPainting/data.lua index ae47002..a34fc9e 100644 --- a/LandfillPainting/data.lua +++ b/LandfillPainting/data.lua @@ -1,4 +1,5 @@ require "util" +local tile_collision_masks = require("__base__/prototypes/tile/tile-collision-masks") -- Collision masks have been replaced with CollisionMaskConnector prototypes in 2.0, which contains a property "layers" -- Settings layers to empty means that the tile can be placed on top of anything @@ -6,6 +7,8 @@ LANDFILL_COLLISION_MASK_CONNECTOR = { layers = {} } +LANDFILL_TILE_CONDITION = data.raw.item["landfill"].place_as_tile.tile_condition + -- Define the names of each terrain type we're adding local terrains = { "dry-dirt", @@ -28,15 +31,15 @@ local names = { local baserecipe = data.raw.recipe['landfill'] local technology = data.raw.technology['landfill'] -if mods['angelssmelting'] and data.raw.technology['water-washing-1'] and - (data.raw.technology['water-washing-1'].enabled == nil or data.raw.technology['water-washing-1'].enabled) and - data.raw.recipe['solid-mud-landfill'] then - baserecipe = data.raw.recipe['solid-mud-landfill'] - technology = data.raw.technology['water-washing-1'] +if mods['angelssmelting'] and data.raw.technology['angels-water-washing-1'] and + (data.raw.technology['angels-water-washing-1'].enabled == nil or data.raw.technology['angels-water-washing-1'].enabled) and + data.raw.recipe['angels-solid-mud-landfill'] then + baserecipe = data.raw.recipe['angels-solid-mud-landfill'] + technology = data.raw.technology['angels-water-washing-1'] data:extend({{ type = "item-subgroup", name = "water-landfill", - group = "water-treatment", + group = "angels-water-treatment", order = "eb" }}) baserecipe.subgroup = "water-landfill" @@ -67,24 +70,30 @@ for i,v in ipairs(terrains) do { result = v, condition_size = 1, - condition = LANDFILL_COLLISION_MASK_CONNECTOR + condition = LANDFILL_COLLISION_MASK_CONNECTOR, + tile_condition = LANDFILL_TILE_CONDITION }, } local recipe = util.table.deepcopy(baserecipe) + recipe.name = "landfill-" .. v + recipe.localised_name = {v .. '-name.name'} + if recipe.results then recipe.results[1].name = "landfill-" .. v else recipe.result = "landfill-" .. v end + data.raw.tile[v].minable = {mining_time = 0.5, result = "landfill-"..v} + data.raw.tile[v].collision_mask = tile_collision_masks.ground() + data.raw.tile[v].is_foundation = true + data:extend({item}) data:extend({recipe}) table.insert(technology.effects, { type = "unlock-recipe", recipe = "landfill-" .. v }) end - - data.raw.item['landfill'].icon = "__LandfillPainting__/graphics/icons/landfill-landfill.png" data.raw.item['landfill'].place_as_tile.condition = LANDFILL_COLLISION_MASK_CONNECTOR