local function createPipe( newName, distance ,gen) local pipeCopy = table.deepcopy(data.raw["pipe-to-ground"]["pipe-to-ground"]) pipeCopy.name = newName pipeCopy.minable.result = newName pipeCopy.fluid_box.pipe_connections[2].max_underground_distance = distance pipeCopy.pictures = { up = { filename = "__DistancePlus__/graphics/entity/"..gen.."/hr-pipe-to-ground-up.png", priority = "extra-high", width = 128, height = 128, scale = 0.5 }, down = { filename = "__DistancePlus__/graphics/entity/"..gen.."/hr-pipe-to-ground-down.png", priority = "extra-high", width = 128, height = 128, scale = 0.5 }, left = { filename = "__DistancePlus__/graphics/entity/"..gen.."/hr-pipe-to-ground-left.png", priority = "extra-high", width = 128, height = 128, scale = 0.5 }, right = { filename = "__DistancePlus__/graphics/entity/"..gen.."/hr-pipe-to-ground-right.png", priority = "extra-high", width = 128, height = 128, scale = 0.5 }, } return pipeCopy end data:extend ({ createPipe("medium-pipe-to-ground", 30,1), createPipe("long-pipe-to-ground", 50,2), createPipe("ultra-pipe-to-ground", 120,3), createPipe("continental-pipe-to-ground", 255,4), } )