1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-07 02:50:26 +01:00

Updated minetestforfun_game

- Added default:meselamps
 - Added shelf:vessel
 - Merged cactus/papyrus override possibility
This commit is contained in:
LeMagnesium 2015-05-01 14:38:17 +02:00
parent 744055b103
commit baa7b8875b
7 changed files with 163 additions and 43 deletions

View File

@ -131,6 +131,8 @@ BlockMen (CC BY-SA 3.0):
default_chest_lock.png
default_chest_side.png
default_chest_top.png
default_mineral_mese.png
default_meselamp.png
bubble.png
heart.png
gui_*.png

View File

@ -667,6 +667,14 @@ minetest.register_craft({
recipe = {{"default:mese_crystal"}},
})
minetest.register_craft({
output = 'default:meselamp 1',
recipe = {
{'', 'default:mese_crystal',''},
{'default:mese_crystal', 'default:glass', 'default:mese_crystal'},
}
})
minetest.register_craft({
output = "default:obsidian_shard 9",
recipe = {{"default:obsidian"}},

View File

@ -225,8 +225,8 @@ minetest.register_abm({
neighbors = {"group:water"},
interval = 2,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
default.cool_lava_flowing(pos, node, active_object_count, active_object_count_wider)
action = function(...)
default.cool_lava_flowing(...)
end,
})
@ -235,8 +235,8 @@ minetest.register_abm({
neighbors = {"group:water"},
interval = 2,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
default.cool_lava_source(pos, node, active_object_count, active_object_count_wider)
action = function(...)
default.cool_lava_source(...)
end,
})
@ -244,27 +244,61 @@ minetest.register_abm({
-- Papyrus and cactus growing
--
function default.grow_cactus(pos, node)
if node.param2 ~= 0 then
return
end
pos.y = pos.y-1
if minetest.get_item_group(minetest.get_node(pos).name, "sand") == 0 then
return
end
pos.y = pos.y+1
local height = 0
while node.name == "default:cactus" and height < 4 and node.param2 == 0 do
height = height+1
pos.y = pos.y+1
node = minetest.get_node(pos)
end
if height == 4
or node.name ~= "air" then
return
end
minetest.set_node(pos, {name="default:cactus"})
return true
end
function default.grow_papyrus(pos, node)
pos.y = pos.y-1
local name = minetest.get_node(pos).name
if name ~= "default:dirt_with_grass"
and name ~= "default:dirt" then
return
end
if not minetest.find_node_near(pos, 3, {"group:water"}) then
return
end
pos.y = pos.y+1
local height = 0
while node.name == "default:papyrus" and height < 4 do
height = height+1
pos.y = pos.y+1
node = minetest.get_node(pos)
end
if height == 4
or node.name ~= "air" then
return
end
minetest.set_node(pos, {name="default:papyrus"})
return true
end
minetest.register_abm({
nodenames = {"default:cactus"},
neighbors = {"group:sand"},
interval = 60,
chance = 25,
action = function(pos, node)
pos.y = pos.y - 1
local name = minetest.get_node(pos).name
if minetest.get_item_group(name, "sand") ~= 0 then
pos.y = pos.y + 1
local height = 0
while minetest.get_node(pos).name == "default:cactus" and height < 4 do
height = height + 1
pos.y = pos.y + 1
end
if height < 4 then
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "default:cactus"})
end
end
end
action = function(...)
default.grow_cactus(...)
end,
})
@ -273,29 +307,8 @@ minetest.register_abm({
neighbors = {"default:dirt", "default:dirt_with_grass", "default:dirt_with_snow", "default:sand", "default:desert_sand"},
interval = 60,
chance = 25,
action = function(pos, node)
pos.y = pos.y - 1
local name = minetest.get_node(pos).name
if name == "default:dirt"
or name == "default:dirt_with_grass"
or name == "default:dirt_with_snow"
or name == "default:sand"
or name == "default:desert_sand" then
if minetest.find_node_near(pos, 3, {"group:water"}) == nil then
return
end
pos.y = pos.y + 1
local height = 0
while minetest.get_node(pos).name == "default:papyrus" and height < 4 do
height = height + 1
pos.y = pos.y + 1
end
if height < 4 then
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "default:papyrus"})
end
end
end
action = function(...)
default.grow_papyrus(...)
end,
})

View File

@ -264,6 +264,7 @@ minetest.register_node("default:desert_stone_with_copper", {
minetest.register_node("default:stone_with_mese", {
description = "Mese Ore",
tiles = {"default_stone.png^default_mineral_mese.png"},
paramtype = "light",
is_ground_content = true,
groups = {cracky = 3},
drop = {
@ -274,6 +275,7 @@ minetest.register_node("default:stone_with_mese", {
},
},
sounds = default.node_sound_stone_defaults(),
light_source = 1,
})
minetest.register_node("default:stone_with_gold", {
@ -507,6 +509,18 @@ minetest.register_node("default:brick", {
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:meselamp", {
description = "Mese Lamp",
drawtype = "glasslike",
tiles = {"default_meselamp.png"},
paramtype = "light",
sunlight_propagates = true,
is_ground_content = false,
groups = {cracky = 3, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(),
light_source = 12,
})
minetest.register_node("default:tree", {
description = "Tree",
tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
@ -1511,6 +1525,7 @@ minetest.register_node("default:bronzeblock", {
minetest.register_node("default:mese", {
description = "Mese Block",
tiles = {"default_mese_block.png"},
paramtype = "light",
is_ground_content = true,
drop = {
items = {
@ -1520,6 +1535,7 @@ minetest.register_node("default:mese", {
},
groups = {cracky = 1, level = 2, fall_damage_add_percent = -75},
sounds = default.node_sound_wood_defaults(), -- Intended.
light_source = 3,
})
local function die_later(digger)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1,6 +1,87 @@
-- Minetest 0.4 mod: vessels
-- See README.txt for licensing and other information.
local vessels_shelf_formspec =
"size[8,7;]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[context;vessels;0,0.3;8,2;]"..
"list[current_player;main;0,2.85;8,1;]"..
"list[current_player;main;0,4.08;8,3;8]"..
default.get_hotbar_bg(0,2.85)
minetest.register_node("vessels:shelf", {
description = "Vessels shelf",
tiles = {"default_wood.png", "default_wood.png", "default_wood.png^vessels_shelf.png"},
is_ground_content = false,
groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", vessels_shelf_formspec)
local inv = meta:get_inventory()
inv:set_size("vessels", 8*2)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("vessels")
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local to_stack = inv:get_stack(listname, index)
if listname == "vessels" then
if minetest.get_item_group(stack:get_name(), "vessel") ~= 0
and to_stack:is_empty() then
return 1
else
return 0
end
end
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local stack = inv:get_stack(from_list, from_index)
local to_stack = inv:get_stack(to_list, to_index)
if to_list == "vessels" then
if minetest.get_item_group(stack:get_name(), "vessel") ~= 0
and to_stack:is_empty() then
return 1
else
return 0
end
end
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in vessels shelf at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to vessels shelf at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from vessels shelf at "..minetest.pos_to_string(pos))
end,
})
minetest.register_craft({
output = 'vessels:shelf',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:vessel', 'group:vessel', 'group:vessel'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
minetest.register_node("vessels:glass_bottle", {
description = "Glass Bottle (empty)",
drawtype = "plantlike",

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B