2018-11-02 21:20:51 -04:00
|
|
|
-- LUALOCALS < ---------------------------------------------------------
|
2019-02-24 10:19:22 -05:00
|
|
|
local ipairs, minetest, nodecore, pairs
|
|
|
|
= ipairs, minetest, nodecore, pairs
|
2018-11-02 21:20:51 -04:00
|
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
|
2018-10-29 22:37:57 -04:00
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
|
2018-11-01 19:56:38 -04:00
|
|
|
local function regterrain(def)
|
2018-11-01 19:36:08 -04:00
|
|
|
def.name = def.name or def.description:gsub("%W", "_"):lower()
|
|
|
|
def.fullname = modname .. ":" .. def.name
|
2018-10-29 22:37:57 -04:00
|
|
|
|
2018-11-01 19:36:08 -04:00
|
|
|
def.tiles = def.tiles or { def.fullname:gsub("%W", "_") .. ".png" }
|
2018-10-29 22:37:57 -04:00
|
|
|
def.is_ground_content = true
|
|
|
|
|
2018-11-01 19:56:38 -04:00
|
|
|
if def.liquidtype then
|
|
|
|
def.liquid_alternative_flowing = def.fullname .. "_flowing"
|
|
|
|
def.liquid_alternative_source = def.fullname .. "_source"
|
|
|
|
def.fullname = def.fullname .. "_" .. def.liquidtype
|
|
|
|
def.special_tiles = def.special_tiles or { def.tiles[1], def.tiles[1] }
|
|
|
|
end
|
2018-10-29 22:37:57 -04:00
|
|
|
|
2018-11-01 21:53:55 -04:00
|
|
|
def.mapgen = def.mapgen or { def.name }
|
|
|
|
|
2018-11-01 19:36:08 -04:00
|
|
|
minetest.register_node(def.fullname, def)
|
2018-10-29 22:37:57 -04:00
|
|
|
|
|
|
|
for k, v in pairs(def.mapgen) do
|
2018-11-01 19:36:08 -04:00
|
|
|
minetest.register_alias("mapgen_" .. v, def.fullname)
|
2018-10-29 22:37:57 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-11-01 19:36:08 -04:00
|
|
|
local function clone(t) return minetest.deserialize(minetest.serialize(t)) end
|
|
|
|
|
|
|
|
local function regliquid(def)
|
|
|
|
local t = clone(def)
|
2018-11-01 19:56:38 -04:00
|
|
|
t.drawtype = "liquid"
|
|
|
|
t.liquidtype = "source"
|
2018-11-01 19:36:08 -04:00
|
|
|
regterrain(t)
|
|
|
|
|
|
|
|
t = clone(def)
|
2018-11-01 21:53:55 -04:00
|
|
|
t.mapgen = { }
|
2018-11-01 19:56:38 -04:00
|
|
|
t.drawtype = "flowingliquid"
|
|
|
|
t.liquidtype = "flowing"
|
|
|
|
t.paramtype2 = "flowingliquid"
|
2018-11-01 19:36:08 -04:00
|
|
|
regterrain(t)
|
|
|
|
end
|
|
|
|
|
2019-02-24 10:19:22 -05:00
|
|
|
local strata = {}
|
2018-10-29 22:37:57 -04:00
|
|
|
regterrain({
|
2018-10-30 10:18:38 -04:00
|
|
|
description = "Stone",
|
|
|
|
mapgen = {
|
|
|
|
"stone",
|
|
|
|
"stone_with_coal",
|
|
|
|
"stone_with_iron",
|
|
|
|
"desert_stone",
|
|
|
|
"sandstone",
|
2019-01-06 17:09:34 -05:00
|
|
|
"mese",
|
|
|
|
},
|
|
|
|
groups = {
|
2019-01-24 22:08:05 -05:00
|
|
|
cracky = 2
|
2019-01-06 17:09:34 -05:00
|
|
|
},
|
2019-02-24 10:19:22 -05:00
|
|
|
drop_in_place = modname .. ":cobble",
|
|
|
|
strata = strata
|
2019-01-06 17:09:34 -05:00
|
|
|
})
|
2019-02-24 10:19:22 -05:00
|
|
|
strata[1] = modname .. ":stone"
|
2019-02-23 22:48:39 -05:00
|
|
|
for i = 1, nodecore.hard_stone_strata do
|
|
|
|
regterrain({
|
2019-03-06 21:52:53 -05:00
|
|
|
name = "hard_stone_" .. i,
|
|
|
|
description = "Stone",
|
2019-02-24 10:19:22 -05:00
|
|
|
tiles = { nodecore.hard_stone_tile(i) },
|
2019-02-23 22:48:39 -05:00
|
|
|
groups = {
|
|
|
|
cracky = i + 2
|
|
|
|
},
|
|
|
|
drop_in_place = modname .. ":cobble"
|
|
|
|
})
|
2019-02-24 10:19:22 -05:00
|
|
|
strata[i + 1] = modname .. ":hard_stone_" .. i
|
2019-02-23 22:48:39 -05:00
|
|
|
end
|
|
|
|
|
2019-01-06 17:09:34 -05:00
|
|
|
regterrain({
|
|
|
|
description = "Cobble",
|
2019-01-23 21:29:44 -05:00
|
|
|
tiles = { modname .. "_gravel.png^" .. modname .. "_cobble.png" },
|
2019-01-06 17:09:34 -05:00
|
|
|
mapgen = {
|
2018-10-30 10:18:38 -04:00
|
|
|
"sandstonebrick",
|
|
|
|
"stair_sandstone_block",
|
|
|
|
"cobble",
|
|
|
|
"stair_cobble",
|
|
|
|
"stair_desert_stone",
|
|
|
|
"mossycobble"
|
|
|
|
},
|
2019-01-04 20:11:04 -05:00
|
|
|
groups = {
|
2019-01-24 22:08:05 -05:00
|
|
|
cracky = 1
|
2019-01-04 20:11:04 -05:00
|
|
|
},
|
2019-01-06 17:09:34 -05:00
|
|
|
alternate_loose = {
|
|
|
|
repack_level = 2,
|
|
|
|
groups = {
|
2019-01-08 02:03:18 -05:00
|
|
|
cracky = 0,
|
2019-01-06 17:09:34 -05:00
|
|
|
crumbly = 2,
|
|
|
|
falling_repose = 3
|
|
|
|
}
|
|
|
|
},
|
2019-01-29 20:41:29 -05:00
|
|
|
crush_damage = 2
|
2018-10-30 10:18:38 -04:00
|
|
|
})
|
|
|
|
|
2018-11-01 23:06:06 -04:00
|
|
|
for _, v in ipairs({
|
|
|
|
"snow",
|
|
|
|
"snowblock",
|
|
|
|
"junglegrass",
|
|
|
|
"tree",
|
|
|
|
"jungletree",
|
|
|
|
"pine_tree",
|
|
|
|
"leaves",
|
|
|
|
"apple",
|
|
|
|
"jungleleaves",
|
|
|
|
"pine_needles"
|
|
|
|
}) do
|
|
|
|
minetest.register_alias("mapgen_" .. v, "air")
|
|
|
|
end
|
2018-10-30 10:18:38 -04:00
|
|
|
|
|
|
|
regterrain({
|
|
|
|
description = "Dirt",
|
2018-11-02 18:47:44 -04:00
|
|
|
alternate_loose = {
|
|
|
|
groups = {
|
2019-02-01 18:34:03 -05:00
|
|
|
falling_repose = 2,
|
|
|
|
soil = 2
|
2018-11-02 18:47:44 -04:00
|
|
|
}
|
|
|
|
},
|
2018-10-30 10:18:38 -04:00
|
|
|
mapgen = {
|
|
|
|
"dirt",
|
|
|
|
"ice",
|
2018-11-01 19:56:38 -04:00
|
|
|
},
|
|
|
|
groups = {
|
2019-02-01 18:34:03 -05:00
|
|
|
crumbly = 1,
|
|
|
|
soil = 1
|
2019-01-29 20:41:29 -05:00
|
|
|
},
|
|
|
|
crush_damage = 1
|
2018-10-30 10:18:38 -04:00
|
|
|
})
|
2018-10-29 22:37:57 -04:00
|
|
|
regterrain({
|
2018-10-30 10:18:38 -04:00
|
|
|
description = "Dirt with Grass",
|
|
|
|
tiles = {
|
|
|
|
modname .. "_grass_top.png",
|
|
|
|
modname .. "_dirt.png",
|
|
|
|
modname .. "_dirt.png^" .. modname .. "_grass_side.png"
|
|
|
|
},
|
|
|
|
mapgen = {
|
|
|
|
"dirt_with_grass",
|
|
|
|
"dirt_with_snow"
|
2018-11-01 19:56:38 -04:00
|
|
|
},
|
|
|
|
groups = {
|
2019-02-01 18:34:03 -05:00
|
|
|
crumbly = 2,
|
2019-02-23 13:14:09 -05:00
|
|
|
soil = 1,
|
|
|
|
green = 1
|
2018-11-01 19:56:38 -04:00
|
|
|
},
|
2018-11-02 18:47:44 -04:00
|
|
|
drop_in_place = modname .. ":dirt"
|
2018-10-30 10:18:38 -04:00
|
|
|
})
|
2018-10-29 22:37:57 -04:00
|
|
|
regterrain({
|
2018-10-30 10:18:38 -04:00
|
|
|
description = "Gravel",
|
2018-11-02 18:47:44 -04:00
|
|
|
alternate_loose = {
|
|
|
|
groups = {
|
|
|
|
crumbly = 2,
|
|
|
|
falling_repose = 2
|
|
|
|
}
|
|
|
|
},
|
2018-11-01 19:56:38 -04:00
|
|
|
groups = {
|
|
|
|
crumbly = 1,
|
2018-11-02 18:47:44 -04:00
|
|
|
falling_node = 1
|
2018-11-01 19:56:38 -04:00
|
|
|
},
|
2019-01-29 20:41:29 -05:00
|
|
|
crush_damage = 1
|
2018-10-30 10:18:38 -04:00
|
|
|
})
|
2018-10-29 22:37:57 -04:00
|
|
|
regterrain({
|
2018-10-30 10:18:38 -04:00
|
|
|
description = "Sand",
|
2018-11-02 18:47:44 -04:00
|
|
|
alternate_loose = {
|
|
|
|
groups = {
|
|
|
|
falling_repose = 1
|
|
|
|
}
|
|
|
|
},
|
2018-11-01 19:56:38 -04:00
|
|
|
groups = {
|
2019-01-24 22:08:05 -05:00
|
|
|
crumbly = 1,
|
2018-11-02 18:47:44 -04:00
|
|
|
falling_node = 1
|
2018-11-01 19:56:38 -04:00
|
|
|
},
|
2018-10-30 10:18:38 -04:00
|
|
|
mapgen = {
|
|
|
|
"sand",
|
|
|
|
"clay",
|
|
|
|
"desert_sand"
|
|
|
|
},
|
2019-01-29 20:41:29 -05:00
|
|
|
crush_damage = 0.5
|
2018-10-30 10:18:38 -04:00
|
|
|
})
|
2018-11-01 19:36:08 -04:00
|
|
|
|
|
|
|
regliquid({
|
2018-10-30 10:18:38 -04:00
|
|
|
description = "Water",
|
|
|
|
mapgen = { "river_water_source", "water_source" },
|
|
|
|
paramtype = "light",
|
2018-11-01 19:36:08 -04:00
|
|
|
liquid_viscosity = 1,
|
2018-11-01 19:56:38 -04:00
|
|
|
liquid_renewable = true,
|
2018-10-30 10:18:38 -04:00
|
|
|
alpha = 160,
|
|
|
|
walkable = false,
|
|
|
|
pointable = false,
|
|
|
|
diggable = false,
|
|
|
|
buildable_to = true,
|
|
|
|
drowning = 1,
|
2018-11-01 19:36:08 -04:00
|
|
|
drop = "",
|
2019-02-01 18:34:03 -05:00
|
|
|
groups = { coolant = 1, water = 2 },
|
2018-11-01 19:36:08 -04:00
|
|
|
post_effect_color = {a = 103, r = 30, g = 76, b = 90}
|
2018-10-30 10:18:38 -04:00
|
|
|
})
|
2018-11-01 19:36:08 -04:00
|
|
|
regliquid({
|
2018-10-30 10:18:38 -04:00
|
|
|
description = "Lava",
|
|
|
|
mapgen = { "lava_source" },
|
2018-11-01 19:36:08 -04:00
|
|
|
paramtype = "light",
|
|
|
|
liquid_viscosity = 7,
|
|
|
|
liquid_renewable = false,
|
2018-10-30 10:18:38 -04:00
|
|
|
light_source = 13,
|
|
|
|
walkable = false,
|
|
|
|
diggable = false,
|
|
|
|
buildable_to = true,
|
|
|
|
drowning = 1,
|
|
|
|
damage_per_second = 8,
|
2019-03-07 22:21:04 -05:00
|
|
|
on_punch = nodecore.node_punch_hurt,
|
2018-11-01 19:36:08 -04:00
|
|
|
drop = "",
|
2019-03-07 21:50:29 -05:00
|
|
|
groups = { igniter = 1, lava = 2 },
|
2018-11-01 19:36:08 -04:00
|
|
|
post_effect_color = {a = 191, r = 255, g = 64, b = 0}
|
2018-10-30 10:18:38 -04:00
|
|
|
})
|