From 425ec6774deedadb5d6324c3887bd876ea132dba Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 17 Feb 2017 00:09:05 +0100 Subject: [PATCH] Move main mapgen code into new mod --- README.md | 2 ++ mods/CORE/mcl_core/init.lua | 1 - mods/MAPGEN/mcl_mapgen_core/depends.txt | 1 + .../mapgen.lua => MAPGEN/mcl_mapgen_core/init.lua} | 14 +++++++------- mods/MAPGEN/mcl_mapgen_core/mod.conf | 1 + 5 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 mods/MAPGEN/mcl_mapgen_core/depends.txt rename mods/{CORE/mcl_core/mapgen.lua => MAPGEN/mcl_mapgen_core/init.lua} (97%) create mode 100644 mods/MAPGEN/mcl_mapgen_core/mod.conf diff --git a/README.md b/README.md index ceb4a91e0b..544a9c129f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # MineClone 2 A Minecraft-like game for Minetest. Forked from MineClone by daredevils. +Version: 0.10.0 + ### Gameplay You start in a randomly-generated world made entirely of cubes. You can explore the world and dig and build almost every block in the world to create new diff --git a/mods/CORE/mcl_core/init.lua b/mods/CORE/mcl_core/init.lua index 7ab474c2de..8b1c98000a 100644 --- a/mods/CORE/mcl_core/init.lua +++ b/mods/CORE/mcl_core/init.lua @@ -25,4 +25,3 @@ dofile(minetest.get_modpath("mcl_core").."/nodes.lua") dofile(minetest.get_modpath("mcl_core").."/tools.lua") dofile(minetest.get_modpath("mcl_core").."/craftitems.lua") dofile(minetest.get_modpath("mcl_core").."/crafting.lua") -dofile(minetest.get_modpath("mcl_core").."/mapgen.lua") diff --git a/mods/MAPGEN/mcl_mapgen_core/depends.txt b/mods/MAPGEN/mcl_mapgen_core/depends.txt new file mode 100644 index 0000000000..315237e07b --- /dev/null +++ b/mods/MAPGEN/mcl_mapgen_core/depends.txt @@ -0,0 +1 @@ +mcl_core diff --git a/mods/CORE/mcl_core/mapgen.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua similarity index 97% rename from mods/CORE/mcl_core/mapgen.lua rename to mods/MAPGEN/mcl_mapgen_core/init.lua index bbed3adb55..dc82abbef4 100644 --- a/mods/CORE/mcl_core/mapgen.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -1,9 +1,9 @@ --- mods/default/mapgen.lua - -- -- Aliases for map generator outputs -- +mcl_mapgen_core = {} + minetest.register_alias("mapgen_air", "air") minetest.register_alias("mapgen_stone", "mcl_core:stone") minetest.register_alias("mapgen_tree", "mcl_core:tree") @@ -259,7 +259,7 @@ minetest.register_ore({ y_max = -50, }) -function mcl_core.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, y_min, y_max) +function mcl_mapgen_core.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, y_min, y_max) minetest.log('action', "WARNING: mcl_core.generate_ore is deprecated") if maxp.y < y_min or minp.y > y_max then @@ -301,7 +301,7 @@ function mcl_core.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volum --print("generate_ore done") end -function mcl_core.make_reeds(pos, size) +function mcl_mapgen_core.make_reeds(pos, size) for y=0,size-1 do local p = {x=pos.x, y=pos.y+y, z=pos.z} local nn = minetest.get_node(p).name @@ -314,7 +314,7 @@ function mcl_core.make_reeds(pos, size) end end -function mcl_core.make_cactus(pos, size) +function mcl_mapgen_core.make_cactus(pos, size) for y=0,size-1 do local p = {x=pos.x, y=pos.y+y, z=pos.z} local nn = minetest.get_node(p).name @@ -385,7 +385,7 @@ minetest.register_on_generated(function(minp, maxp, seed) local z = pr:next(z0, z1) if minetest.get_node({x=x,y=1,z=z}).name == "mcl_core:dirt_with_grass" and minetest.find_node_near({x=x,y=1,z=z}, 1, "mcl_core:water_source") then - mcl_core.make_reeds({x=x,y=2,z=z}, pr:next(2, 4)) + mcl_mapgen_core.make_reeds({x=x,y=2,z=z}, pr:next(2, 4)) end local p = {x=x,y=1,z=z} if minetest.get_node(p).name == "mcl_core:sand" then @@ -426,7 +426,7 @@ minetest.register_on_generated(function(minp, maxp, seed) end -- If sand, make cactus if ground_y and minetest.get_node({x=x,y=ground_y,z=z}).name == "mcl_core:sand" then - mcl_core.make_cactus({x=x,y=ground_y+1,z=z}, pr:next(3, 4)) + mcl_mapgen_core.make_cactus({x=x,y=ground_y+1,z=z}, pr:next(3, 4)) end end end diff --git a/mods/MAPGEN/mcl_mapgen_core/mod.conf b/mods/MAPGEN/mcl_mapgen_core/mod.conf new file mode 100644 index 0000000000..5b5419c32a --- /dev/null +++ b/mods/MAPGEN/mcl_mapgen_core/mod.conf @@ -0,0 +1 @@ +name = mcl_mapgen_core