diff --git a/decorations.lua b/decorations.lua index 3b92eae..e9f70d5 100644 --- a/decorations.lua +++ b/decorations.lua @@ -1,7 +1,10 @@ +local path = minetest.get_modpath("30biomes") +local defaultpath = minetest.get_modpath("default") + -- Mud in swamps minetest.register_ore({ ore_type = "blob", - ore = "biomes:mud", + ore = "30biomes:mud", wherein = {"default:dirt", "default:dirt_with_grass"}, clust_scarcity = 12*12*12, clust_size = 10, @@ -43,7 +46,7 @@ minetest.register_ore({ -- Jungle grass minetest.register_decoration({ deco_type = "simple", - place_on = {"default:dirt_with_grass", "biomes:mud"}, + place_on = {"default:dirt_with_grass", "30biomes:mud"}, sidelen = 16, noise_params = { offset = 0.15, @@ -172,7 +175,7 @@ minetest.register_decoration({ biomes = {"deciduous_forest", "cold_deciduous_forest", "orchard", "hot_deciduous_forest"}, y_min = 1, y_max = 31000, - schematic = minetest.get_modpath("default").."/schematics/apple_tree.mts", + schematic = defaultpath.."/schematics/apple_tree.mts", flags = "place_center_x, place_center_z", }) @@ -225,7 +228,7 @@ minetest.register_decoration({ biomes = {"semi-tropical_forest", "mixed_forest"}, y_min = 1, y_max = 31000, - schematic = minetest.get_modpath("default").."/schematics/apple_tree.mts", + schematic = defaultpath.."/schematics/apple_tree.mts", flags = "place_center_x, place_center_z", }) @@ -278,7 +281,7 @@ minetest.register_decoration({ biomes = {"rainforest", "mangrove"}, y_min = 0, y_max = 31000, - schematic = minetest.get_modpath("default").."/schematics/jungle_tree.mts", + schematic = defaultpath.."/schematics/jungle_tree.mts", flags = "place_center_x, place_center_z", rotation = "random", }) @@ -332,7 +335,7 @@ minetest.register_decoration({ biomes = {"semi-tropical_forest"}, y_min = 0, y_max = 31000, - schematic = minetest.get_modpath("default").."/schematics/jungle_tree.mts", + schematic = defaultpath.."/schematics/jungle_tree.mts", flags = "place_center_x, place_center_z", rotation = "random", }) @@ -383,10 +386,10 @@ minetest.register_decoration({ octaves = 3, persist = 0.66 }, - biomes = {"taiga", "coniferous_forest"}, + biomes = {"hot_pine_forest"}, y_min = 2, y_max = 31000, - schematic = minetest.get_modpath("default").."/schematics/pine_tree.mts", + schematic = path.."/schematics/pine_tree.mts", flags = "place_center_x, place_center_z", }) @@ -402,7 +405,7 @@ minetest.register_decoration({ octaves = 3, persist = 0.66 }, - biomes = {"taiga", "coniferous_forest"}, + biomes = {"hot_pine_forest"}, y_min = 1, y_max = 31000, schematic = { @@ -424,6 +427,112 @@ minetest.register_decoration({ }) -- Rarer pine tree and log +minetest.register_decoration({ + deco_type = "schematic", + place_on = {"default:dirt_with_snow", "default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = 0.020, + scale = -0.020, + spread = {x = 250, y = 250, z = 250}, + seed = 45, + octaves = 3, + persist = 0.66 + }, + biomes = {"hot_deciduous_forest", "scrub"}, + y_min = 2, + y_max = 31000, + schematic = path.."/schematics/pine_tree.mts", + flags = "place_center_x, place_center_z", +}) + +minetest.register_decoration({ + deco_type = "schematic", + place_on = {"default:dirt_with_snow", "default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = 0.001, + scale = -0.001, + spread = {x = 250, y = 250, z = 250}, + seed = 2, + octaves = 3, + persist = 0.66 + }, + biomes = {"hot_deciduous_forest", "scrub"}, + y_min = 1, + y_max = 31000, + schematic = { + size = {x = 3, y = 3, z = 1}, + data = { + {name = "air", prob = 0}, + {name = "air", prob = 0}, + {name = "air", prob = 0}, + {name = "default:pine_tree", param2 = 12, prob = 191}, + {name = "default:pine_tree", param2 = 12}, + {name = "default:pine_tree", param2 = 12, prob = 127}, + {name = "air", prob = 0}, + {name = "flowers:mushroom_red", prob = 63}, + {name = "air", prob = 0}, + }, + }, + flags = "place_center_x", + rotation = "random", +}) + +-- Fir tree and log +minetest.register_decoration({ + deco_type = "schematic", + place_on = {"default:dirt_with_snow", "default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = 0.036, + scale = 0.022, + spread = {x = 250, y = 250, z = 250}, + seed = 2, + octaves = 3, + persist = 0.66 + }, + biomes = {"taiga", "coniferous_forest"}, + y_min = 2, + y_max = 31000, + schematic = path.."/schematics/fir_tree.mts", + flags = "place_center_x, place_center_z", +}) + +minetest.register_decoration({ + deco_type = "schematic", + place_on = {"default:dirt_with_snow", "default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = 0.0018, + scale = 0.0011, + spread = {x = 250, y = 250, z = 250}, + seed = 2, + octaves = 3, + persist = 0.66 + }, + biomes = {"taiga", "coniferous_forest"}, + y_min = 1, + y_max = 31000, + schematic = { + size = {x = 3, y = 3, z = 1}, + data = { + {name = "air", prob = 0}, + {name = "air", prob = 0}, + {name = "air", prob = 0}, + {name = "30biomes:fir_tree", param2 = 12, prob = 191}, + {name = "30biomes:fir_tree", param2 = 12}, + {name = "30biomes:fir_tree", param2 = 12, prob = 127}, + {name = "air", prob = 0}, + {name = "flowers:mushroom_red", prob = 63}, + {name = "air", prob = 0}, + }, + }, + flags = "place_center_x", + rotation = "random", +}) + +-- Rarer fir tree and log minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_snow", "default:dirt_with_grass"}, @@ -439,7 +548,7 @@ minetest.register_decoration({ biomes = {"mixed_forest"}, y_min = 2, y_max = 31000, - schematic = minetest.get_modpath("default").."/schematics/pine_tree.mts", + schematic = path.."/schematics/fir_tree.mts", flags = "place_center_x, place_center_z", }) @@ -464,9 +573,9 @@ minetest.register_decoration({ {name = "air", prob = 0}, {name = "air", prob = 0}, {name = "air", prob = 0}, - {name = "default:pine_tree", param2 = 12, prob = 191}, - {name = "default:pine_tree", param2 = 12}, - {name = "default:pine_tree", param2 = 12, prob = 127}, + {name = "30biomes:fir_tree", param2 = 12, prob = 191}, + {name = "30biomes:fir_tree", param2 = 12}, + {name = "30biomes:fir_tree", param2 = 12, prob = 127}, {name = "air", prob = 0}, {name = "flowers:mushroom_red", prob = 63}, {name = "air", prob = 0}, @@ -492,7 +601,7 @@ minetest.register_decoration({ biomes = {"savanna", "red_savanna"}, y_min = 1, y_max = 31000, - schematic = minetest.get_modpath("default").."/schematics/acacia_tree.mts", + schematic = defaultpath.."/schematics/acacia_tree.mts", flags = "place_center_x, place_center_z", rotation = "random", }) @@ -543,7 +652,7 @@ minetest.register_decoration({ biomes = {"cold_deciduous_forest", "mixed_forest"}, y_min = 1, y_max = 31000, - schematic = minetest.get_modpath("default").."/schematics/aspen_tree.mts", + schematic = defaultpath.."/schematics/aspen_tree.mts", flags = "place_center_x, place_center_z", rotation = "random", }) @@ -597,7 +706,7 @@ minetest.register_decoration({ biomes = {"swamp_shore", "hot_swamp_shore", "mangrove"}, y_min = 0, y_max = 0, - schematic = minetest.get_modpath("default").."/schematics/papyrus.mts", + schematic = defaultpath.."/schematics/papyrus.mts", }) -- Cactus diff --git a/init.lua b/init.lua index adf89ba..b1dfe25 100644 --- a/init.lua +++ b/init.lua @@ -1,24 +1,8 @@ -local path = minetest.get_modpath("biomes") +local path = minetest.get_modpath("30biomes") minetest.clear_registered_decorations() minetest.clear_registered_biomes() -minetest.register_node("biomes:mud", { - description = "Mud", - tiles = {"biomes_mud.png"}, - liquid_viscosity = 8, - liquidtype = "source", - liquid_renewable = false, - liquid_alternative_source = "biomes:mud", - liquid_alternative_flowing = "biomes:mud", - liquid_range = 0, - post_effect_color = {r=115, g=61, b=31, a=255}, - drowning = 1, - walkable = false, - groups = {crumbly = 2}, - sounds = default.node_sound_dirt_defaults(), -}) - local file = io.open(path .. "/biomes.csv", "r") for line in file:lines() do local attribs = line:split(",", true) @@ -77,6 +61,8 @@ end file:close() +dofile(path .. "/nodes.lua") + --dofile(path .. "/main_biomes.lua") --dofile(path .. "/beach_biomes.lua") --dofile(path .. "/sea_biomes.lua") diff --git a/mod.conf b/mod.conf index 0028f11..3c67fde 100644 --- a/mod.conf +++ b/mod.conf @@ -1 +1 @@ -name = biomes +name = 30biomes diff --git a/nodes.lua b/nodes.lua new file mode 100644 index 0000000..6a078a6 --- /dev/null +++ b/nodes.lua @@ -0,0 +1,59 @@ +-- Mud for swamps +minetest.register_node("30biomes:mud", { + description = "Mud", + tiles = {"biomes_mud.png"}, + liquid_viscosity = 8, + liquidtype = "source", + liquid_renewable = false, + liquid_alternative_source = "30biomes:mud", + liquid_alternative_flowing = "30biomes:mud", + liquid_range = 0, + post_effect_color = {r=115, g=61, b=31, a=255}, + drowning = 1, + walkable = false, + groups = {crumbly = 2}, + sounds = default.node_sound_dirt_defaults(), +}) + +-- Fir tree +minetest.register_node("30biomes:fir_tree", { + description = "Fir Tree", + tiles = {"biomes_fir_tree_top.png", "biomes_fir_tree_top.png", "biomes_fir_tree.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, + sounds = default.node_sound_wood_defaults(), + + on_place = minetest.rotate_node +}) + +-- Fir needles +minetest.register_node("30biomes:fir_needles", { + description = "Fir Needles", + drawtype = "allfaces_optional", + waving = 1, + tiles = {"biomes_fir_leaves.png"}, + paramtype = "light", + is_ground_content = false, + groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, + --[[drop = { + max_items = 1, + items = { + { + -- player will get sapling with 1/20 chance + items = {'default:sapling'}, + rarity = 20, + }, + { + -- player will get leaves only if he get no saplings, + -- this is because max_items is 1 + items = {'default:leaves'}, + } + } + },]] + sounds = default.node_sound_leaves_defaults(), + + after_place_node = default.after_place_leaves, +}) + +minetest.register_alias("30biomes:fir_needles", "fir_needles") diff --git a/schematics/fir_tree.mts b/schematics/fir_tree.mts new file mode 100644 index 0000000..b4f0966 Binary files /dev/null and b/schematics/fir_tree.mts differ diff --git a/schematics/fir_tree_backup.mts b/schematics/fir_tree_backup.mts new file mode 100644 index 0000000..d7cad8a --- /dev/null +++ b/schematics/fir_tree_backup.mts @@ -0,0 +1,2 @@ +MTSM\00\00\00\00?????\00\00air\00biomes:fir_needles\00biomes:fir_treex\9C\EDR[ +\C00\8B\BDh\8F\E0r\F4\AE{\E0\FA%ݴ\ECg)\88!%\84 \80\D8\CBV\A3\A9\C6)i\EA\8E\F2r\93k;\9D\8B9?W\EFT\F1\EE\D6vI\F5\C1]U\A5\D6Y\EAC *H\CEP\A09\83}\F4\FF\8D=\AC\CC.)\95\87Į~,\C2 a5 diff --git a/schematics/pine_tree.mts b/schematics/pine_tree.mts new file mode 100644 index 0000000..164e51f Binary files /dev/null and b/schematics/pine_tree.mts differ diff --git a/schematics/pine_tree_old.mts b/schematics/pine_tree_old.mts new file mode 100644 index 0000000..d2c4742 Binary files /dev/null and b/schematics/pine_tree_old.mts differ diff --git a/textures/biomes_fir_leaves.png b/textures/biomes_fir_leaves.png new file mode 100644 index 0000000..e1487f7 Binary files /dev/null and b/textures/biomes_fir_leaves.png differ diff --git a/textures/biomes_fir_sapling.png b/textures/biomes_fir_sapling.png new file mode 100644 index 0000000..691ed3e Binary files /dev/null and b/textures/biomes_fir_sapling.png differ diff --git a/textures/biomes_fir_tree.png b/textures/biomes_fir_tree.png new file mode 100644 index 0000000..c34932c Binary files /dev/null and b/textures/biomes_fir_tree.png differ diff --git a/textures/biomes_fir_tree_top.png b/textures/biomes_fir_tree_top.png new file mode 100644 index 0000000..d421525 Binary files /dev/null and b/textures/biomes_fir_tree_top.png differ diff --git a/textures/biomes_fir_wood.png b/textures/biomes_fir_wood.png new file mode 100644 index 0000000..49fd55b Binary files /dev/null and b/textures/biomes_fir_wood.png differ