Add container group for nodes with inventories

Wuzzy 2017-02-13 19:06:12 +01:00
parent 3de20363b5
commit d6a404ce92
5 changed files with 16 additions and 9 deletions

5
API.md

@ -86,6 +86,11 @@ These groups are used mostly for informational purposes
* `eatable`: Item can be *directly* eaten by wielding + left click (`on_use=item_eat`). Rating is the satiation gain * `eatable`: Item can be *directly* eaten by wielding + left click (`on_use=item_eat`). Rating is the satiation gain
* `ammo=1`: Item is used as ammo for a weapon * `ammo=1`: Item is used as ammo for a weapon
* `ammo_bow=1`: Item is used as ammo for bows * `ammo_bow=1`: Item is used as ammo for bows
* `container`: Node is a container which physically stores items within and has at least 1 inventory
* `container=2`: Has one inventory with list name `"main"`. Items can be placed and taken freely
* `container=3`: Same as `container=2`, but shulker boxes can not be inserted
* `container=4`: Furnace-like, has lists `"src"`, `"fuel"` and `"dst"`
* `container=1`: Other/unspecified container type
* `weapon=1`: Item is primarily (!) a weapon * `weapon=1`: Item is primarily (!) a weapon
* `tool=1`: Item is primarily (!) a tool * `tool=1`: Item is primarily (!) a tool

@ -28,7 +28,7 @@ minetest.register_node("mcl_chests:chest", {
"default_chest_side.png", "default_chest_side.png", "default_chest_front.png"}, "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
paramtype2 = "facedir", paramtype2 = "facedir",
stack_max = 64, stack_max = 64,
groups = {choppy=2,oddly_breakable_by_hand=2, deco_block=1}, groups = {choppy=2,container=2,oddly_breakable_by_hand=2, deco_block=1},
is_ground_content = false, is_ground_content = false,
sounds = mcl_sounds.node_sound_wood_defaults(), sounds = mcl_sounds.node_sound_wood_defaults(),
on_construct = function(pos) on_construct = function(pos)
@ -139,7 +139,7 @@ minetest.register_node("mcl_chests:chest_left", {
tiles = {"default_chest_top_big.png", "default_chest_top_big.png", "default_chest_side.png", tiles = {"default_chest_top_big.png", "default_chest_top_big.png", "default_chest_side.png",
"default_chest_side.png", "default_chest_side_big.png^[transformFX", "default_chest_front_big.png"}, "default_chest_side.png", "default_chest_side_big.png^[transformFX", "default_chest_front_big.png"},
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1}, groups = {choppy=2,container=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1},
drop = "mcl_chests:chest", drop = "mcl_chests:chest",
is_ground_content = false, is_ground_content = false,
sounds = mcl_sounds.node_sound_wood_defaults(), sounds = mcl_sounds.node_sound_wood_defaults(),
@ -198,7 +198,7 @@ minetest.register_node("mcl_chests:chest_right", {
tiles = {"default_chest_top_big.png^[transformFX", "default_chest_top_big.png^[transformFX", "default_chest_side.png", tiles = {"default_chest_top_big.png^[transformFX", "default_chest_top_big.png^[transformFX", "default_chest_side.png",
"default_chest_side.png", "default_chest_side_big.png", "default_chest_front_big.png^[transformFX"}, "default_chest_side.png", "default_chest_side_big.png", "default_chest_front_big.png^[transformFX"},
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1}, groups = {choppy=2,container=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1},
drop = "mcl_chests:chest", drop = "mcl_chests:chest",
is_ground_content = false, is_ground_content = false,
sounds = mcl_sounds.node_sound_wood_defaults(), sounds = mcl_sounds.node_sound_wood_defaults(),
@ -273,6 +273,8 @@ minetest.register_node("mcl_chests:ender_chest", {
tiles = {"mcl_chests_ender_chest_top.png", "mcl_chests_ender_chest_bottom.png", tiles = {"mcl_chests_ender_chest_top.png", "mcl_chests_ender_chest_bottom.png",
"mcl_chests_ender_chest_right.png", "mcl_chests_ender_chest_left.png", "mcl_chests_ender_chest_right.png", "mcl_chests_ender_chest_left.png",
"mcl_chests_ender_chest_back.png", "mcl_chests_ender_chest_front.png"}, "mcl_chests_ender_chest_back.png", "mcl_chests_ender_chest_front.png"},
-- Note: The “container” group is missing here because the ender chest does not
-- have an inventory on its own
groups = {cracky=1, deco_block=1}, groups = {cracky=1, deco_block=1},
is_ground_content = false, is_ground_content = false,
paramtype = "light", paramtype = "light",
@ -335,7 +337,7 @@ for color, desc in pairs(boxtypes) do
tiles = {"mcl_chests_"..color.."_shulker_box_top.png", "mcl_chests_"..color.."_shulker_box_bottom.png", tiles = {"mcl_chests_"..color.."_shulker_box_top.png", "mcl_chests_"..color.."_shulker_box_bottom.png",
"mcl_chests_"..color.."_shulker_box_side.png", "mcl_chests_"..color.."_shulker_box_side.png", "mcl_chests_"..color.."_shulker_box_side.png", "mcl_chests_"..color.."_shulker_box_side.png",
"mcl_chests_"..color.."_shulker_box_side.png", "mcl_chests_"..color.."_shulker_box_side.png"}, "mcl_chests_"..color.."_shulker_box_side.png", "mcl_chests_"..color.."_shulker_box_side.png"},
groups = {cracky=2, deco_block=1, shulker_box=1}, groups = {cracky=2, container=3, deco_block=1, shulker_box=1},
is_ground_content = false, is_ground_content = false,
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
stack_max = 1, stack_max = 1,

@ -30,7 +30,7 @@ minetest.register_node("mcl_furnaces:furnace", {
paramtype2 = "facedir", paramtype2 = "facedir",
is_ground_content = false, is_ground_content = false,
stack_max = 64, stack_max = 64,
groups = {cracky=2, deco_block=1}, groups = {cracky=2, container=4, deco_block=1},
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
@ -96,7 +96,7 @@ minetest.register_node("mcl_furnaces:furnace_active", {
is_ground_content = false, is_ground_content = false,
light_source = 13, light_source = 13,
drop = "mcl_furnaces:furnace", drop = "mcl_furnaces:furnace",
groups = {cracky=2, not_in_creative_inventory=1}, groups = {cracky=2, container=4, not_in_creative_inventory=1},
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)

@ -15,7 +15,7 @@ local mcl_hoppers_formspec =
minetest.register_node("mcl_hoppers:hopper", { minetest.register_node("mcl_hoppers:hopper", {
drop = "mcl_hoppers:hopper_item", drop = "mcl_hoppers:hopper_item",
description = "Hopper (Node)", description = "Hopper (Node)",
groups = {cracky=1,level=2,not_in_creative_inventory=1}, groups = {cracky=1,level=2,container=2,not_in_creative_inventory=1},
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
tiles = {"mcl_hoppers_hopper_inside.png^mcl_hoppers_hopper_top.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_inside.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_outside.png"}, tiles = {"mcl_hoppers_hopper_inside.png^mcl_hoppers_hopper_top.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_inside.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_outside.png"},
@ -74,7 +74,7 @@ minetest.register_node("mcl_hoppers:hopper", {
minetest.register_node("mcl_hoppers:hopper_side", { minetest.register_node("mcl_hoppers:hopper_side", {
description = "Hopper (Side)", description = "Hopper (Side)",
drop = "mcl_hoppers:hopper_item", drop = "mcl_hoppers:hopper_item",
groups = {cracky=1,level=2,not_in_creative_inventory=1}, groups = {cracky=1,level=2,container=2,not_in_creative_inventory=1},
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",

@ -5,7 +5,7 @@ minetest.register_node("mcl_dropper:dropper", {
"default_furnace_side.png", "default_furnace_side.png", "default_furnace_side.png", "default_furnace_side.png",
"default_furnace_side.png", "mcl_dropper_dropper_front_horizontal.png" "default_furnace_side.png", "mcl_dropper_dropper_front_horizontal.png"
}, },
groups = {cracky=2}, groups = {cracky=2,container=2},
is_ground_content = false, is_ground_content = false,
paramtype2 = "facedir", paramtype2 = "facedir",
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),