Updated files from minetest_game to the versions present in minetest_game-0.4.5.

This commit is contained in:
0gb.us 2013-03-05 14:07:10 -08:00
parent 99660e98c2
commit b9607bff91
186 changed files with 616 additions and 229 deletions

View File

@ -6,7 +6,7 @@ To build the wholeness of the Minetest project, insert this repository as
in the Minetest Engine.
The Minetest Engine can be found in:
https://github.com/celeron55/minetest/
https://github.com/minetest/minetest/
Compatibility
--------------
@ -17,7 +17,7 @@ Additionally, when the minetest engine is tagged to be a certain version (eg.
0.4.dev-20120326), minetest_game is tagged with the version too.
When stable releases are made, minetest_game is packaged and made available in
https://github.com/celeron55/minetest_game/downloads
http://minetest.net/download.php
and in case the repository has grown too much, it may be reset. In that sense,
this is not a "real" git repository. (Package maintainers please note!)

View File

Before

Width:  |  Height:  |  Size: 329 B

After

Width:  |  Height:  |  Size: 329 B

View File

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 363 B

View File

Before

Width:  |  Height:  |  Size: 369 B

After

Width:  |  Height:  |  Size: 369 B

View File

@ -0,0 +1,22 @@
Minetest 0.4 mod: creative
==========================
Implements creative mode.
Switch on by using the "creative_mode" setting.
Registered items that
- have a description, and
- do not have the group not_in_creative_inventory
are added to the creative inventory.
License of source code and media files:
---------------------------------------
Copyright (C) 2012 Perttu Ahola (celeron55) <celeron55@gmail.com>
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.

View File

@ -0,0 +1,162 @@
-- minetest/creative/init.lua
local creative_inventory = {}
creative_inventory.creative_inventory_size = 0
-- Create detached creative inventory after loading all mods
minetest.after(0, function()
local inv = minetest.create_detached_inventory("creative", {
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
if minetest.setting_getbool("creative_mode") then
return count
else
return 0
end
end,
allow_put = function(inv, listname, index, stack, player)
return 0
end,
allow_take = function(inv, listname, index, stack, player)
if minetest.setting_getbool("creative_mode") then
return -1
else
return 0
end
end,
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
end,
on_put = function(inv, listname, index, stack, player)
end,
on_take = function(inv, listname, index, stack, player)
print(player:get_player_name().." takes item from creative inventory; listname="..dump(listname)..", index="..dump(index)..", stack="..dump(stack))
if stack then
print("stack:get_name()="..dump(stack:get_name())..", stack:get_count()="..dump(stack:get_count()))
end
end,
})
local creative_list = {}
for name,def in pairs(minetest.registered_items) do
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0)
and def.description and def.description ~= "" then
table.insert(creative_list, name)
end
end
table.sort(creative_list)
inv:set_size("main", #creative_list)
for _,itemstring in ipairs(creative_list) do
inv:add_item("main", ItemStack(itemstring))
end
creative_inventory.creative_inventory_size = #creative_list
print("creative inventory size: "..dump(creative_inventory.creative_inventory_size))
end)
-- Create the trash field
local trash = minetest.create_detached_inventory("creative_trash", {
-- Allow the stack to be placed and remove it in on_put()
-- This allows the creative inventory to restore the stack
allow_put = function(inv, listname, index, stack, player)
if minetest.setting_getbool("creative_mode") then
return stack:get_count()
else
return 0
end
end,
on_put = function(inv, listname, index, stack, player)
inv:set_stack(listname, index, "")
end,
})
trash:set_size("main", 1)
creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
pagenum = math.floor(pagenum)
local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1)
player:set_inventory_formspec("size[13,7.5]"..
--"image[6,0.6;1,2;player.png]"..
"list[current_player;main;5,3.5;8,4;]"..
"list[current_player;craft;8,0;3,3;]"..
"list[current_player;craftpreview;12,1;1,1;]"..
"list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]"..
"label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]"..
"button[0.3,6.5;1.6,1;creative_prev;<<]"..
"button[2.7,6.5;1.6,1;creative_next;>>]"..
"label[5,1.5;Trash:]"..
"list[detached:creative_trash;main;5,2;1,1;]")
end
minetest.register_on_joinplayer(function(player)
-- If in creative mode, modify player's inventory forms
if not minetest.setting_getbool("creative_mode") then
return
end
creative_inventory.set_creative_formspec(player, 0, 1)
end)
minetest.register_on_player_receive_fields(function(player, formname, fields)
if not minetest.setting_getbool("creative_mode") then
return
end
-- Figure out current page from formspec
local current_page = 0
local formspec = player:get_inventory_formspec()
local start_i = string.match(formspec, "list%[detached:creative;main;[%d.]+,[%d.]+;[%d.]+,[%d.]+;(%d+)%]")
start_i = tonumber(start_i) or 0
if fields.creative_prev then
start_i = start_i - 4*6
end
if fields.creative_next then
start_i = start_i + 4*6
end
if start_i < 0 then
start_i = start_i + 4*6
end
if start_i >= creative_inventory.creative_inventory_size then
start_i = start_i - 4*6
end
if start_i < 0 or start_i >= creative_inventory.creative_inventory_size then
start_i = 0
end
creative_inventory.set_creative_formspec(player, start_i, start_i / (6*4) + 1)
end)
if minetest.setting_getbool("creative_mode") then
minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",
wield_scale = {x=1,y=1,z=2.5},
tool_capabilities = {
full_punch_interval = 0.5,
max_drop_level = 3,
groupcaps = {
crumbly = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
cracky = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
snappy = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
choppy = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
oddly_breakable_by_hand = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
}
}
})
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)
return true
end)
function minetest.handle_node_drops(pos, drops, digger)
if not digger or not digger:is_player() then
return
end
local inv = digger:get_inventory()
if inv then
for _,item in ipairs(drops) do
item = ItemStack(item):get_name()
if not inv:contains_item("main", item) then
inv:add_item("main", item)
end
end
end
end
end

View File

@ -26,13 +26,13 @@ minetest.register_item(":", {
wield_image = "wieldhand.png",
wield_scale = {x=1,y=1,z=2.5},
tool_capabilities = {
full_punch_interval = 1.0,
full_punch_interval = 0.9,
max_drop_level = 0,
groupcaps = {
fleshy = {times={[2]=2.00, [3]=1.00}, uses=0, maxlevel=1},
fleshy = {times={[2]=0.75, [3]=0.6}, uses=0, maxlevel=1},
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=1.40}, uses=0, maxlevel=3},
oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=1.40}, uses=0, maxlevel=3}
}
}
})
@ -41,9 +41,11 @@ minetest.register_tool("default:pick_wood", {
description = "Wooden Pickaxe",
inventory_image = "default_tool_woodpick.png",
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
cracky={times={[2]=2.00, [3]=1.20}, uses=10, maxlevel=1}
cracky = {times={[2]=2.00, [3]=1.20}, uses=10, maxlevel=1},
fleshy = {times={[2]=0.95, [3]=0.6}, uses=15, maxlevel=1}
}
},
})
@ -51,9 +53,11 @@ minetest.register_tool("default:pick_stone", {
description = "Stone Pickaxe",
inventory_image = "default_tool_stonepick.png",
tool_capabilities = {
full_punch_interval = 1.3,
max_drop_level=0,
groupcaps={
cracky={times={[1]=3.00, [2]=1.20, [3]=0.80}, uses=20, maxlevel=1}
cracky = {times={[1]=3.00, [2]=1.20, [3]=0.80}, uses=20, maxlevel=1},
fleshy = {times={[2]=0.7, [3]=0.5}, uses=25, maxlevel=1}
}
},
})
@ -61,9 +65,11 @@ minetest.register_tool("default:pick_steel", {
description = "Steel Pickaxe",
inventory_image = "default_tool_steelpick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
cracky={times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=30, maxlevel=2}
cracky = {times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=30, maxlevel=2},
fleshy = {times={[2]=0.6, [3]=0.35}, uses=35, maxlevel=1}
}
},
})
@ -71,12 +77,13 @@ minetest.register_tool("default:pick_mese", {
description = "Mese Pickaxe",
inventory_image = "default_tool_mesepick.png",
tool_capabilities = {
full_punch_interval = 1.0,
full_punch_interval = 0.65,
max_drop_level=3,
groupcaps={
cracky={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
crumbly={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
snappy={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3}
cracky = {times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
crumbly = {times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
snappy = {times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
fleshy = {times={[2]=0.6, [3]=0.5}, uses=80, maxlevel=1}
}
},
})
@ -85,9 +92,11 @@ minetest.register_tool("default:shovel_wood", {
inventory_image = "default_tool_woodshovel.png",
wield_image = "default_tool_woodshovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
crumbly={times={[1]=3.00, [2]=0.80, [3]=0.50}, uses=10, maxlevel=1}
crumbly = {times={[1]=3.00, [2]=0.80, [3]=0.50}, uses=10, maxlevel=1},
fleshy = {times={[2]=1.05, [3]=0.70}, uses=25, maxlevel=1}
}
},
})
@ -96,9 +105,11 @@ minetest.register_tool("default:shovel_stone", {
inventory_image = "default_tool_stoneshovel.png",
wield_image = "default_tool_stoneshovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.4,
max_drop_level=0,
groupcaps={
crumbly={times={[1]=1.50, [2]=0.50, [3]=0.30}, uses=20, maxlevel=1}
crumbly = {times={[1]=1.50, [2]=0.50, [3]=0.30}, uses=20, maxlevel=1},
fleshy = {times={[2]=0.75, [3]=0.50}, uses=40, maxlevel=1}
}
},
})
@ -107,9 +118,11 @@ minetest.register_tool("default:shovel_steel", {
inventory_image = "default_tool_steelshovel.png",
wield_image = "default_tool_steelshovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.1,
max_drop_level=1,
groupcaps={
crumbly={times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=30, maxlevel=2}
crumbly = {times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=30, maxlevel=2},
fleshy = {times={[2]=0.45, [3]=0.30}, uses=50, maxlevel=1}
}
},
})
@ -117,10 +130,11 @@ minetest.register_tool("default:axe_wood", {
description = "Wooden Axe",
inventory_image = "default_tool_woodaxe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=0,
groupcaps={
choppy={times={[2]=1.40, [3]=0.80}, uses=10, maxlevel=1},
fleshy={times={[2]=1.50, [3]=0.80}, uses=10, maxlevel=1}
choppy = {times={[2]=1.60, [3]=1.20}, uses=10, maxlevel=1},
fleshy = {times={[2]=0.70, [3]=0.50}, uses=5, maxlevel=1}
}
},
})
@ -128,10 +142,11 @@ minetest.register_tool("default:axe_stone", {
description = "Stone Axe",
inventory_image = "default_tool_stoneaxe.png",
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
choppy={times={[1]=3.00, [2]=1.00, [3]=0.60}, uses=20, maxlevel=1},
fleshy={times={[2]=1.30, [3]=0.70}, uses=20, maxlevel=1}
choppy={times={[1]=3.00, [2]=1.40, [3]=1.00}, uses=20, maxlevel=1},
fleshy={times={[2]=0.60, [3]=0.40}, uses=15, maxlevel=1}
}
},
})
@ -139,10 +154,11 @@ minetest.register_tool("default:axe_steel", {
description = "Steel Axe",
inventory_image = "default_tool_steelaxe.png",
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=1,
groupcaps={
choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=30, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=40, maxlevel=1}
choppy={times={[1]=2.60, [2]=1.00, [3]=0.60}, uses=30, maxlevel=2},
fleshy={times={[2]=0.40, [3]=0.25}, uses=25, maxlevel=1}
}
},
})
@ -150,12 +166,12 @@ minetest.register_tool("default:sword_wood", {
description = "Wooden Sword",
inventory_image = "default_tool_woodsword.png",
tool_capabilities = {
full_punch_interval = 1.0,
full_punch_interval = 0.9,
max_drop_level=0,
groupcaps={
fleshy={times={[2]=1.10, [3]=0.60}, uses=10, maxlevel=1},
snappy={times={[2]=1.00, [3]=0.50}, uses=10, maxlevel=1},
choppy={times={[3]=1.00}, uses=20, maxlevel=0}
snappy={times={[2]=0.9, [3]=0.45}, uses=10, maxlevel=1},
choppy={times={[3]=0.90}, uses=20, maxlevel=0}
}
}
})
@ -163,12 +179,12 @@ minetest.register_tool("default:sword_stone", {
description = "Stone Sword",
inventory_image = "default_tool_stonesword.png",
tool_capabilities = {
full_punch_interval = 1.0,
full_punch_interval = 1.1,
max_drop_level=0,
groupcaps={
fleshy={times={[2]=0.80, [3]=0.40}, uses=20, maxlevel=1},
snappy={times={[2]=0.80, [3]=0.40}, uses=20, maxlevel=1},
choppy={times={[3]=0.90}, uses=20, maxlevel=0}
snappy={times={[2]=0.75, [3]=0.35}, uses=20, maxlevel=1},
choppy={times={[3]=0.70}, uses=20, maxlevel=0}
}
}
})
@ -176,12 +192,12 @@ minetest.register_tool("default:sword_steel", {
description = "Steel Sword",
inventory_image = "default_tool_steelsword.png",
tool_capabilities = {
full_punch_interval = 1.0,
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=40, maxlevel=1},
choppy={times={[3]=0.70}, uses=40, maxlevel=0}
choppy={times={[3]=0.65}, uses=40, maxlevel=0}
}
}
})
@ -259,7 +275,7 @@ minetest.register_craft({
minetest.register_craft({
output = 'default:pick_mese',
recipe = {
{'default:mese', 'default:mese', 'default:mese'},
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
@ -470,6 +486,29 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = 'default:mese',
recipe = {
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
}
})
minetest.register_craft({
output = 'default:mese_crystal 9',
recipe = {
{'default:mese'},
}
})
minetest.register_craft({
output = 'default:mese_crystal_fragment 9',
recipe = {
{'default:mese_crystal'},
}
})
--
-- Crafting (tool repair)
--
@ -564,12 +603,6 @@ minetest.register_craft({
burntime = 7,
})
minetest.register_craft({
type = "fuel",
recipe = "default:mese",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "default:lava_source",
@ -698,7 +731,7 @@ end
function default.node_sound_glass_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_stone_footstep", gain=0.25}
{name="default_hard_footstep", gain=0.25}
table.dug = table.dug or
{name="default_break_glass", gain=1.0}
default.node_sound_defaults(table)
@ -745,6 +778,15 @@ minetest.register_node("default:stone_with_iron", {
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stone_with_mese", {
description = "Mese Crystals in Stone",
tiles = {"default_stone.png^default_mineral_mese.png"},
is_ground_content = true,
groups = {cracky=1},
drop = "default:mese_crystal",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:dirt_with_grass", {
description = "Dirt with Grass",
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
@ -787,7 +829,7 @@ minetest.register_node("default:desert_sand", {
description = "Desert Sand",
tiles = {"default_desert_sand.png"},
is_ground_content = true,
groups = {sand=1, crumbly=3, falling_node=1, sand=1},
groups = {crumbly=3, falling_node=1, sand=1},
sounds = default.node_sound_sand_defaults(),
})
@ -990,14 +1032,6 @@ minetest.register_node("default:wood", {
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:mese", {
description = "Mese",
tiles = {"default_mese.png"},
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_defaults(),
})
minetest.register_node("default:cloud", {
description = "Cloud",
tiles = {"default_cloud.png"},
@ -1029,6 +1063,7 @@ minetest.register_node("default:water_flowing", {
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
liquidtype = "flowing",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
@ -1054,6 +1089,7 @@ minetest.register_node("default:water_source", {
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
liquidtype = "source",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
@ -1085,6 +1121,7 @@ minetest.register_node("default:lava_flowing", {
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
liquidtype = "flowing",
liquid_alternative_flowing = "default:lava_flowing",
liquid_alternative_source = "default:lava_source",
@ -1111,6 +1148,7 @@ minetest.register_node("default:lava_source", {
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
liquidtype = "source",
liquid_alternative_flowing = "default:lava_flowing",
liquid_alternative_source = "default:lava_source",
@ -1243,10 +1281,6 @@ minetest.register_node("default:chest_locked", {
end,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
"size[8,9]"..
"list[current_name;main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "Locked Chest")
meta:set_string("owner", "")
local inv = meta:get_inventory()
@ -1302,6 +1336,16 @@ minetest.register_node("default:chest_locked", {
minetest.log("action", player:get_player_name()..
" takes stuff from locked chest at "..minetest.pos_to_string(pos))
end,
on_rightclick = function(pos, node, clicker)
local meta = minetest.env:get_meta(pos)
if has_locked_chest_privilege(meta, clicker) then
local pos = pos.x .. "," .. pos.y .. "," ..pos.z
minetest.show_formspec(clicker:get_player_name(), "default:chest_locked",
"size[8,9]"..
"list[nodemeta:".. pos .. ";main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
end
end,
})
default.furnace_inactive_formspec =
@ -1515,6 +1559,15 @@ minetest.register_node("default:steelblock", {
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:mese", {
description = "Mese Block",
tiles = {"default_mese_block.png"},
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_alias("default:mese_block", "default:mese")
minetest.register_node("default:nyancat", {
description = "Nyan Cat",
tiles = {"default_nc_side.png", "default_nc_side.png", "default_nc_side.png",
@ -1613,6 +1666,11 @@ minetest.register_craftitem("default:iron_lump", {
inventory_image = "default_iron_lump.png",
})
minetest.register_craftitem("default:mese_crystal", {
description = "Mese Crystal",
inventory_image = "default_mese_crystal.png",
})
minetest.register_craftitem("default:clay_lump", {
description = "Clay Lump",
inventory_image = "default_clay_lump.png",
@ -1623,9 +1681,13 @@ minetest.register_craftitem("default:steel_ingot", {
inventory_image = "default_steel_ingot.png",
})
minetest.register_craftitem("default:mese_crystal_fragment", {
description = "Mese Crystal Fragment",
inventory_image = "default_mese_crystal_fragment.png",
})
minetest.register_craftitem("default:clay_brick", {
description = "Clay Brick",
inventory_image = "default_steel_ingot.png",
inventory_image = "default_clay_brick.png",
})
@ -1675,4 +1737,3 @@ end
minetest.register_on_punchnode(on_punchnode)
-- END

View File

@ -86,6 +86,7 @@ minetest.register_abm({
end
-- Remove node
minetest.env:remove_node(p0)
nodeupdate(p0)
end
end
})

View File

@ -29,7 +29,7 @@ minetest.register_alias("mapgen_desert_stone", "default:desert_stone")
-- Ore generation
--
local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
function default.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
if maxp.y < height_min or minp.y > height_max then
return
end
@ -142,15 +142,17 @@ end
minetest.register_on_generated(function(minp, maxp, seed)
-- Generate regular ores
generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+0, 1/8/8/8, 3, 8, -31000, 64)
generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+1, 1/12/12/12, 2, 3, -15, 2)
generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+2, 1/9/9/9, 3, 5, -63, -16)
generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+3, 1/7/7/7, 3, 5, -31000, -64)
generate_ore("default:mese", "default:stone", minp, maxp, seed+4, 1/16/16/16, 2, 3, -127, -64)
generate_ore("default:mese", "default:stone", minp, maxp, seed+5, 1/9/9/9, 3, 5, -31000,-128)
default.generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+0, 1/8/8/8, 3, 8, -31000, 64)
default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+1, 1/12/12/12, 2, 3, -15, 2)
default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+2, 1/9/9/9, 3, 5, -63, -16)
default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+3, 1/7/7/7, 3, 5, -31000, -64)
generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+7, 1/24/24/24, 6,27, -31000, 0)
generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+6, 1/24/24/24, 6,27, -31000, -64)
default.generate_ore("default:stone_with_mese", "default:stone", minp, maxp, seed+4, 1/16/16/16, 2, 3, -127, -64)
default.generate_ore("default:stone_with_mese", "default:stone", minp, maxp, seed+5, 1/9/9/9, 3, 5, -31000, -128)
default.generate_ore("default:mese", "default:stone", minp, maxp, seed+8, 1/16/16/16, 2, 3, -31000,-1024)
default.generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+7, 1/24/24/24, 6,27, -31000, 0)
default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+6, 1/24/24/24, 6,27, -31000, -64)
if maxp.y >= 2 and minp.y <= 0 then
-- Generate clay
@ -246,7 +248,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
end
end
end
-- Generate dry shrubs
-- Generate grass
local perlin1 = minetest.env:get_perlin(329, 3, 0.6, 100)
-- Assume X and Z lengths are equal
local divlen = 16
@ -257,11 +259,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
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 dry shrubs amount from perlin noise
local shrub_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 5 + 0)
-- Find random positions for dry shrubs based on this random
-- Determine grass amount from perlin noise
local grass_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 5 + 0)
-- Find random positions for grass based on this random
local pr = PseudoRandom(seed+1)
for i=0,shrub_amount do
for i=0,grass_amount do
local x = pr:next(x0, x1)
local z = pr:next(z0, z1)
-- Find ground level (0...15)
@ -272,15 +274,25 @@ minetest.register_on_generated(function(minp, maxp, seed)
break
end
end
-- If desert sand, make dry shrub
if ground_y and minetest.env:get_node({x=x,y=ground_y,z=z}).name == "default:desert_sand" then
if ground_y then
local p = {x=x,y=ground_y+1,z=z}
local nn = minetest.env:get_node(p).name
-- Check if the node can be replaced
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
minetest.env:set_node(p, {name="default:dry_shrub"})
nn = minetest.env:get_node({x=x,y=ground_y,z=z}).name
-- If desert sand, make dry shrub
if nn == "default:desert_sand" then
minetest.env:set_node(p,{name="default:dry_shrub"})
-- If grass, make junglegrass
elseif nn == "default:dirt_with_grass" then
minetest.env:set_node(p,{name="default:junglegrass"})
end
end
end
end
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

View File

Before

Width:  |  Height:  |  Size: 769 B

After

Width:  |  Height:  |  Size: 769 B

View File

Before

Width:  |  Height:  |  Size: 714 B

After

Width:  |  Height:  |  Size: 714 B

View File

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 628 B

View File

Before

Width:  |  Height:  |  Size: 613 B

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

View File

Before

Width:  |  Height:  |  Size: 744 B

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

View File

Before

Width:  |  Height:  |  Size: 794 B

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

View File

Before

Width:  |  Height:  |  Size: 772 B

After

Width:  |  Height:  |  Size: 772 B

View File

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

View File

Before

Width:  |  Height:  |  Size: 988 B

After

Width:  |  Height:  |  Size: 988 B

View File

Before

Width:  |  Height:  |  Size: 507 B

After

Width:  |  Height:  |  Size: 507 B

Some files were not shown because too many files have changed in this diff Show More