1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 02:00:37 +01:00

[MFFGame] Updates

This commit is contained in:
LeMagnesium 2015-11-23 18:39:26 +01:00
parent d36621d9de
commit 2b478b5b32
5 changed files with 61 additions and 22 deletions

View File

@ -18,7 +18,6 @@ function beds.register_bed(name, def)
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = def.selectionbox, fixed = def.selectionbox,
}, },
after_place_node = function(pos, placer, itemstack) after_place_node = function(pos, placer, itemstack)
local n = minetest.get_node_or_nil(pos) local n = minetest.get_node_or_nil(pos)
@ -89,16 +88,13 @@ function beds.register_bed(name, def)
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
is_ground_content = false, is_ground_content = false,
pointable = false,
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2}, groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = def.nodebox.top, fixed = def.nodebox.top,
}, },
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0},
},
}) })
minetest.register_alias(name, name .. "_bottom") minetest.register_alias(name, name .. "_bottom")

View File

@ -181,6 +181,7 @@ minetest.register_abm({
neighbors = {"group:water"}, neighbors = {"group:water"},
interval = 1, interval = 1,
chance = 2, chance = 2,
catch_up = false,
action = function(...) action = function(...)
default.cool_lava_flowing(...) default.cool_lava_flowing(...)
end, end,
@ -191,6 +192,7 @@ minetest.register_abm({
neighbors = {"group:water"}, neighbors = {"group:water"},
interval = 1, interval = 1,
chance = 2, chance = 2,
catch_up = false,
action = function(...) action = function(...)
default.cool_lava_source(...) default.cool_lava_source(...)
end, end,
@ -404,6 +406,7 @@ end)
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:dirt"}, nodenames = {"default:dirt"},
catch_up = false,
interval = 30, interval = 30,
chance = 5, chance = 5,
action = function(pos, node) action = function(pos, node)
@ -423,10 +426,16 @@ minetest.register_abm({
end end
}) })
--
-- Grass and dry grass removed in darkness
--
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_grass"}, nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_grass"},
interval = 2, interval = 2,
chance = 20, chance = 20,
catch_up = false,
action = function(pos, node) action = function(pos, node)
local above = {x = pos.x, y = pos.y + 1, z = pos.z} local above = {x = pos.x, y = pos.y + 1, z = pos.z}
local name = minetest.get_node(above).name local name = minetest.get_node(above).name
@ -439,3 +448,18 @@ minetest.register_abm({
end end
}) })
--
-- Moss growth on cobble near water
--
minetest.register_abm({
nodenames = {"default:cobble"},
neighbors = {"group:water"},
interval = 17,
chance = 200,
catch_up = false,
action = function(pos, node)
minetest.set_node(pos, {name = "default:mossycobble"})
end
})

View File

@ -61,7 +61,7 @@ function default.register_ores()
clust_size = 7, clust_size = 7,
y_min = -15, y_min = -15,
y_max = 0, y_max = 0,
noise_threshhold = 0, noise_threshhold = 0.0,
noise_params = { noise_params = {
offset = 0.35, offset = 0.35,
scale = 0.2, scale = 0.2,
@ -188,7 +188,7 @@ function default.register_ores()
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_iron", ore = "default:stone_with_iron",
wherein = "default:stone", wherein = "default:stone",
clust_scarcity = 11 * 11 * 11, clust_scarcity = 12 * 12 * 12,
clust_num_ores = 3, clust_num_ores = 3,
clust_size = 2, clust_size = 2,
y_min = -15, y_min = -15,
@ -199,7 +199,7 @@ function default.register_ores()
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_iron", ore = "default:stone_with_iron",
wherein = "default:stone", wherein = "default:stone",
clust_scarcity = 10 * 10 * 10, clust_scarcity = 9 * 9 * 9,
clust_num_ores = 5, clust_num_ores = 5,
clust_size = 3, clust_size = 3,
y_min = -63, y_min = -63,
@ -210,7 +210,7 @@ function default.register_ores()
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_iron", ore = "default:stone_with_iron",
wherein = "default:stone", wherein = "default:stone",
clust_scarcity = 9 * 9 * 9, clust_scarcity = 7 * 7 * 7,
clust_num_ores = 5, clust_num_ores = 5,
clust_size = 3, clust_size = 3,
y_min = -30000, y_min = -30000,
@ -222,7 +222,7 @@ function default.register_ores()
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_iron", ore = "default:stone_with_iron",
wherein = "default:stone", wherein = "default:stone",
clust_scarcity = 25 * 25 * 25, clust_scarcity = 24 * 24 * 24,
clust_num_ores = 27, clust_num_ores = 27,
clust_size = 6, clust_size = 6,
y_min = -30000, y_min = -30000,
@ -1114,7 +1114,7 @@ function default.register_mgv6_decorations()
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:dirt_with_grass"}, place_on = {"default:dirt_with_grass"},
sidelen = 8, sidelen = 16,
noise_params = { noise_params = {
offset = -0.3, offset = -0.3,
scale = 0.7, scale = 0.7,
@ -1319,10 +1319,10 @@ function default.register_decorations()
minetest.register_decoration({ minetest.register_decoration({
deco_type = "schematic", deco_type = "schematic",
place_on = {"default:dirt_with_dry_grass"}, place_on = {"default:dirt_with_dry_grass"},
sidelen = 80, sidelen = 16,
noise_params = { noise_params = {
offset = 0, offset = 0,
scale = 0.003, scale = 0.002,
spread = {x = 250, y = 250, z = 250}, spread = {x = 250, y = 250, z = 250},
seed = 2, seed = 2,
octaves = 3, octaves = 3,
@ -1341,10 +1341,10 @@ function default.register_decorations()
minetest.register_decoration({ minetest.register_decoration({
deco_type = "schematic", deco_type = "schematic",
place_on = {"default:desert_sand"}, place_on = {"default:desert_sand"},
sidelen = 80, sidelen = 16,
noise_params = { noise_params = {
offset = -0.0005, offset = -0.0003,
scale = 0.0015, scale = 0.0009,
spread = {x = 200, y = 200, z = 200}, spread = {x = 200, y = 200, z = 200},
seed = 230, seed = 230,
octaves = 3, octaves = 3,
@ -1363,10 +1363,10 @@ function default.register_decorations()
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:desert_sand"}, place_on = {"default:desert_sand"},
sidelen = 80, sidelen = 16,
noise_params = { noise_params = {
offset = -0.0005, offset = -0.0003,
scale = 0.0015, scale = 0.0009,
spread = {x = 200, y = 200, z = 200}, spread = {x = 200, y = 200, z = 200},
seed = 230, seed = 230,
octaves = 3, octaves = 3,

View File

@ -6,7 +6,7 @@
local random = math.random local random = math.random
local function can_grow(pos) function default.can_grow(pos)
local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z}) local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z})
if not node_under then if not node_under then
return false return false
@ -32,7 +32,7 @@ minetest.register_abm({
interval = 10, interval = 10,
chance = 50, chance = 50,
action = function(pos, node) action = function(pos, node)
if not can_grow(pos) then if not default.can_grow(pos) then
return return
end end

View File

@ -129,7 +129,23 @@ function fire.flame_should_extinguish(pos)
end end
-- Enable ABMs according to 'disable fire' setting --[[ Extinguish all flames quickly with water, snow, ice
minetest.register_abm({
nodenames = {"fire:basic_flame", "fire:permanent_flame"},
neighbors = {"group:puts_out_fire"},
interval = 3,
chance = 2,
catch_up = false,
action = function(p0, node, _, _)
minetest.remove_node(p0)
minetest.sound_play("fire_extinguish_flame",
{pos = p0, max_hear_distance = 16, gain = 0.25})
end,
})
]]-- Enable the following ABMs according to 'disable fire' setting
if minetest.setting_getbool("disable_fire") then if minetest.setting_getbool("disable_fire") then
@ -139,6 +155,7 @@ if minetest.setting_getbool("disable_fire") then
nodenames = {"fire:basic_flame"}, nodenames = {"fire:basic_flame"},
interval = 3, interval = 3,
chance = 2, chance = 2,
catch_up = false,
action = function(p0, node, _, _) action = function(p0, node, _, _)
minetest.remove_node(p0) minetest.remove_node(p0)
end, end,
@ -167,6 +184,7 @@ else
neighbors = {"group:igniter"}, neighbors = {"group:igniter"},
interval = 7, interval = 7,
chance = 16, chance = 16,
catch_up = false,
action = function(p0, node, _, _) action = function(p0, node, _, _)
-- If there is water or stuff like that around node, don't ignite -- If there is water or stuff like that around node, don't ignite
if fire.flame_should_extinguish(p0) then if fire.flame_should_extinguish(p0) then
@ -185,6 +203,7 @@ else
nodenames = {"fire:basic_flame"}, nodenames = {"fire:basic_flame"},
interval = 5, interval = 5,
chance = 16, chance = 16,
catch_up = false,
action = function(p0, node, _, _) action = function(p0, node, _, _)
-- If there are no flammable nodes around flame, remove flame -- If there are no flammable nodes around flame, remove flame
if not minetest.find_node_near(p0, 1, {"group:flammable"}) then if not minetest.find_node_near(p0, 1, {"group:flammable"}) then