2015-03-11 11:54:26 -07:00
|
|
|
local barrel_formspec =
|
|
|
|
"size[8,9]"..
|
|
|
|
default.gui_bg..
|
|
|
|
default.gui_bg_img..
|
|
|
|
default.gui_slots..
|
|
|
|
"list[current_name;main;0,0.3;8,4;]"..
|
|
|
|
"list[current_player;main;0,4.85;8,1;]"..
|
|
|
|
"list[current_player;main;0,6.08;8,3;8]"..
|
|
|
|
default.get_hotbar_bg(0,4.85)
|
|
|
|
|
|
|
|
minetest.register_node('survival:barrel', {
|
|
|
|
description = 'Barrel',
|
|
|
|
drawtype = 'mesh',
|
|
|
|
mesh = 'survival_barrel.obj',
|
|
|
|
tiles = {'survival_barrel.png'},
|
|
|
|
groups = {choppy=2,oddly_breakable_by_hand=2},
|
|
|
|
paramtype = 'light',
|
|
|
|
paramtype2 = 'facedir',
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
on_construct = function(pos)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
meta:set_string("formspec", barrel_formspec)
|
|
|
|
meta:set_string("infotext", "Barrel")
|
|
|
|
local inv = meta:get_inventory()
|
|
|
|
inv:set_size("main", 8*4)
|
|
|
|
end,
|
|
|
|
can_dig = function(pos,player)
|
|
|
|
local meta = minetest.get_meta(pos);
|
|
|
|
local inv = meta:get_inventory()
|
|
|
|
return inv:is_empty("main")
|
|
|
|
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 barrel 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 barrel 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 barrel at "..minetest.pos_to_string(pos))
|
|
|
|
end,
|
|
|
|
})
|
2015-03-18 17:43:54 -07:00
|
|
|
|
|
|
|
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"},
|
|
|
|
is_ground_content = true,
|
|
|
|
groups = {crumbly=3,soil=1},
|
|
|
|
drop = {
|
|
|
|
max_items = 2,
|
|
|
|
items = {
|
|
|
|
{
|
|
|
|
items = {'survival:slug_raw'},
|
|
|
|
rarity = 30,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
items = {'survival:cricket_raw'},
|
|
|
|
rarity = 30,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
items = {'survival:worm_raw'},
|
|
|
|
rarity = 30,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
items = {'survival:centipede_raw'},
|
|
|
|
rarity = 30,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
items = {'survival:milipede_raw'},
|
|
|
|
rarity = 30,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
items = {'default:dirt'},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
sounds = default.node_sound_dirt_defaults({
|
|
|
|
footstep = {name="default_grass_footstep", gain=0.25},
|
|
|
|
}),
|
|
|
|
})
|