re-do biomes

master
maikerumine 2016-04-12 19:19:03 -04:00
parent 5dbf9e13ec
commit 1389b49791
20 changed files with 575 additions and 9802 deletions

View File

@ -1,6 +1,7 @@
--Extreme Survival created by maikerumine
-- Minetest 0.4.13 mod: "Extreme Survival"
-- namespace: es
--version 1.8
--https://github.com/maikerumine
--License:
@ -23,8 +24,18 @@ minetest.register_alias("default:desert_stone_with_gold", "es:desert_stone_with_
minetest.register_alias("default:desert_stone_with_coal", "es:desert_stone_with_coal")
minetest.register_alias("default:stone_with_mese", "es:stone_with_mese")
minetest.register_alias("protector_mese:protect", "protector:protect")
minetest.register_alias("es:strange_clay", "es:strange_clay_blue")
minetest.register_alias("cblocks:clay_magenta", "es:strange_clay_maroon")
minetest.register_alias("cblocks:clay_black", "es:strange_clay_black")
minetest.register_alias("cblocks:clay_red", "es:strange_clay_red")
minetest.register_alias("cblocks:clay_grey", "es:strange_clay_grey")
minetest.register_alias("cblocks:clay_orange", "es:strange_clay_orange")
minetest.register_alias("cblocks:clay_brown", "es:strange_clay_brown")
--This is to fix the old interaction with my modified 3d_armor mod.
--NEED TO USE THIS FOR 3-D ARMOUR TO WORK!!!!!
minetest.register_alias("3d_armor:helmet_aikerum", "es:helmet_aikerum")

View File

@ -1,6 +1,7 @@
--Extreme Survival created by maikerumine
-- Minetest 0.4.13 mod: "Extreme Survival"
-- namespace: es
--version 1.8
--https://github.com/maikerumine
--License:

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,6 @@
default
farming?
flowers?
stairs
cblocks?
moreblocks?

View File

@ -1,6 +1,7 @@
--Extreme Survival created by maikerumine
-- Minetest 0.4.13 mod: "Extreme Survival"
-- namespace: es
--version 1.8
--https://github.com/maikerumine
--License:

View File

@ -1,13 +1,18 @@
--Extreme Survival created by maikerumine
-- Minetest 0.4.13 mod: "Extreme Survival"
-- namespace: es
--version 1.8
--https://github.com/maikerumine
local function register_plant(name, min, max, spawnby, num)
minetest.register_decoration({
deco_type = "simple",
place_on = {"es:strange_grass","es:aiden_grass"},
place_on = {"es:strange_grass","es:aiden_grass","default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.006,
spread = {x = 60, y = 60, z = 60},
spread = {x = 70, y = 70, z = 70},
seed = 329,
octaves = 3,
persist = 0.6
@ -20,7 +25,13 @@ local function register_plant(name, min, max, spawnby, num)
})
end
function farming_register_mgv6_decorations()
function farming.register_mgv6_decorations()
register_plant("potato_3", 15, 40, "", -1)
register_plant("tomato_7", 5, 20, "", -1)
register_plant("carrot_8", 1, 30, "group:water", 1)
@ -38,7 +49,7 @@ function farming_register_mgv6_decorations()
end
-- v7 maps have a beach so plants growing near water is limited to 6 high
function farming_register_mgv7_decorations()
function farming.register_mgv7_decorations()
register_plant("potato_3", 15, 40, "", -1)
register_plant("tomato_7", 5, 20, "", -1)
register_plant("carrot_8", 1, 6, "", -1)

173
flowers.lua Normal file
View File

@ -0,0 +1,173 @@
--
-- Mgv6
--
local function register_mgv6_flower(name)
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass","es:strange_grass","es:aiden_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.006,
spread = {x = 100, y = 100, z = 100},
seed = 436,
octaves = 3,
persist = 0.6
},
y_min = 1,
y_max = 70,
decoration = "flowers:"..name,
})
end
local function register_mgv6_mushroom(name)
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass","es:strange_grass","es:aiden_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.04,
spread = {x = 30, y = 30, z = 30},
seed = 7133,
octaves = 3,
persist = 0.6
},
y_min = 1,
y_max = 90,
decoration = "flowers:"..name,
spawn_by = "default:tree",
num_spawn_by = 1,
})
end
local function register_mgv6_waterlily()
minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:dirt"},
sidelen = 16,
noise_params = {
offset = -0.12,
scale = 0.3,
spread = {x = 100, y = 100, z = 100},
seed = 33,
octaves = 3,
persist = 0.7
},
y_min = 0,
y_max = 0,
schematic = minetest.get_modpath("flowers").."/schematics/waterlily.mts",
rotation = "random",
})
end
function flowers.register_mgv6_decorations()
register_mgv6_flower("rose")
register_mgv6_flower("tulip")
register_mgv6_flower("dandelion_yellow")
register_mgv6_flower("geranium")
register_mgv6_flower("viola")
register_mgv6_flower("dandelion_white")
register_mgv6_mushroom("mushroom_brown")
register_mgv6_mushroom("mushroom_red")
register_mgv6_waterlily()
end
--
-- All other biome API mapgens
--
local function register_flower(seed, name)
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass","es:strange_grass","es:aiden_grass"},
sidelen = 16,
noise_params = {
offset = -0.015,
scale = 0.025,
spread = {x = 200, y = 200, z = 200},
seed = seed,
octaves = 3,
persist = 0.6
},
biomes = {"stone_grassland", "sandstone_grassland",
"deciduous_forest", "coniferous_forest","strangeland","aidenland"},
y_min = 1,
y_max = 31000,
decoration = "flowers:"..name,
})
end
local function register_mushroom(name)
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.006,
spread = {x = 200, y = 200, z = 200},
seed = 2,
octaves = 3,
persist = 0.66
},
biomes = {"deciduous_forest", "coniferous_forest"},
y_min = 1,
y_max = 31000,
decoration = "flowers:"..name,
})
end
local function register_waterlily()
minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:dirt"},
sidelen = 16,
noise_params = {
offset = -0.12,
scale = 0.3,
spread = {x = 200, y = 200, z = 200},
seed = 33,
octaves = 3,
persist = 0.7
},
biomes = {"rainforest_swamp", "savanna_swamp", "deciduous_forest_swamp"},
y_min = 0,
y_max = 0,
schematic = minetest.get_modpath("flowers").."/schematics/waterlily.mts",
rotation = "random",
})
end
function flowers.register_decorations()
register_flower(436, "rose")
register_flower(19822, "tulip")
register_flower(1220999, "dandelion_yellow")
register_flower(36662, "geranium")
register_flower(1133, "viola")
register_flower(73133, "dandelion_white")
register_mushroom("mushroom_brown")
register_mushroom("mushroom_red")
register_waterlily()
end
--
-- Detect mapgen to select functions
--
-- Mods using singlenode mapgen can call these functions to enable
-- the use of minetest.generate_ores or minetest.generate_decorations
local mg_params = minetest.get_mapgen_params()
if mg_params.mgname == "v6" then
flowers.register_mgv6_decorations()
elseif mg_params.mgname ~= "singlenode" then
flowers.register_decorations()
end

139
hoes.lua
View File

@ -1,139 +0,0 @@
-- Hoe registration function
farming.register_hoe = function(name, def)
-- Check for : prefix (register new hoes in your mod's namespace)
if name:sub(1,1) ~= ":" then
name = ":" .. name
end
-- Check def table
if def.description == nil then
def.description = "Hoe"
end
if def.inventory_image == nil then
def.inventory_image = "unknown_item.png"
end
if def.recipe == nil then
def.recipe = {
{"air","air",""},
{"","group:stick",""},
{"","group:stick",""}
}
end
if def.max_uses == nil then
def.max_uses = 30
end
-- Register the tool
minetest.register_tool(name, {
description = def.description,
inventory_image = def.inventory_image,
on_use = function(itemstack, user, pointed_thing)
return farming.hoe_on_use(itemstack, user, pointed_thing, def.max_uses)
end
})
-- Register its recipe
if def.material == nil then
minetest.register_craft({
output = name:sub(2),
recipe = def.recipe
})
else
minetest.register_craft({
output = name:sub(2),
recipe = {
{def.material, def.material, ""},
{"", "group:stick", ""},
{"", "group:stick", ""}
}
})
end
end
-- Turns dirt with group soil=1 into soil
function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
local pt = pointed_thing
-- check if pointing at a node
if not pt or pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
local upos = pointed_thing.under
if minetest.is_protected(upos, user:get_player_name()) then
minetest.record_protection_violation(upos, user:get_player_name())
return
end
local p = {x = pt.under.x, y = pt.under.y + 1, z = pt.under.z}
local above = minetest.get_node(p)
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name]
or not minetest.registered_nodes[above.name] then
return
end
-- check if the node above the pointed thing is air
if above.name ~= "air" then
return
end
-- check if pointing at dirt
if minetest.get_item_group(under.name, "soil") ~= 1 then
return
end
-- turn the node into soil, wear out item and play sound
minetest.set_node(pt.under, {name = "farming:soil"})
minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5})
if not minetest.setting_getbool("creative_mode") then
itemstack:add_wear(65535/(uses-1))
end
return itemstack
end
-- Define Hoes
farming.register_hoe(":farming:hoe_wood", {
description = "Wooden Hoe",
inventory_image = "farming_tool_woodhoe.png",
max_uses = 30,
material = "group:wood"
})
farming.register_hoe(":farming:hoe_stone", {
description = "Stone Hoe",
inventory_image = "farming_tool_stonehoe.png",
max_uses = 90,
material = "group:stone"
})
farming.register_hoe(":farming:hoe_steel", {
description = "Steel Hoe",
inventory_image = "farming_tool_steelhoe.png",
max_uses = 200,
material = "default:steel_ingot"
})
farming.register_hoe(":farming:hoe_bronze", {
description = "Bronze Hoe",
inventory_image = "farming_tool_bronzehoe.png",
max_uses = 220,
material = "default:bronze_ingot"
})
farming.register_hoe(":farming:hoe_mese", {
description = "Mese Hoe",
inventory_image = "farming_tool_mesehoe.png",
max_uses = 350,
material = "default:mese_crystal"
})
farming.register_hoe(":farming:hoe_diamond", {
description = "Diamond Hoe",
inventory_image = "farming_tool_diamondhoe.png",
max_uses = 500,
material = "default:diamond"
})

View File

@ -1,8 +1,8 @@
--Extreme Survival created by maikerumine
-- Minetest 0.4.13 mod: "Extreme Survival"
-- namespace: es
--https://github.com/maikerumine
--version 1.8
--https://github.com/maikerumine
--License:
--~~~~~~~~
@ -33,6 +33,16 @@ dofile(modpath.."/shutdown.lua")
dofile(modpath.."/spawn.lua")
dofile(modpath.."/crushingfurnace.lua")
dofile(modpath.."/tools.lua")
dofile(modpath.."/biome.lua")
if farming then
dofile(modpath.."/farming.lua")
end
if flowers then
dofile(modpath.."/flowers.lua")
end
dofile(modpath.."/extra.lua")
dofile(modpath.."/nodes.lua")
dofile(modpath.."/oregen.lua")

34
map.lua
View File

@ -1,34 +0,0 @@
local modpath = minetest.get_modpath("es")
es.modpath = modpath
--MAP GENERATION SELECTION SWITCH
es.MAP_SETTING = 5; --Enter a number between 0 and 5 to choose map style. See line 83 for details.
--(CURRENTLY YOU NEED TO REPLACE THE DEFAULT WITH
--the one that says stone IF YOU WANT AN ALL STONE WORLD.)
--MAP GENERATION SELECTION SWITCH
--ES OVERRIDE SETTINGS IN INIT FILE IN ES FOLDER
if es.MAP_SETTING == 0 then --DEFAULT MAPGEN
dofile(minetest.get_modpath("default").."/mapgen.lua")
end
if es.MAP_SETTING == 1 then --ALL STONE LIKE JUST TEST
dofile(modpath.."/mapgen-stone.lua")
end
if es.MAP_SETTING == 2 then --ALL DESERT -STONE STARTS AT -413
dofile(modpath.."/mapgen-desert.lua")
end
if es.MAP_SETTING == 3 then --STONE, DESERT, ALPINE CLIMATE
dofile(modpath.."/mapgen-es.lua")
end
if es.MAP_SETTING == 4 then --NO DESERT OR COLD CLIMATE
dofile(modpath.."/mapgen-v7green.lua")
end
if es.MAP_SETTING == 5 then --CUSTOM ES
--dofile(modpath.."/mapgen-v7es_custom.lua")
dofile(modpath.."/mapgen.lua")
end
--Due to complexity it is best to put map choice in default and rename to mapgen.lua

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,513 +0,0 @@
-- mods/default/mapgen.lua
--
-- Aliases for map generator outputs
--
minetest.register_alias("mapgen_stone", "default:stone")
minetest.register_alias("mapgen_tree", "default:tree")
minetest.register_alias("mapgen_leaves", "default:leaves")
minetest.register_alias("mapgen_jungletree", "default:jungletree")
minetest.register_alias("mapgen_jungleleaves", "default:jungleleaves")
minetest.register_alias("mapgen_apple", "default:apple")
minetest.register_alias("mapgen_water_source", "default:water_source")
minetest.register_alias("mapgen_dirt", "default:dirt")
minetest.register_alias("mapgen_sand", "default:sand")
minetest.register_alias("mapgen_gravel", "default:gravel")
minetest.register_alias("mapgen_clay", "default:clay")
minetest.register_alias("mapgen_lava_source", "default:lava_source")
minetest.register_alias("mapgen_cobble", "default:cobble")
minetest.register_alias("mapgen_mossycobble", "default:mossycobble")
minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass")
minetest.register_alias("mapgen_junglegrass", "default:junglegrass")
minetest.register_alias("mapgen_stone_with_coal", "default:stone_with_coal")
minetest.register_alias("mapgen_stone_with_iron", "default:stone_with_iron")
minetest.register_alias("mapgen_mese", "default:mese")
minetest.register_alias("mapgen_desert_sand", "default:desert_sand")
minetest.register_alias("mapgen_desert_stone", "default:desert_stone")
minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble")
--
-- Ore generation
--
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 8*8*8,
clust_num_ores = 8,
clust_size = 3,
height_min = -31000,
height_max = 64,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 24*24*24,
clust_num_ores = 27,
clust_size = 6,
height_min = -31000,
height_max = 0,
flags = "absheight",
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 12*12*12,
clust_num_ores = 3,
clust_size = 2,
height_min = -15,
height_max = 2,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 9*9*9,
clust_num_ores = 5,
clust_size = 3,
height_min = -63,
height_max = -16,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 7*7*7,
clust_num_ores = 5,
clust_size = 3,
height_min = -31000,
height_max = -64,
flags = "absheight",
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 24*24*24,
clust_num_ores = 27,
clust_size = 6,
height_min = -31000,
height_max = -64,
flags = "absheight",
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_mese",
wherein = "default:stone",
clust_scarcity = 18*18*18,
clust_num_ores = 3,
clust_size = 2,
height_min = -255,
height_max = -64,
flags = "absheight",
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_mese",
wherein = "default:stone",
clust_scarcity = 14*14*14,
clust_num_ores = 5,
clust_size = 3,
height_min = -31000,
height_max = -256,
flags = "absheight",
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:mese",
wherein = "default:stone",
clust_scarcity = 36*36*36,
clust_num_ores = 3,
clust_size = 2,
height_min = -31000,
height_max = -1024,
flags = "absheight",
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_gold",
wherein = "default:stone",
clust_scarcity = 15*15*15,
clust_num_ores = 3,
clust_size = 2,
height_min = -255,
height_max = -64,
flags = "absheight",
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_gold",
wherein = "default:stone",
clust_scarcity = 13*13*13,
clust_num_ores = 5,
clust_size = 3,
height_min = -31000,
height_max = -256,
flags = "absheight",
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_diamond",
wherein = "default:stone",
clust_scarcity = 17*17*17,
clust_num_ores = 4,
clust_size = 3,
height_min = -255,
height_max = -128,
flags = "absheight",
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_diamond",
wherein = "default:stone",
clust_scarcity = 15*15*15,
clust_num_ores = 4,
clust_size = 3,
height_min = -31000,
height_max = -256,
flags = "absheight",
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 12*12*12,
clust_num_ores = 4,
clust_size = 3,
height_min = -63,
height_max = -16,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 9*9*9,
clust_num_ores = 5,
clust_size = 3,
height_min = -31000,
height_max = -64,
flags = "absheight",
})
if minetest.setting_get("mg_name") == "indev" then
-- Floatlands and high mountains springs
minetest.register_ore({
ore_type = "scatter",
ore = "default:water_source",
ore_param2 = 128,
wherein = "default:stone",
clust_scarcity = 40*40*40,
clust_num_ores = 8,
clust_size = 3,
height_min = 100,
height_max = 31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:lava_source",
ore_param2 = 128,
wherein = "default:stone",
clust_scarcity = 50*50*50,
clust_num_ores = 5,
clust_size = 2,
height_min = 10000,
height_max = 31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:sand",
wherein = "default:stone",
clust_scarcity = 20*20*20,
clust_num_ores = 5*5*3,
clust_size = 5,
height_min = 500,
height_max = 31000,
})
-- Underground springs
minetest.register_ore({
ore_type = "scatter",
ore = "default:water_source",
ore_param2 = 128,
wherein = "default:stone",
clust_scarcity = 25*25*25,
clust_num_ores = 8,
clust_size = 3,
height_min = -10000,
height_max = -10,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:lava_source",
ore_param2 = 128,
wherein = "default:stone",
clust_scarcity = 35*35*35,
clust_num_ores = 5,
clust_size = 2,
height_min = -31000,
height_max = -100,
})
end
minetest.register_ore({
ore_type = "scatter",
ore = "default:clay",
wherein = "default:sand",
clust_scarcity = 15*15*15,
clust_num_ores = 64,
clust_size = 5,
height_max = 0,
height_min = -10,
})
function default.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
minetest.log('action', "WARNING: default.generate_ore is deprecated")
if maxp.y < height_min or minp.y > height_max then
return
end
local y_min = math.max(minp.y, height_min)
local y_max = math.min(maxp.y, height_max)
if chunk_size >= y_max - y_min + 1 then
return
end
local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
local pr = PseudoRandom(seed)
local num_chunks = math.floor(chunks_per_volume * volume)
local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk)
--print("generate_ore num_chunks: "..dump(num_chunks))
for i=1,num_chunks do
local y0 = pr:next(y_min, y_max-chunk_size+1)
if y0 >= height_min and y0 <= height_max then
local x0 = pr:next(minp.x, maxp.x-chunk_size+1)
local z0 = pr:next(minp.z, maxp.z-chunk_size+1)
local p0 = {x=x0, y=y0, z=z0}
for x1=0,chunk_size-1 do
for y1=0,chunk_size-1 do
for z1=0,chunk_size-1 do
if pr:next(1,inverse_chance) == 1 then
local x2 = x0+x1
local y2 = y0+y1
local z2 = z0+z1
local p2 = {x=x2, y=y2, z=z2}
if minetest.get_node(p2).name == wherein then
minetest.set_node(p2, {name=name})
end
end
end
end
end
end
end
--print("generate_ore done")
end
function default.make_papyrus(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
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
minetest.set_node(p, {name="default:papyrus"})
else
return
end
end
end
function default.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
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
minetest.set_node(p, {name="default:cactus"})
else
return
end
end
end
-- facedir: 0/1/2/3 (head node facedir value)
-- length: length of rainbow tail
function default.make_nyancat(pos, facedir, length)
local tailvec = {x=0, y=0, z=0}
if facedir == 0 then
tailvec.z = 1
elseif facedir == 1 then
tailvec.x = 1
elseif facedir == 2 then
tailvec.z = -1
elseif facedir == 3 then
tailvec.x = -1
else
--print("default.make_nyancat(): Invalid facedir: "+dump(facedir))
facedir = 0
tailvec.z = 1
end
local p = {x=pos.x, y=pos.y, z=pos.z}
minetest.set_node(p, {name="default:nyancat", param2=facedir})
for i=1,length do
p.x = p.x + tailvec.x
p.z = p.z + tailvec.z
minetest.set_node(p, {name="default:nyancat_rainbow", param2=facedir})
end
end
function generate_nyancats(seed, minp, maxp)
local height_min = -31000
local height_max = -32
if maxp.y < height_min or minp.y > height_max then
return
end
local y_min = math.max(minp.y, height_min)
local y_max = math.min(maxp.y, height_max)
local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
local pr = PseudoRandom(seed + 9324342)
local max_num_nyancats = math.floor(volume / (16*16*16))
for i=1,max_num_nyancats do
if pr:next(0, 1000) == 0 then
local x0 = pr:next(minp.x, maxp.x)
local y0 = pr:next(minp.y, maxp.y)
local z0 = pr:next(minp.z, maxp.z)
local p0 = {x=x0, y=y0, z=z0}
default.make_nyancat(p0, pr:next(0,3), pr:next(3,15))
end
end
end
minetest.register_on_generated(function(minp, maxp, seed)
if maxp.y >= 2 and minp.y <= 0 then
-- Generate papyrus
local perlin1 = minetest.get_perlin(354, 3, 0.7, 100)
-- Assume X and Z lengths are equal
local divlen = 8
local divs = (maxp.x-minp.x)/divlen+1;
for divx=0,divs-1 do
for divz=0,divs-1 do
local x0 = minp.x + math.floor((divx+0)*divlen)
local z0 = minp.z + math.floor((divz+0)*divlen)
local x1 = minp.x + math.floor((divx+1)*divlen)
local z1 = minp.z + math.floor((divz+1)*divlen)
-- Determine papyrus amount from perlin noise
local papyrus_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 45 - 20)
-- Find random positions for papyrus based on this random
local pr = PseudoRandom(seed+1)
for i=0,papyrus_amount do
local x = pr:next(x0, x1)
local z = pr:next(z0, z1)
if minetest.get_node({x=x,y=1,z=z}).name == "default:dirt_with_grass" and
minetest.find_node_near({x=x,y=1,z=z}, 1, "default:water_source") then
default.make_papyrus({x=x,y=2,z=z}, pr:next(2, 4))
end
end
end
end
-- Generate cactuses
local perlin1 = minetest.get_perlin(230, 3, 0.6, 100)
-- Assume X and Z lengths are equal
local divlen = 16
local divs = (maxp.x-minp.x)/divlen+1;
for divx=0,divs-1 do
for divz=0,divs-1 do
local x0 = minp.x + math.floor((divx+0)*divlen)
local z0 = minp.z + math.floor((divz+0)*divlen)
local x1 = minp.x + math.floor((divx+1)*divlen)
local z1 = minp.z + math.floor((divz+1)*divlen)
-- Determine cactus amount from perlin noise
local cactus_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 6 - 3)
-- Find random positions for cactus based on this random
local pr = PseudoRandom(seed+1)
for i=0,cactus_amount do
local x = pr:next(x0, x1)
local z = pr:next(z0, z1)
-- Find ground level (0...15)
local ground_y = nil
for y=30,0,-1 do
if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then
ground_y = y
break
end
end
-- If desert sand, make cactus
if ground_y and minetest.get_node({x=x,y=ground_y,z=z}).name == "default:desert_sand" then
default.make_cactus({x=x,y=ground_y+1,z=z}, pr:next(3, 4))
end
end
end
end
-- Generate grass
local perlin1 = minetest.get_perlin(329, 3, 0.6, 100)
-- Assume X and Z lengths are equal
local divlen = 16
local divs = (maxp.x-minp.x)/divlen+1;
for divx=0,divs-1 do
for divz=0,divs-1 do
local x0 = minp.x + math.floor((divx+0)*divlen)
local z0 = minp.z + math.floor((divz+0)*divlen)
local x1 = minp.x + math.floor((divx+1)*divlen)
local z1 = minp.z + math.floor((divz+1)*divlen)
-- Determine grass amount from perlin noise
local grass_amount = math.floor(perlin1:get2d({x=x0, y=z0}) ^ 3 * 9)
-- Find random positions for grass based on this random
local pr = PseudoRandom(seed+1)
for i=0,grass_amount do
local x = pr:next(x0, x1)
local z = pr:next(z0, z1)
-- Find ground level (0...15)
local ground_y = nil
for y=30,0,-1 do
if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then
ground_y = y
break
end
end
if ground_y then
local p = {x=x,y=ground_y+1,z=z}
local nn = minetest.get_node(p).name
-- Check if the node can be replaced
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
nn = minetest.get_node({x=x,y=ground_y,z=z}).name
-- If desert sand, add dry shrub
if nn == "default:desert_sand" then
minetest.set_node(p,{name="default:dry_shrub"})
-- If dirt with grass, add grass
elseif nn == "default:dirt_with_grass" then
minetest.set_node(p,{name="default:grass_"..pr:next(1, 5)})
end
end
end
end
end
end
end
-- Generate nyan cats
generate_nyancats(seed, minp, maxp)
end)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
--Extreme Survival created by maikerumine
-- Minetest 0.4.13 mod: "Extreme Survival"
-- namespace: es
-- version 1.8
--version 1.8
--https://github.com/maikerumine
--License:
@ -37,7 +37,7 @@ local function hurt_cactus() -- cactus tweak
minetest.register_node(":"..name, table2)
end
hurt_cactus();
--[[
-- Over time Cobble placed in water changes to Mossy Cobble
--From Etheral
minetest.register_abm({
@ -50,7 +50,7 @@ minetest.register_abm({
minetest.swap_node(pos, {name = "default:mossycobble"})
end
})
]]
--TECHNIC NODES
minetest.register_node( "es:granite", {
description = "Granite",
@ -484,47 +484,7 @@ minetest.register_node("es:vault", {
end,
on_blast = function() end,
})
--[[
--Protector chest buttons code
minetest.register_on_player_receive_fields(function(player, formname, fields)
if string.sub(formname, 0, string.len("es:vault_")) == "es:vault_" then
local pos_s = string.sub(formname,string.len("es:vault_") + 1)
local pos = minetest.string_to_pos(pos_s)
local meta = minetest.get_meta(pos)
local chest_inv = meta:get_inventory()
local player_inv = player:get_inventory()
local leftover
if fields.toup then
-- copy contents of players inventory to chest
for i, v in pairs (player_inv:get_list("main") or {}) do
if chest_inv
and chest_inv:room_for_item('main', v) then
leftover = chest_inv:add_item('main', v)
player_inv:remove_item("main", v)
if leftover
and not leftover:is_empty() then
player_inv:add_item("main", v)
end
end
end
elseif fields.todn then
-- copy contents of chest to players inventory
for i, v in pairs (chest_inv:get_list('main') or {}) do
if player_inv:room_for_item("main", v) then
leftover = player_inv:add_item("main", v)
chest_inv:remove_item('main', v)
if leftover
and not leftover:is_empty() then
chest_inv:add_item('main', v)
end
end
end
end
end
end)
]]
--CUSTOM biome stuff
@ -628,26 +588,7 @@ minetest.register_node("es:strange_shrub", {
walkable = false,
tiles = {"default_jungleleaves.png^default_dry_shrub.png^[colorize:#0000FF:170"},
groups = {snappy = 3, flammable = 2, leaves = 1},
--[[
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {'default:apple'},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {'default:stick'},
}
}
},
]]
sounds = default.node_sound_leaves_defaults(),
--after_place_node = default.after_place_leaves,
})
minetest.register_node("es:strange_clay_blue", {
@ -680,7 +621,31 @@ minetest.register_node("es:strange_clay_brown", {
description = "Strange Clay Brown",
tiles = {"default_clay.png^[colorize:#61210B:180"},
groups = {crumbly = 3},
drop = 'default:clay_lump 4',
--drop = 'default:clay_lump 4',
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_node("es:strange_clay_orange", {
description = "Strange Clay Orange",
tiles = {"default_clay.png^[colorize:#FE642E:180"},
groups = {crumbly = 3},
--drop = 'default:clay_lump 4',
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_node("es:strange_clay_black", {
description = "Strange Clay Black",
tiles = {"default_clay.png^[colorize:#151515:180"},
groups = {crumbly = 3},
--drop = 'default:clay_lump 4',
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_node("es:strange_clay_grey", {
description = "Strange Clay Black",
tiles = {"default_clay.png^[colorize:#848484:180"},
groups = {crumbly = 3},
--drop = 'default:clay_lump 4',
sounds = default.node_sound_dirt_defaults(),
})

View File

@ -1,6 +1,7 @@
--Extreme Survival created by maikerumine
-- Minetest 0.4.13 mod: "Extreme Survival"
-- namespace: es
--version 1.8
--https://github.com/maikerumine
--License:
@ -40,10 +41,10 @@ minetest.register_ore({
noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=24, octaves=3, persist=0.70}
})
--CBLOCKS CLAY!!
--CLAY!!
minetest.register_ore({
ore_type = "sheet",
ore = "cblocks:clay_magenta",
ore = "es:strange_clay_maroon",
wherein = {"default:desert_stone"},
clust_scarcity = 1,
clust_num_ores = 3,
@ -56,7 +57,7 @@ minetest.register_ore({
minetest.register_ore({
ore_type = "sheet",
ore = "cblocks:clay_black",
ore = "es:strange_clay_black",
wherein = {"default:desert_stone","default:stone"},
clust_scarcity = 1,
clust_num_ores = 12,
@ -69,7 +70,7 @@ minetest.register_ore({
minetest.register_ore({
ore_type = "sheet",
ore = "cblocks:clay_red",
ore = "es:strange_clay_red",
wherein = {"default:desert_stone"},
clust_scarcity = 1,
clust_num_ores = 8,
@ -82,7 +83,7 @@ minetest.register_ore({
minetest.register_ore({
ore_type = "sheet",
ore = "cblocks:clay_grey",
ore = "es:strange_clay_grey",
wherein = {"default:desert_stone"},
clust_scarcity = 1,
clust_num_ores = 8,
@ -95,7 +96,7 @@ minetest.register_ore({
minetest.register_ore({
ore_type = "sheet",
ore = "cblocks:clay_orange",
ore = "es:strange_clay_orange",
wherein ={"default:desert_stone","default:desert_sand"},
clust_scarcity = 1,
clust_num_ores = 5,
@ -108,7 +109,7 @@ minetest.register_ore({
minetest.register_ore({
ore_type = "sheet",
ore = "cblocks:clay_brown",
ore = "es:strange_clay_brown",
wherein = {"default:desert_stone","default:desert_sand"},
clust_scarcity = 1,
clust_num_ores = 12,
@ -119,7 +120,6 @@ minetest.register_ore({
noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=24, octaves=3, persist=0.70}
})
--ES Clay
minetest.register_ore({
ore_type = "sheet",
ore = "es:strange_clay_red",
@ -148,7 +148,7 @@ minetest.register_ore({
minetest.register_ore({
ore_type = "sheet",
ore = "cblocks:clay_black",
ore = "es:strange_clay_black",
wherein = {"es:strange_clay_brown"},
clust_scarcity = 1,
clust_num_ores = 12,

View File

@ -1,111 +0,0 @@
--Extreme Survival created by maikerumine
-- Minetest 0.4.13 mod: "Extreme Survival"
-- namespace: es
--https://github.com/maikerumine
--License:
--~~~~~~~~
--Code:
--(c) Copyright 2015 maikerumine; modified zlib-License
--see "LICENSE.txt" for details.
--Media(if not stated differently):
--(c) Copyright (2014-2015) maikerumine; CC-BY-SA 3.0
es = {}
--Fixer's code--v
--Modified by maikerumine
-- Time to shut down server.
-- Default is twice a day: at 06:05 and 18:05
local H = 00
local X = 06
local Y = 12
local Z = 18
local M = 00
local N = 01
-- Day to shut down server.
-- Default is daily shutdown
-- 1=Sunday, ..., 7=Saturday, nil=Shutdown daily
local D = nil
local timer = 0
minetest.register_globalstep(function(dtime)
timer = timer + dtime
if timer < 1 then return end
timer = 0
local t = os.date("*t")
if ((t.hour == H or t.hour == X or t.hour == Y or t.hour == Z) and (t.min == M) and (t.sec <= 2)
and ((D == nil) or (t.wday == D))) then
minetest.chat_send_all("Scheduled shutdown. 02, 06, 12, 18 Hours Eastern Time Zone "
.."Shutting down in ONE minute.")
minetest.chat_send_all("Do not use chests or inventory at this time. "
.."Shutting down in ONE minute.")
--minetest.after(2, minetest.request_shutdown)
end
if ((t.hour == H or t.hour == X or t.hour == Y or t.hour == Z) and (t.min ==N) and (t.sec <= 2)
and ((D == nil) or (t.wday == D))) then
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.after(2, minetest.request_shutdown)
end
end)
--[[
minetest.register_globalstep(function(dtime)
timer = timer + dtime
if timer < 1 then return end
timer = 0
local t = os.date("*t")
if ((t.hour == H or t.hour == X or t.hour == Y or t.hour == Z) and (t.min ==N) and (t.sec <= 2)
and ((D == nil) or (t.wday == D))) then
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.after(2, minetest.request_shutdown)
end
end)
]]
--MAPFIX CODE
minetest.register_chatcommand("mapfix", {
params = "<size>",
description = "Recalculate the flowing liquids of a chunk",
func = function(name, param)
local pos = minetest.get_player_by_name(name):getpos()
local size = tonumber(param) or 40
if size > 50 and not minetest.check_player_privs(name, {server=true}) then
return false, "You need the server privilege to exceed the radius of 50 blocks"
end
local minp, maxp = {x = math.floor(pos.x - size), y = math.floor(pos.y - size), z = math.floor(pos.z - size)}, {x = math.ceil(pos.x + size), y = math.ceil(pos.y + size), z = math.ceil(pos.z + size)}
local vm = minetest.get_voxel_manip()
vm:read_from_map(minp, maxp)
vm:calc_lighting()
vm:update_liquids()
vm:write_to_map()
vm:update_map()
return true, "Done."
end,
})