1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-06-28 06:11:47 +02:00

MinetestForFun Game : Update all (but doors)

- Everything is updated, except doors
 - Some textures are moved to other mods (removed from default, but still used by those mods)
This commit is contained in:
LeMagnesium
2016-04-09 21:56:43 +02:00
parent 9a649b77f0
commit de031dddf1
79 changed files with 1673 additions and 1348 deletions

View File

@ -27,7 +27,6 @@ Cisoun's WTFPL texture pack:
default_lava.png
default_leaves.png
default_sapling.png
default_sign_wall.png
default_stone.png
default_tree.png
default_tree_top.png
@ -59,7 +58,6 @@ VanessaE (WTFPL):
default_desert_sand.png
default_desert_stone.png
default_sand.png
default_jungletree_top.png
Calinou (CC BY-SA):
default_brick.png
@ -100,28 +98,29 @@ Zeg9 (CC BY-SA 3.0):
default_gold_block.png
paramat (CC BY-SA 3.0):
wieldhand.png, derived from character.png by Jordach (CC BY-SA 3.0)
wieldhand.png copied from character.png by Jordach (CC BY-SA 3.0)
default_pinetree.png
default_pinetree_top.png
default_pinewood.png
default_sandstone_brick.png
default_obsidian_brick.png
default_river_water.png
default_river_water_source_animated.png
default_river_water_flowing_animated.png
default_acacia_leaves.png
default_acacia_sapling.png
default_acacia_tree.png
default_acacia_tree_top.png
default_acacia_wood.png
default_junglewood.png
default_jungletree_top.png
default_sandstone_brick.png
default_obsidian_brick.png
default_stone_brick.png
default_desert_stone_brick.png
default_river_water.png
default_river_water_source_animated.png
default_river_water_flowing_animated.png
default_dry_grass.png
default_dry_grass_side.png
default_dry_grass_*.png
default_junglewood.png, derived from a texture by BlockMen (CC BY-SA 3.0)
default_grass.png, derived from a texture by Philipbenr (CC BY-SA 3.0)
default_grass_side.png, derived from a texture by Philipbenr (CC BY-SA 3.0)
default_stone_brick.png, derived from a texture by Cisoun (WTFPL)
default_desert_stone_brick.png, derived from a texture by VanessaE (WTFPL)
default_grass.png
default_grass_side.png
brunob.santos (CC BY-SA 4.0):
default_desert_cobble.png
@ -156,6 +155,9 @@ sofar (CC BY-SA 3.0):
default_aspen_tree_top, derived from default_pine_tree_top (by paramat)
default_aspen_wood, derived from default_pine_wood (by paramat)
sofar (WTFPL):
default_gravel.png -- Derived from Gambit's PixelBOX texture pack light gravel
Neuromancer (CC BY-SA 2.0):
default_cobble.png, based on texture by Brane praefect
default_mossycobble.png, based on texture by Brane praefect
@ -174,6 +176,9 @@ Gambit (WTFPL):
default_grass_*.png
default_paper.png
default_diamond_block.png
default_ladder_steel.png
default_sign_wall_wood.png
default_flint.png
asl97 (WTFPL):
default_ice.png

View File

@ -23,7 +23,7 @@ minetest.register_alias("bookshelf", "default:bookshelf")
minetest.register_alias("glass", "default:glass")
minetest.register_alias("wooden_fence", "default:fence_wood")
minetest.register_alias("rail", "default:rail")
minetest.register_alias("ladder", "default:ladder")
minetest.register_alias("ladder", "default:ladder_wood")
minetest.register_alias("wood", "default:wood")
minetest.register_alias("mese", "default:mese")
minetest.register_alias("cloud", "default:cloud")
@ -32,7 +32,7 @@ minetest.register_alias("water_source", "default:water_source")
minetest.register_alias("lava_flowing", "default:lava_flowing")
minetest.register_alias("lava_source", "default:lava_source")
minetest.register_alias("torch", "default:torch")
minetest.register_alias("sign_wall", "default:sign_wall")
minetest.register_alias("sign_wall", "default:sign_wall_wood")
minetest.register_alias("furnace", "default:furnace")
minetest.register_alias("chest", "default:chest")
minetest.register_alias("locked_chest", "default:chest_locked")
@ -68,9 +68,13 @@ minetest.register_alias("steel_ingot", "default:steel_ingot")
minetest.register_alias("clay_brick", "default:clay_brick")
minetest.register_alias("snow", "default:snow")
-- 'mese_block' was used for a while for the block form of mese
minetest.register_alias("default:mese_block", "default:mese")
-- Aliases for corrected pine node names
minetest.register_alias("default:pinetree", "default:pine_tree")
minetest.register_alias("default:pinewood", "default:pine_wood")
-- Mese now comes in the form of blocks, ore, crystal and fragments
minetest.register_alias("default:mese", "default:mese_block")
minetest.register_alias("default:ladder", "default:ladder_wood")
minetest.register_alias("default:sign_wall", "default:sign_wall_wood")

View File

@ -50,48 +50,16 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'default:fence_wood 2',
output = 'default:sign_wall_steel 3',
recipe = {
{'default:stick', 'default:stick', 'default:stick'},
{'default:stick', 'default:stick', 'default:stick'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'', 'group:stick', ''},
}
})
minetest.register_craft({
output = "default:fence_cobble 16",
recipe = {
{"default:cobble", "default:cobble", "default:cobble"},
{"default:cobble", "default:cobble", "default:cobble"},
}
})
minetest.register_craft({
output = "default:fence_desert_cobble 16",
recipe = {
{"default:desert_cobble", "default:desert_cobble", "default:desert_cobble"},
{"default:desert_cobble", "default:desert_cobble", "default:desert_cobble"},
}
})
minetest.register_craft({
output = "default:fence_steelblock 16",
recipe = {
{"default:steelblock", "default:steelblock", "default:steelblock"},
{"default:steelblock", "default:steelblock", "default:steelblock"},
}
})
minetest.register_craft({
output = "default:fence_brick 16",
recipe = {
{"default:brick", "default:brick", "default:brick"},
{"default:brick", "default:brick", "default:brick"},
}
})
minetest.register_craft({
output = 'default:sign_wall',
output = 'default:sign_wall_wood 3',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:wood', 'group:wood', 'group:wood'},
@ -100,7 +68,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'default:torch 5',
output = 'default:torch 4',
recipe = {
{'default:coal_lump'},
{'group:stick'},
@ -468,20 +436,11 @@ minetest.register_craft({ -- Ultimate Warrior weapon
})
minetest.register_craft({
output = "default:sword_nyan",
recipe = {
{"default:nyancat"},
{"default:nyancat"},
{"group:stick"},
}
})
minetest.register_craft({
output = 'default:rail 16',
output = 'default:rail 24',
recipe = {
{'default:steel_ingot', '', 'default:steel_ingot'},
{'default:steel_ingot', 'group:stick', 'default:steel_ingot'},
{'default:steel_ingot', 'group:stick', 'default:steel_ingot'},
{'default:steel_ingot', 'group:stick', 'default:steel_ingot'},
{'default:steel_ingot', '', 'default:steel_ingot'},
}
})
@ -498,7 +457,7 @@ minetest.register_craft({
output = 'default:chest_locked',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:wood', 'group:ingot', 'group:wood'},
{'group:wood', 'default:steel_ingot', 'group:wood'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
@ -644,44 +603,9 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'default:sand',
output = 'default:sand 4',
recipe = {
{'default:desert_sand'},
}
})
minetest.register_craft({
output = "default:desert_sand",
recipe = {
{"default:sand"},
}
})
minetest.register_craft({
output = "default:desert_stone 2",
recipe = {
{"default:desert_sand", "default:desert_sand"},
{"default:desert_sand", "default:desert_sand"},
}
})
minetest.register_craft({
output = "default:sand",
recipe = {
{"default:gravel"},
}
})
minetest.register_craft({
output = "default:dirt 4",
type = "shapeless",
recipe = {"default:gravel", "default:gravel", "default:gravel", "default:gravel"}
})
minetest.register_craft({
output = "default:gravel",
recipe = {
{"default:cobble"},
{'default:sandstone'},
}
})
@ -693,56 +617,71 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = "default:clay",
output = "default:desert_sand",
recipe = {
{"default:clay_lump", "default:clay_lump", "default:clay_lump"},
{"default:clay_lump", "default:clay_lump", "default:clay_lump"},
{"default:clay_lump", "default:clay_lump", "default:clay_lump"},
{"default:sand"},
}
})
minetest.register_craft({
output = 'default:clay',
recipe = {
{'default:clay_lump', 'default:clay_lump'},
{'default:clay_lump', 'default:clay_lump'},
}
})
minetest.register_craft({
output = 'default:clay_lump 4',
recipe = {
{'default:clay'},
}
})
minetest.register_craft({
output = 'default:brick',
recipe = {
{"default:clay_brick", "default:clay_brick", "default:clay_brick"},
{"default:clay_brick", "default:clay_brick", "default:clay_brick"},
{"default:clay_brick", "default:clay_brick", "default:clay_brick"},
{'default:clay_brick', 'default:clay_brick'},
{'default:clay_brick', 'default:clay_brick'},
}
})
minetest.register_craft({
output = 'default:clay_brick 9',
output = 'default:clay_brick 4',
recipe = {
{'default:brick'},
}
})
minetest.register_craft({
output = "default:clay_lump 9",
recipe = {{"default:clay"},}
output = 'default:paper',
recipe = {
{'default:papyrus', 'default:papyrus', 'default:papyrus'},
}
})
minetest.register_craft({
type = "shapeless",
output = 'default:paper 4',
recipe = {'default:papyrus', 'default:papyrus', 'default:papyrus'},
})
minetest.register_craft({
type = "shapeless",
output = 'default:book',
recipe = {'default:paper', 'default:paper', 'default:paper'}
recipe = {
{'default:paper'},
{'default:paper'},
{'default:paper'},
}
})
minetest.register_craft({
type = "shapeless",
output = 'default:bookshelf',
recipe = {'group:wood', 'group:wood', 'group:wood', 'default:book', 'default:book', 'default:book', 'group:wood', 'group:wood', 'group:wood'}
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'default:book', 'default:book', 'default:book'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
minetest.register_craft({
output = 'default:ladder 3',
output = 'default:ladder_wood 3',
recipe = {
{'group:stick', '', 'group:stick'},
{'group:stick', 'group:stick', 'group:stick'},
@ -750,6 +689,15 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = 'default:ladder_steel 15',
recipe = {
{'default:steel_ingot', '', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', '', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'default:mese',
recipe = {
@ -773,6 +721,35 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = "default:sand",
recipe = {
{"default:gravel"},
}
})
minetest.register_craft({
output = "default:dirt 4",
type = "shapeless",
recipe = {"default:gravel", "default:gravel", "default:gravel", "default:gravel"}
})
minetest.register_craft({
output = "default:gravel",
recipe = {
{"default:cobble"},
}
})
minetest.register_craft({
output = "default:desert_stone 2",
recipe = {
{"default:desert_sand", "default:desert_sand"},
{"default:desert_sand", "default:desert_sand"},
}
})
minetest.register_craft({
output = 'default:meselamp 1',
recipe = {
@ -798,7 +775,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'default:obsidianbrick 2',
output = 'default:obsidianbrick 4',
recipe = {
{'default:obsidian', 'default:obsidian'},
{'default:obsidian', 'default:obsidian'}
@ -833,13 +810,14 @@ minetest.register_craft({
minetest.register_craft({
output = 'default:snowblock',
recipe = {
{'default:snow', 'default:snow'},
{'default:snow', 'default:snow'},
{'default:snow', 'default:snow', 'default:snow'},
{'default:snow', 'default:snow', 'default:snow'},
{'default:snow', 'default:snow', 'default:snow'},
}
})
minetest.register_craft({
output = 'default:snow 4',
output = 'default:snow 9',
recipe = {
{'default:snowblock'},
}
@ -856,7 +834,7 @@ minetest.register_craft({
--
minetest.register_craft({
type = "toolrepair",
additional_wear = -0.15,
additional_wear = -0.02,
})
--
@ -878,13 +856,13 @@ minetest.register_craft({
minetest.register_craft({
type = "cooking",
output = "default:stone",
recipe = "default:mossycobble",
recipe = "default:cobble",
})
minetest.register_craft({
type = "cooking",
output = "default:stone",
recipe = "default:cobble",
recipe = "default:mossycobble",
})
minetest.register_craft({
@ -978,7 +956,31 @@ minetest.register_craft({
minetest.register_craft({
type = "fuel",
recipe = "default:ladder",
recipe = "default:fence_acacia_wood",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "default:fence_junglewood",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "default:fence_pine_wood",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "default:fence_aspen_wood",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "default:ladder_wood",
burntime = 3,
})
@ -1002,7 +1004,7 @@ minetest.register_craft({
minetest.register_craft({
type = "fuel",
recipe = "default:sign_wall",
recipe = "default:sign_wall_wood",
burntime = 15,
})

View File

@ -4,89 +4,132 @@ minetest.register_craftitem("default:stick", {
description = "Stick",
stack_max = 1000,
inventory_image = "default_stick.png",
wield_image = "default_stick.png^[transformR90",
groups = {stick=1},
groups = {stick = 1},
})
minetest.register_craftitem("default:paper", {
description = "Paper",
wield_scale = {x = 1, y = 1, z = 0.25},
inventory_image = "default_paper.png",
})
local function book_on_use(itemstack, user, pointed_thing)
local function book_on_use(itemstack, user)
local player_name = user:get_player_name()
local data = minetest.deserialize(itemstack:get_metadata())
local title, text, owner = "", "", player_name
local formspec, title, text, owner = "", "", "", player_name
local page, page_max, cpp = 1, 1, 650
if data then
title, text, owner = data.title, data.text, data.owner
title = data.title
text = data.text
owner = data.owner
if data.page then
page = data.page
page_max = data.page_max
cpp = data.chars_per_page
end
end
local formspec
if owner == player_name then
formspec = "size[8,8]"..default.gui_bg..
"field[0.5,1;7.5,0;title;Title:;"..
minetest.formspec_escape(title).."]"..
"textarea[0.5,1.5;7.5,7;text;Contents:;"..
minetest.formspec_escape(text).."]"..
formspec = "size[8,8]" .. default.gui_bg ..
default.gui_bg_img ..
"field[0.5,1;7.5,0;title;Title:;" ..
minetest.formspec_escape(title) .. "]" ..
"textarea[0.5,1.5;7.5,7;text;Contents:;" ..
minetest.formspec_escape(text) .. "]" ..
"button_exit[2.5,7.5;3,1;save;Save]"
else
formspec = "size[8,8]"..default.gui_bg..
"label[0.5,0.5;by "..owner.."]"..
"label[0.5,0;"..minetest.formspec_escape(title).."]"..
"tableoptions[background=#00000000;highlight=#00000000;border=false]"..
"table[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text):gsub("\n", ",")..";1]"
formspec = "size[8,8]" .. default.gui_bg ..
default.gui_bg_img ..
"label[0.5,0.5;by " .. owner .. "]" ..
"tablecolumns[color;text]" ..
"tableoptions[background=#00000000;highlight=#00000000;border=false]" ..
"table[0.4,0;7,0.5;title;#FFFF00," .. minetest.formspec_escape(title) .. "]" ..
"textarea[0.5,1.5;7.5,7;;" .. minetest.formspec_escape(text:sub(
(cpp * page) - cpp, cpp * page)) .. ";]" ..
"button[2.4,7.6;0.8,0.8;book_prev;<]" ..
"label[3.2,7.7;Page " .. page .. " of " .. page_max .. "]" ..
"button[4.9,7.6;0.8,0.8;book_next;>]"
end
minetest.show_formspec(user:get_player_name(), "default:book", formspec)
minetest.show_formspec(player_name, "default:book", formspec)
end
minetest.register_on_player_receive_fields(function(player, form_name, fields)
if form_name ~= "default:book" or not fields.save or
fields.title == "" or fields.text == "" then
return
end
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "default:book" then return end
local inv = player:get_inventory()
local stack = player:get_wielded_item()
local new_stack, data
if stack:get_name() ~= "default:book_written" then
local count = stack:get_count()
if count == 1 then
stack:set_name("default:book_written")
if fields.save and fields.title ~= "" and fields.text ~= "" then
local new_stack, data
if stack:get_name() ~= "default:book_written" then
local count = stack:get_count()
if count == 1 then
stack:set_name("default:book_written")
else
stack:set_count(count - 1)
new_stack = ItemStack("default:book_written")
end
else
stack:set_count(count - 1)
new_stack = ItemStack("default:book_written")
data = minetest.deserialize(stack:get_metadata())
end
else
data = minetest.deserialize(stack:get_metadata())
end
if not data then data = {} end
data.title = fields.title
data.text = fields.text
data.owner = player:get_player_name()
local data_str = minetest.serialize(data)
if new_stack then
new_stack:set_metadata(data_str)
if inv:room_for_item("main", new_stack) then
inv:add_item("main", new_stack)
if not data then data = {} end
data.title = fields.title
data.text = fields.text
data.text_len = fields.text:len()
data.page = 1
data.chars_per_page = 650
data.page_max = math.ceil(data.text_len / data.chars_per_page)
data.owner = player:get_player_name()
local data_str = minetest.serialize(data)
if new_stack then
new_stack:set_metadata(data_str)
if inv:room_for_item("main", new_stack) then
inv:add_item("main", new_stack)
else
minetest.add_item(player:getpos(), new_stack)
end
else
minetest.add_item(player:getpos(), new_stack)
stack:set_metadata(data_str)
end
else
player:set_wielded_item(stack)
elseif fields.book_next or fields.book_prev then
local data = minetest.deserialize(stack:get_metadata())
if not data.page then return end
if fields.book_next then
data.page = data.page + 1
if data.page > data.page_max then
data.page = 1
end
else
data.page = data.page - 1
if data.page == 0 then
data.page = data.page_max
end
end
local data_str = minetest.serialize(data)
stack:set_metadata(data_str)
book_on_use(stack, player)
end
player:set_wielded_item(stack)
end)
minetest.register_craftitem("default:book", {
description = "Book",
inventory_image = "default_book.png",
groups = {book=1},
groups = {book = 1},
on_use = book_on_use,
})
minetest.register_craftitem("default:book_written", {
description = "Book With Text",
inventory_image = "default_book_written.png",
groups = {book=1, not_in_creative_inventory=1},
groups = {book = 1, not_in_creative_inventory = 1},
stack_max = 1,
on_use = book_on_use,
})
@ -94,7 +137,7 @@ minetest.register_craftitem("default:book_written", {
minetest.register_craft({
type = "shapeless",
output = "default:book_written",
recipe = { "default:book", "default:book_written" }
recipe = {"default:book", "default:book_written"}
})
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
@ -123,23 +166,18 @@ end)
minetest.register_craftitem("default:coal_lump", {
description = "Coal Lump",
wield_scale = {x = 1, y = 1, z = 2},
inventory_image = "default_coal_lump.png",
groups = {coal = 1}
})
minetest.register_craftitem("default:iron_lump", {
description = "Iron Lump",
wield_scale = {x = 1, y = 1, z = 2},
inventory_image = "default_iron_lump.png",
groups = {ingot_lump = 1},
})
minetest.register_craftitem("default:copper_lump", {
description = "Copper Lump",
wield_scale = {x = 1, y = 1, z = 2},
inventory_image = "default_copper_lump.png",
groups = {ingot_lump = 1},
})
minetest.register_craftitem("default:mese_crystal", {
@ -149,9 +187,7 @@ minetest.register_craftitem("default:mese_crystal", {
minetest.register_craftitem("default:gold_lump", {
description = "Gold Lump",
wield_scale = {x = 1, y = 1, z = 2},
inventory_image = "default_gold_lump.png",
groups = {ingot_lump = 1},
})
minetest.register_craftitem("default:diamond", {
@ -162,34 +198,29 @@ minetest.register_craftitem("default:diamond", {
minetest.register_craftitem("default:clay_lump", {
description = "Clay Lump",
stack_max = 200,
wield_scale = {x = 1, y = 1, z = 2},
inventory_image = "default_clay_lump.png",
})
minetest.register_craftitem("default:steel_ingot", {
description = "Steel Ingot",
wield_scale = {x = 1, y = 1, z = 2},
inventory_image = "default_steel_ingot.png",
groups = {ingot = 1},
})
minetest.register_craftitem("default:copper_ingot", {
description = "Copper Ingot",
wield_scale = {x = 1, y = 1, z = 2},
inventory_image = "default_copper_ingot.png",
groups = {ingot = 1},
})
minetest.register_craftitem("default:bronze_ingot", {
description = "Bronze Ingot",
wield_scale = {x = 1, y = 1, z = 2},
inventory_image = "default_bronze_ingot.png",
groups = {ingot = 1},
})
minetest.register_craftitem("default:gold_ingot", {
description = "Gold Ingot",
wield_scale = {x = 1, y = 1, z = 2},
groups = {ingot = 1},
inventory_image = "default_gold_ingot.png"
})
@ -201,7 +232,6 @@ minetest.register_craftitem("default:mese_crystal_fragment", {
minetest.register_craftitem("default:clay_brick", {
description = "Clay Brick",
wield_scale = {x = 1, y = 1, z = 2},
inventory_image = "default_clay_brick.png",
})
@ -214,3 +244,9 @@ minetest.register_craftitem("default:obsidian_shard", {
description = "Obsidian Shard",
inventory_image = "default_obsidian_shard.png",
})
minetest.register_craftitem("default:flint", {
description = "Flint",
inventory_image = "default_flint.png"
})

View File

@ -7,40 +7,20 @@
function default.node_sound_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_hard_footstep", gain = 0.6}
table.dig = table.dig or
{name = "default_hard_footstep", gain = 0.7}
{name = "", gain = 1.0}
table.dug = table.dug or
{name = "default_hard_footstep", gain = 0.8}
{name = "default_dug_node", gain = 0.25}
table.place = table.place or
{name = "default_hard_footstep", gain = 0.8}
{name = "default_place_node_hard", gain = 1.0}
return table
end
function default.node_sound_stone_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_hard_footstep", gain = 0.6}
table.dig = table.dig or
{name = "default_hard_footstep", gain = 0.7}
{name = "default_hard_footstep", gain = 0.5}
table.dug = table.dug or
{name = "default_hard_footstep", gain = 0.8}
table.place = table.place or
{name = "default_hard_footstep", gain = 0.8}
default.node_sound_defaults(table)
return table
end
function default.node_sound_metal_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_metal_footstep", gain = 0.575}
table.dig = table.dig or
{name = "default_metal_footstep", gain = 0.65}
table.dug = table.dug or
{name = "default_metal_footstep", gain = 0.8}
table.place = table.place or
{name = "default_metal_footstep", gain = 0.8}
{name = "default_hard_footstep", gain = 1.0}
default.node_sound_defaults(table)
return table
end
@ -48,27 +28,11 @@ end
function default.node_sound_dirt_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_dirt_footstep", gain = 0.8}
table.dig = table.dig or
{name = "default_dirt_footstep", gain = 0.9}
{name = "default_dirt_footstep", gain = 1.0}
table.dug = table.dug or
{name = "default_dirt_footstep", gain = 1.0}
{name = "default_dirt_footstep", gain = 1.5}
table.place = table.place or
{name = "default_dirt_footstep", gain = 1.0}
default.node_sound_defaults(table)
return table
end
function default.node_sound_gravel_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_dirt_footstep", gain = 0.8}
table.dig = table.dig or
{name = "default_dirt_footstep", gain = 0.9}
table.dug = table.dug or
{name = "default_dirt_footstep", gain = 1.0}
table.place = table.place or
{name = "default_dirt_footstep", gain = 1.0}
{name = "default_place_node", gain = 1.0}
default.node_sound_defaults(table)
return table
end
@ -76,13 +40,11 @@ end
function default.node_sound_sand_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_sand_footstep", gain = 0.6}
table.dig = table.dig or
{name = "default_sand_footstep", gain = 0.7}
{name = "default_sand_footstep", gain = 0.12}
table.dug = table.dug or
{name = "default_sand_footstep", gain = 0.8}
{name = "default_sand_footstep", gain = 0.24}
table.place = table.place or
{name = "default_sand_footstep", gain = 0.8}
{name = "default_place_node", gain = 1.0}
default.node_sound_defaults(table)
return table
end
@ -90,13 +52,9 @@ end
function default.node_sound_wood_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_wood_footstep", gain = 0.625}
table.dig = table.dig or
{name = "default_wood_footstep", gain = 0.7}
{name = "default_wood_footstep", gain = 0.5}
table.dug = table.dug or
{name = "default_wood_footstep", gain = 0.8}
table.place = table.place or
{name = "default_wood_footstep", gain = 0.8}
{name = "default_wood_footstep", gain = 1.0}
default.node_sound_defaults(table)
return table
end
@ -104,13 +62,13 @@ end
function default.node_sound_leaves_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_grass_footstep", gain = 0.6}
table.dig = table.dig or
{name = "default_grass_footstep", gain = 0.7}
{name = "default_grass_footstep", gain = 0.35}
table.dug = table.dug or
{name = "default_snow_footstep", gain = 0.8}
{name = "default_grass_footstep", gain = 0.7}
table.dig = table.dig or
{name = "default_dig_crumbly", gain = 0.4}
table.place = table.place or
{name = "default_snow_footstep", gain = 0.8}
{name = "default_place_node", gain = 1.0}
default.node_sound_defaults(table)
return table
end
@ -118,13 +76,9 @@ end
function default.node_sound_glass_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_hard_footstep", gain = 0.55}
table.dig = table.dig or
{name = "default_hard_footstep", gain = 0.65}
{name = "default_glass_footstep", gain = 0.5}
table.dug = table.dug or
{name = "default_break_glass", gain = 0.8}
table.place = table.place or
{name = "default_hard_footstep", gain = 0.75}
{name = "default_break_glass", gain = 1.0}
default.node_sound_defaults(table)
return table
end
@ -134,67 +88,24 @@ end
-- Lavacooling
--
local function cool_wf_vm(pos, node1, node2)
local t1 = os.clock()
local minp = vector.subtract(pos, 10)
local maxp = vector.add(pos, 10)
local manip = minetest.get_voxel_manip()
local emerged_pos1, emerged_pos2 = manip:read_from_map(minp, maxp)
local area = VoxelArea:new({MinEdge=emerged_pos1, MaxEdge=emerged_pos2})
local nodes = manip:get_data()
local stone = minetest.get_content_id(node2)
local lava = minetest.get_content_id(node1)
for i in area:iterp(minp, maxp) do
local p = area:position(i)
if nodes[i] == lava and minetest.find_node_near(p, 1, {"group:water"}) then
nodes[i] = stone
end
default.cool_lava = function(pos, node)
if node.name == "default:lava_source" then
minetest.set_node(pos, {name = "default:obsidian"})
else -- Lava flowing
minetest.set_node(pos, {name = "default:stone"})
end
manip:set_data(nodes)
manip:write_to_map()
-- minetest.log("action", "Lava cooling happened at (" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ").")
local t1 = os.clock()
manip:update_map()
-- minetest.log("action", string.format("Lava cooling updated the map after ca. %.2fs.", os.clock() - t1))
end
local del1 = 0
local count = 0
default.cool_lava_source = function(pos)
minetest.set_node(pos, {name = "default:obsidian"})
minetest.sound_play("default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.25})
end
default.cool_lava_flowing = function(pos)
minetest.set_node(pos, {name = "default:stone"})
minetest.sound_play("default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.25})
end
minetest.register_abm({
nodenames = {"default:lava_flowing"},
nodenames = {"default:lava_source", "default:lava_flowing"},
neighbors = {"group:water"},
interval = 1,
chance = 2,
chance = 1,
catch_up = false,
action = function(...)
default.cool_lava_flowing(...)
end,
})
minetest.register_abm({
nodenames = {"default:lava_source"},
neighbors = {"group:water"},
interval = 1,
chance = 2,
catch_up = false,
action = function(...)
default.cool_lava_source(...)
default.cool_lava(...)
end,
})
@ -254,8 +165,8 @@ end
minetest.register_abm({
nodenames = {"default:cactus"},
neighbors = {"group:sand", "default:dirt_with_dry_grass"}, --MFF
interval = 60,
chance = 25,
interval = 12,
chance = 83,
action = function(...)
default.grow_cactus(...)
end
@ -264,8 +175,8 @@ minetest.register_abm({
minetest.register_abm({
nodenames = {"default:papyrus"},
neighbors = {"default:dirt", "default:dirt_with_grass", "default:sand", "default:desert_sand"}, --MFF
interval = 60,
chance = 25,
interval = 14,
chance = 71,
action = function(...)
default.grow_papyrus(...)
end
@ -286,6 +197,62 @@ function default.dig_up(pos, node, digger)
end
--
-- Fence registration helper
--
function default.register_fence(name, def)
minetest.register_craft({
output = name .. " 4",
recipe = {
{ def.material, 'group:stick', def.material },
{ def.material, 'group:stick', def.material },
}
})
local fence_texture = "default_fence_overlay.png^" .. def.texture ..
"^default_fence_overlay.png^[makealpha:255,126,126"
-- Allow almost everything to be overridden
local default_fields = {
paramtype = "light",
drawtype = "nodebox",
node_box = {
type = "connected",
fixed = {{-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}},
-- connect_top =
-- connect_bottom =
connect_front = {{-1/16,3/16,-1/2,1/16,5/16,-1/8},
{-1/16,-5/16,-1/2,1/16,-3/16,-1/8}},
connect_left = {{-1/2,3/16,-1/16,-1/8,5/16,1/16},
{-1/2,-5/16,-1/16,-1/8,-3/16,1/16}},
connect_back = {{-1/16,3/16,1/8,1/16,5/16,1/2},
{-1/16,-5/16,1/8,1/16,-3/16,1/2}},
connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16},
{1/8,-5/16,-1/16,1/2,-3/16,1/16}},
},
connects_to = {"group:fence", "group:wood", "group:tree"},
inventory_image = fence_texture,
wield_image = fence_texture,
tiles = {def.texture},
sunlight_propagates = true,
is_ground_content = false,
groups = {},
}
for k, v in pairs(default_fields) do
if not def[k] then
def[k] = v
end
end
-- Always add to the fence group, even if no group provided
def.groups.fence = 1
def.texture = nil
def.material = nil
minetest.register_node(name, def)
end
--
-- Leafdecay
--
@ -302,17 +269,19 @@ minetest.register_globalstep(function(dtime)
end)
default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
local node = minetest.get_node(pos)
node.param2 = 1
minetest.set_node(pos, node)
if placer and not placer:get_player_control().sneak then
local node = minetest.get_node(pos)
node.param2 = 1
minetest.set_node(pos, node)
end
end
minetest.register_abm({
nodenames = {"group:leafdecay"},
neighbors = {"air", "group:liquid"},
-- A low interval and a high inverse chance spreads the load
interval = 1,
chance = 2,
interval = 2,
chance = 5,
action = function(p0, node, _, _)
--print("leafdecay ABM at "..p0.x..", "..p0.y..", "..p0.z..")")
@ -399,14 +368,15 @@ minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack
end)
--
-- Grass growing
-- Grass growing on well-lit dirt
--
minetest.register_abm({
nodenames = {"default:dirt"},
neighbors = {"air"},
interval = 6,
chance = 67,
catch_up = false,
interval = 30,
chance = 5,
action = function(pos, node)
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
local name = minetest.get_node(above).name
@ -431,8 +401,8 @@ minetest.register_abm({
minetest.register_abm({
nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_grass"},
interval = 2,
chance = 20,
interval = 8,
chance = 50,
catch_up = false,
action = function(pos, node)
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
@ -454,7 +424,7 @@ minetest.register_abm({
minetest.register_abm({
nodenames = {"default:cobble"},
neighbors = {"group:water"},
interval = 17,
interval = 16,
chance = 200,
catch_up = false,
action = function(pos, node)

View File

@ -4,7 +4,7 @@
--
local function active_formspec(fuel_percent, item_percent)
local formspec =
local formspec =
"size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
@ -90,6 +90,137 @@ local function allow_metadata_inventory_take(pos, listname, index, stack, player
return stack:get_count()
end
local function swap_node(pos, name)
local node = minetest.get_node(pos)
if node.name == name then
return
end
node.name = name
minetest.swap_node(pos, node)
end
local function furnace_node_timer(pos, elapsed)
--
-- Inizialize metadata
--
local meta = minetest.get_meta(pos)
local fuel_time = meta:get_float("fuel_time") or 0
local src_time = meta:get_float("src_time") or 0
local fuel_totaltime = meta:get_float("fuel_totaltime") or 0
local inv = meta:get_inventory()
local srclist = inv:get_list("src")
local fuellist = inv:get_list("fuel")
local dstlist = inv:get_list("dst")
--
-- Cooking
--
-- Check if we have cookable content
local cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
local cookable = true
if cooked.time == 0 then
cookable = false
end
-- Check if we have enough fuel to burn
if fuel_time < fuel_totaltime then
-- The furnace is currently active and has enough fuel
fuel_time = fuel_time + 1
-- If there is a cookable item then check if it is ready yet
if cookable then
src_time = src_time + 1
if src_time >= cooked.time then
-- Place result in dst list if possible
if inv:room_for_item("dst", cooked.item) then
inv:add_item("dst", cooked.item)
inv:set_stack("src", 1, aftercooked.items[1])
src_time = 0
end
end
end
else
-- Furnace ran out of fuel
if cookable then
-- We need to get new fuel
local fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
if fuel.time == 0 then
-- No valid fuel in fuel list
fuel_totaltime = 0
fuel_time = 0
src_time = 0
else
-- Take fuel from fuel list
inv:set_stack("fuel", 1, afterfuel.items[1])
fuel_totaltime = fuel.time
fuel_time = 0
end
else
-- We don't need to get new fuel since there is no cookable item
fuel_totaltime = 0
fuel_time = 0
src_time = 0
end
end
--
-- Update formspec, infotext and node
--
local formspec = inactive_formspec
local item_state = ""
local item_percent = 0
if cookable then
item_percent = math.floor(src_time / cooked.time * 100)
item_state = item_percent .. "%"
else
if srclist[1]:is_empty() then
item_state = "Empty"
else
item_state = "Not cookable"
end
end
local fuel_state = "Empty"
local active = "inactive "
local result = false
if fuel_time <= fuel_totaltime and fuel_totaltime ~= 0 then
active = "active "
local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100)
fuel_state = fuel_percent .. "%"
formspec = active_formspec(fuel_percent, item_percent)
swap_node(pos, "default:furnace_active")
-- make sure timer restarts automatically
result = true
else
if not fuellist[1]:is_empty() then
fuel_state = "0%"
end
swap_node(pos, "default:furnace")
-- stop timer on the inactive furnace
local timer = minetest.get_node_timer(pos)
timer:stop()
end
local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")"
--
-- Set meta values
--
meta:set_float("fuel_totaltime", fuel_totaltime)
meta:set_float("fuel_time", fuel_time)
meta:set_float("src_time", src_time)
meta:set_string("formspec", formspec)
meta:set_string("infotext", infotext)
return result
end
--
-- Node definitions
--
@ -109,6 +240,27 @@ minetest.register_node("default:furnace", {
can_dig = can_dig,
on_timer = furnace_node_timer,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", inactive_formspec)
local inv = meta:get_inventory()
inv:set_size('src', 1)
inv:set_size('fuel', 1)
inv:set_size('dst', 4)
end,
on_metadata_inventory_move = function(pos)
local timer = minetest.get_node_timer(pos)
timer:start(1.0)
end,
on_metadata_inventory_put = function(pos)
-- start timer function, it will sort out whether furnace can burn or not.
local timer = minetest.get_node_timer(pos)
timer:start(1.0)
end,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
@ -138,6 +290,7 @@ minetest.register_node("default:furnace_active", {
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
on_timer = furnace_node_timer,
can_dig = can_dig,

View File

@ -13,7 +13,7 @@ default.LIGHT_MAX = 14
-- GUI related stuff
default.gui_bg = "bgcolor[#080808BB;true]"
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
default.gui_slots = "listcolors[#606060AA;#808080;#101010;#202020;#FFF]"
default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
function default.get_hotbar_bg(x,y)
local out = ""
@ -31,8 +31,10 @@ default.gui_survival_form = "size[8,8.5]"..
"list[current_player;main;0,5.5;8,3;8]"..
"list[current_player;craft;1.75,0.5;3,3;]"..
"list[current_player;craftpreview;5.75,1.5;1,1;]"..
default.get_hotbar_bg(0,4.25)..
default.get_hotbar_bg(0,5.25)
"image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
"listring[current_player;main]"..
"listring[current_player;craft]"..
default.get_hotbar_bg(0,4.25)
-- Load files
dofile(minetest.get_modpath("default").."/functions.lua")

View File

@ -31,10 +31,6 @@ minetest.register_alias("mapgen_pine_needles", "default:pine_needles")
-- Dungeons
minetest.register_alias("mapgen_stone_with_iron", "default:stone_with_iron")
minetest.register_alias("mapgen_mese", "default:mese")
minetest.register_alias("mapgen_stone_with_coal", "default:stone_with_coal")
minetest.register_alias("mapgen_clay", "default:clay")
minetest.register_alias("mapgen_cobble", "default:cobble")
minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble")
minetest.register_alias("mapgen_mossycobble", "default:mossycobble")
@ -53,22 +49,22 @@ function default.register_ores()
-- Clay
minetest.register_ore({
ore_type = "blob",
ore = "default:clay",
wherein = {"default:sand"},
clust_scarcity = 24 * 24 * 24,
clust_size = 7,
y_min = -15,
y_max = 0,
noise_treshold = 0.0,
noise_params = {
offset = 0.35,
minetest.register_ore({
ore_type = "blob",
ore = "default:clay",
wherein = {"default:sand"},
clust_scarcity = 24 * 24 * 24,
clust_size = 7,
y_min = -15,
y_max = 0,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = -316,
octaves = 1,
persist = 0.5
persist = 0.0
},
})
@ -79,18 +75,18 @@ function default.register_ores()
ore = "default:sand",
wherein = {"default:stone", "default:sandstone",
"default:desert_stone"},
clust_scarcity = 24 * 24 * 24,
clust_size = 7,
y_min = -63,
y_max = 4,
noise_treshold = 0,
noise_params = {
offset = 0.35,
clust_scarcity = 24 * 24 * 24,
clust_size = 7,
y_min = -63,
y_max = 4,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 2316,
octaves = 1,
persist = 0.5
persist = 0.0
},
})
@ -100,18 +96,18 @@ function default.register_ores()
ore_type = "blob",
ore = "default:dirt",
wherein = {"default:stone", "default:sandstone"},
clust_scarcity = 24 * 24 * 24,
clust_size = 7,
y_min = -63,
y_max = 31000,
noise_treshold = 0,
noise_params = {
offset = 0.35,
clust_scarcity = 24 * 24 * 24,
clust_size = 7,
y_min = -63,
y_max = 31000,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 17676,
octaves = 1,
persist = 0.5
persist = 0.0
},
})
@ -121,18 +117,18 @@ function default.register_ores()
ore_type = "blob",
ore = "default:gravel",
wherein = {"default:stone"},
clust_scarcity = 24 * 24 * 24,
clust_size = 7,
y_min = -31000,
y_max = 31000,
noise_treshold = 0,
noise_params = {
offset = 0.35,
clust_scarcity = 24 * 24 * 24,
clust_size = 7,
y_min = -31000,
y_max = 31000,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 766,
octaves = 1,
persist = 0.5
persist = 0.0
},
})
@ -203,8 +199,8 @@ function default.register_ores()
clust_scarcity = 9 * 9 * 9,
clust_num_ores = 5,
clust_size = 3,
y_min = -63,
y_max = -16,
y_min = -63,
y_max = -16,
})
minetest.register_ore({
@ -216,7 +212,6 @@ function default.register_ores()
clust_size = 3,
y_min = -30000,
y_max = -64,
flags = "absheight",
})
minetest.register_ore({
@ -228,7 +223,6 @@ function default.register_ores()
clust_size = 6,
y_min = -30000,
y_max = -64,
flags = "absheight",
})
minetest.register_ore({
@ -253,7 +247,6 @@ function default.register_ores()
clust_size = 2,
y_min = -255,
y_max = -128,
flags = "absheight",
})
minetest.register_ore({
@ -265,7 +258,6 @@ function default.register_ores()
clust_size = 3,
y_min = -1024,
y_max = -256,
flags = "absheight",
})
minetest.register_ore({
@ -277,7 +269,6 @@ function default.register_ores()
clust_size = 2,
y_min = -30000,
y_max = -1024,
flags = "absheight",
})
minetest.register_ore({
@ -342,7 +333,6 @@ function default.register_ores()
clust_size = 2,
y_min = -255,
y_max = -64,
flags = "absheight",
})
minetest.register_ore({
@ -354,7 +344,6 @@ function default.register_ores()
clust_size = 3,
y_min = -30000,
y_max = -256,
flags = "absheight",
})
-- Diamond
@ -368,7 +357,6 @@ function default.register_ores()
clust_size = 3,
y_min = -512,
y_max = -256,
flags = "absheight",
})
minetest.register_ore({
@ -380,7 +368,6 @@ function default.register_ores()
clust_size = 3,
y_min = -30000,
y_max = -512,
flags = "absheight",
})
minetest.register_ore({
@ -427,7 +414,6 @@ function default.register_ores()
clust_size = 3,
y_min = -30000,
y_max = -64,
flags = "absheight",
})
-- Gold Coins
@ -468,44 +454,6 @@ function default.register_ores()
y_max = 64,
})
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,
y_min = 100,
y_max = 30000,
})
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,
y_min = 10000,
y_max = 30000,
})
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,
y_min = 500,
y_max = 30000,
})
end
-- Underground springs:
minetest.register_ore({
@ -1165,10 +1113,6 @@ function default.register_biomes()
y_max = -113,
heat_point = 50,
humidity_point = 50,
node_underwater = "default:sand",
height_shore = 3,
node_shore_filler = "default:sand",
node_shore_top = "default:sand",
})
end
@ -1200,7 +1144,7 @@ function default.register_mgv6_decorations()
y_max = 1,
decoration = "default:papyrus",
height = 2,
y_max = 4,
height_max = 4,
spawn_by = "default:water_source",
num_spawn_by = 1,
})
@ -1223,7 +1167,7 @@ function default.register_mgv6_decorations()
y_max = 30,
decoration = "default:cactus",
height = 3,
y_max = 4,
height_max = 4,
})
-- Long grasses
@ -1339,8 +1283,8 @@ function default.register_decorations()
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.04,
scale = 0.02,
offset = 0.036,
scale = 0.022,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
@ -1358,8 +1302,8 @@ function default.register_decorations()
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.002,
scale = 0.001,
offset = 0.0018,
scale = 0.0011,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
@ -1369,17 +1313,17 @@ function default.register_decorations()
y_min = 1,
y_max = 31000,
schematic = {
size = { x = 3, y = 3, z = 1},
size = {x = 3, y = 3, z = 1},
data = {
{ name = "air", prob = 0 },
{ name = "air", prob = 0 },
{ name = "air", prob = 0 },
{ name = "default:tree", param2 = 12, prob = 191 },
{ name = "default:tree", param2 = 12 },
{ name = "default:tree", param2 = 12, prob = 127 },
{ name = "air", prob = 0 },
{ name = "flowers:mushroom_brown", prob = 63 },
{ name = "air", prob = 0 },
{name = "air", prob = 0},
{name = "air", prob = 0},
{name = "air", prob = 0},
{name = "default:tree", param2 = 12, prob = 191},
{name = "default:tree", param2 = 12},
{name = "default:tree", param2 = 12, prob = 127},
{name = "air", prob = 0},
{name = "flowers:mushroom_brown", prob = 63},
{name = "air", prob = 0},
},
},
flags = "place_center_x",
@ -1392,7 +1336,7 @@ function default.register_decorations()
deco_type = "schematic",
place_on = {"default:dirt_with_grass", "default:dirt"},
sidelen = 80,
fill_ratio = 0.09,
fill_ratio = 0.1,
biomes = {"rainforest", "rainforest_swamp"},
y_min = 0,
y_max = 31000,
@ -1405,22 +1349,22 @@ function default.register_decorations()
deco_type = "schematic",
place_on = {"default:dirt_with_grass", "default:dirt"},
sidelen = 80,
fill_ratio = 0.01,
fill_ratio = 0.005,
biomes = {"rainforest", "rainforest_swamp"},
y_min = 1,
y_max = 31000,
schematic = {
size = { x = 3, y = 3, z = 1},
size = {x = 3, y = 3, z = 1},
data = {
{ name = "air", prob = 0 },
{ name = "air", prob = 0 },
{ name = "air", prob = 0 },
{ name = "default:jungletree", param2 = 12, prob = 191 },
{ name = "default:jungletree", param2 = 12 },
{ name = "default:jungletree", param2 = 12, prob = 127 },
{ name = "air", prob = 0 },
{ name = "flowers:mushroom_brown", prob = 127 },
{ name = "air", prob = 0 },
{name = "air", prob = 0},
{name = "air", prob = 0},
{name = "air", prob = 0},
{name = "default:jungletree", param2 = 12, prob = 191},
{name = "default:jungletree", param2 = 12},
{name = "default:jungletree", param2 = 12, prob = 127},
{name = "air", prob = 0},
{name = "flowers:mushroom_brown", prob = 127},
{name = "air", prob = 0},
},
},
flags = "place_center_x",
@ -1434,8 +1378,8 @@ function default.register_decorations()
place_on = {"default:dirt_with_snow", "default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.04,
scale = 0.02,
offset = 0.036,
scale = 0.022,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
@ -1452,22 +1396,29 @@ function default.register_decorations()
deco_type = "schematic",
place_on = {"default:dirt_with_snow", "default:dirt_with_grass"},
sidelen = 80,
fill_ratio = 0.003,
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},
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 },
{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",
@ -1512,14 +1463,14 @@ function default.register_decorations()
y_min = 1,
y_max = 31000,
schematic = {
size = { x = 3, y = 2, z = 1},
size = {x = 3, y = 2, z = 1},
data = {
{ name = "air", prob = 0 },
{ name = "air", prob = 0 },
{ name = "air", prob = 0 },
{ name = "default:acacia_tree", param2 = 12, prob = 191 },
{ name = "default:acacia_tree", param2 = 12 },
{ name = "default:acacia_tree", param2 = 12, prob = 127 },
{name = "air", prob = 0},
{name = "air", prob = 0},
{name = "air", prob = 0},
{name = "default:acacia_tree", param2 = 12, prob = 191},
{name = "default:acacia_tree", param2 = 12},
{name = "default:acacia_tree", param2 = 12, prob = 127},
},
},
flags = "place_center_x",
@ -1533,8 +1484,8 @@ function default.register_decorations()
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.01,
scale = -0.02,
offset = 0.0,
scale = -0.015,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
@ -1545,7 +1496,6 @@ function default.register_decorations()
y_max = 31000,
schematic = minetest.get_modpath("default").."/schematics/aspen_tree.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
@ -1553,8 +1503,8 @@ function default.register_decorations()
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.0005,
scale = -0.001,
offset = 0.0,
scale = -0.0008,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
@ -1564,17 +1514,17 @@ function default.register_decorations()
y_min = 1,
y_max = 31000,
schematic = {
size = { x = 3, y = 3, z = 1},
size = {x = 3, y = 3, z = 1},
data = {
{ name = "air", prob = 0 },
{ name = "air", prob = 0 },
{ name = "air", prob = 0 },
{ name = "default:aspen_tree", param2 = 12 },
{ name = "default:aspen_tree", param2 = 12 },
{ name = "default:aspen_tree", param2 = 12, prob = 127 },
{ name = "flowers:mushroom_red", prob = 63 },
{ name = "flowers:mushroom_brown", prob = 63 },
{ name = "air", prob = 0 },
{name = "air", prob = 0},
{name = "air", prob = 0},
{name = "air", prob = 0},
{name = "default:aspen_tree", param2 = 12},
{name = "default:aspen_tree", param2 = 12},
{name = "default:aspen_tree", param2 = 12, prob = 127},
{name = "flowers:mushroom_red", prob = 63},
{name = "flowers:mushroom_brown", prob = 63},
{name = "air", prob = 0},
},
},
flags = "place_center_x",
@ -1621,7 +1571,7 @@ function default.register_decorations()
y_max = 31000,
decoration = "default:cactus",
height = 2,
y_max = 5,
height_max = 5,
})
-- Papyrus
@ -1735,12 +1685,12 @@ function default.generate_nyancats(minp, maxp, seed)
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
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}
local p0 = {x = x0, y = y0, z = z0}
default.make_nyancat(p0, pr:next(0, 3), pr:next(10, 15))
end
end

File diff suppressed because it is too large Load Diff

View File

@ -95,7 +95,7 @@ minetest.register_on_joinplayer(function(player)
default.player_attached[player:get_player_name()] = false
default.player_set_model(player, "character.b3d")
player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30)
-- set GUI
if not minetest.setting_getbool("creative_mode") then
player:set_inventory_formspec(default.gui_survival_form)

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
minetestforfun_game/mods/default/schematics/pine_tree.mts Executable file → Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -5,7 +5,6 @@ minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",
wield_scale = {x=1,y=1,z=2.5},
range = 5,
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level = 0,

View File

@ -1,10 +1,10 @@
local random = math.random
--
-- Grow trees from saplings
--
-- 'Can grow' function
local random = math.random
-- 'can grow' function
function default.can_grow(pos)
local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z})
@ -16,22 +16,55 @@ function default.can_grow(pos)
if is_soil == 0 then
return false
end
local ll = minetest.get_node_light(pos)
if not ll or ll < 13 then -- Minimum light level for growth
return false -- matches grass, wheat and cotton
local light_level = minetest.get_node_light(pos)
if not light_level or light_level < 13 then
return false
end
return true
end
-- 'is snow nearby' function
local function is_snow_nearby(pos)
local x, y, z = pos.x, pos.y, pos.z
local c_snow = minetest.get_content_id("default:snow")
local c_snowblock = minetest.get_content_id("default:snowblock")
local c_dirtsnow = minetest.get_content_id("default:dirt_with_snow")
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map(
{x = x - 1, y = y - 1, z = z - 1},
{x = x + 1, y = y + 1, z = z + 1}
)
local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
for yy = y - 1, y + 1 do
for zz = z - 1, z + 1 do
local vi = a:index(x - 1, yy, zz)
for xx = x - 1, x + 1 do
local nodid = data[vi]
if nodid == c_snow or nodid == c_snowblock or nodid == c_dirtsnow then
return true
end
vi = vi + 1
end
end
end
return false
end
-- Sapling ABM
minetest.register_abm({
nodenames = {"default:sapling", "default:junglesapling",
"default:pine_sapling", "default:acacia_sapling",
"default:aspen_sapling"},
interval = 5,
chance = 40,
interval = 10,
chance = 50,
action = function(pos, node)
if not default.can_grow(pos) then
return
@ -57,8 +90,11 @@ minetest.register_abm({
elseif node.name == "default:pine_sapling" then
minetest.log("action", "A pine sapling grows into a tree at "..
minetest.pos_to_string(pos))
local snow = is_snow_nearby(pos)
if mapgen == "v6" then
default.grow_pine_tree(pos)
default.grow_pine_tree(pos, snow)
elseif snow then
default.grow_new_snowy_pine_tree(pos)
else
default.grow_new_pine_tree(pos)
end
@ -199,7 +235,8 @@ function default.grow_jungle_tree(pos, bad)
local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
add_trunk_and_leaves(data, a, pos, c_jungletree, c_jungleleaves, height, 3, 30, false)
add_trunk_and_leaves(data, a, pos, c_jungletree, c_jungleleaves,
height, 3, 30, false)
-- Roots
for z_dist = -1, 1 do
@ -240,7 +277,7 @@ local function add_snow(data, vi, c_air, c_ignore, c_snow)
end
end
function default.grow_pine_tree(pos)
function default.grow_pine_tree(pos, snow)
local x, y, z = pos.x, pos.y, pos.z
local maxy = y + random(9, 13) -- Trunk top
@ -249,32 +286,15 @@ function default.grow_pine_tree(pos)
local c_pine_tree = minetest.get_content_id("default:pine_tree")
local c_pine_needles = minetest.get_content_id("default:pine_needles")
local c_snow = minetest.get_content_id("default:snow")
local c_snowblock = minetest.get_content_id("default:snowblock")
local c_dirtsnow = minetest.get_content_id("default:dirt_with_snow")
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map(
{x = x - 3, y = y - 1, z = z - 3},
{x = x - 3, y = y, z = z - 3},
{x = x + 3, y = maxy + 3, z = z + 3}
)
local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
-- Scan for snow nodes near sapling to enable snow on branches
local snow = false
for yy = y - 1, y + 1 do
for zz = z - 1, z + 1 do
local vi = a:index(x - 1, yy, zz)
for xx = x - 1, x + 1 do
local nodid = data[vi]
if nodid == c_snow or nodid == c_snowblock or nodid == c_dirtsnow then
snow = true
end
vi = vi + 1
end
end
end
-- Upper branches layer
local dev = 3
for yy = maxy - 1, maxy + 1 do
@ -350,7 +370,8 @@ function default.grow_pine_tree(pos)
end
-- Trunk
data[a:index(x, y, z)] = c_pine_tree -- Force-place lowest trunk node to replace sapling
-- Force-place lowest trunk node to replace sapling
data[a:index(x, y, z)] = c_pine_tree
for yy = y + 1, maxy do
local vi = a:index(x, yy, z)
local node_id = data[vi]
@ -365,47 +386,63 @@ function default.grow_pine_tree(pos)
vm:update_map()
end
-- New apple tree
function default.grow_new_apple_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/apple_tree_from_sapling.mts"
local path = minetest.get_modpath("default") ..
"/schematics/apple_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false)
path, "0", nil, false)
end
-- New jungle tree
function default.grow_new_jungle_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/jungle_tree_from_sapling.mts"
local path = minetest.get_modpath("default") ..
"/schematics/jungle_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false)
path, "random", nil, false)
end
-- New pine tree
function default.grow_new_pine_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/pine_tree_from_sapling.mts"
local path = minetest.get_modpath("default") ..
"/schematics/pine_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false)
path, "0", nil, false)
end
-- New snowy pine tree
function default.grow_new_snowy_pine_tree(pos)
local path = minetest.get_modpath("default") ..
"/schematics/snowy_pine_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, "random", nil, false)
end
-- New acacia tree
function default.grow_new_acacia_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/acacia_tree_from_sapling.mts"
local path = minetest.get_modpath("default") ..
"/schematics/acacia_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 4, y = pos.y - 1, z = pos.z - 4},
path, random, nil, false)
path, "random", nil, false)
end
-- New aspen tree
function default.grow_new_aspen_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/aspen_tree_from_sapling.mts"
local path = minetest.get_modpath("default") ..
"/schematics/aspen_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false)
path, "0", nil, false)
end
-- From BFD: