Add new container groups for large chests

Wuzzy 2017-08-03 22:22:17 +02:00
parent da75ea9712
commit 2416af7fac
3 changed files with 11 additions and 8 deletions

@ -137,6 +137,9 @@ These groups are used mostly for informational purposes
* `container=4`: Furnace-like, has lists `"src"`, `"fuel"` and `"dst"`. * `container=4`: Furnace-like, has lists `"src"`, `"fuel"` and `"dst"`.
It is expected that this also reacts on `on_timer`; It is expected that this also reacts on `on_timer`;
the node timer must be started from other mods when they add into `"src"` or `"fuel"` the node timer must be started from other mods when they add into `"src"` or `"fuel"`
* `container=5`: Left part of a 2-part horizontal connected container. Both parts have a `"main"` inventory
list. Both inventories are considered to belong together. This is used for large chests.
* `container=6`: Same as above, but for the right part.
* `container=1`: Other/unspecified container type * `container=1`: Other/unspecified container type
* `spawn_egg=1`: Spawn egg * `spawn_egg=1`: Spawn egg

@ -146,7 +146,7 @@ minetest.register_node("mcl_chests:"..basename.."_left", {
tiles = {"default_chest_top_big.png", "default_chest_top_big.png", "mcl_chests_chest_right.png", tiles = {"default_chest_top_big.png", "default_chest_top_big.png", "mcl_chests_chest_right.png",
"mcl_chests_chest_left.png", "default_chest_side_big.png^[transformFX", "default_chest_front_big.png"}, "mcl_chests_chest_left.png", "default_chest_side_big.png^[transformFX", "default_chest_front_big.png"},
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {handy=1,axey=1, container=2,not_in_creative_inventory=1, material_wood=1}, groups = {handy=1,axey=1, container=5,not_in_creative_inventory=1, material_wood=1},
drop = drop, drop = drop,
is_ground_content = false, is_ground_content = false,
sounds = mcl_sounds.node_sound_wood_defaults(), sounds = mcl_sounds.node_sound_wood_defaults(),
@ -254,7 +254,7 @@ minetest.register_node("mcl_chests:"..basename.."_right", {
tiles = {"default_chest_top_big.png^[transformFX", "default_chest_top_big.png^[transformFX", "mcl_chests_chest_right.png", tiles = {"default_chest_top_big.png^[transformFX", "default_chest_top_big.png^[transformFX", "mcl_chests_chest_right.png",
"mcl_chests_chest_left.png", "default_chest_side_big.png", "default_chest_front_big.png^[transformFX"}, "mcl_chests_chest_left.png", "default_chest_side_big.png", "default_chest_front_big.png^[transformFX"},
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {handy=1,axey=1, container=2,not_in_creative_inventory=1, material_wood=1}, groups = {handy=1,axey=1, container=6,not_in_creative_inventory=1, material_wood=1},
drop = drop, drop = drop,
is_ground_content = false, is_ground_content = false,
sounds = mcl_sounds.node_sound_wood_defaults(), sounds = mcl_sounds.node_sound_wood_defaults(),

@ -285,7 +285,7 @@ minetest.register_abm({
local upnode = minetest.get_node(uppos) local upnode = minetest.get_node(uppos)
if not minetest.registered_nodes[upnode.name] then return end if not minetest.registered_nodes[upnode.name] then return end
local g = minetest.registered_nodes[upnode.name].groups.container local g = minetest.registered_nodes[upnode.name].groups.container
if g == 2 or g == 3 then if g == 2 or g == 3 or g == 5 or g == 6 then
-- Typical container inventory -- Typical container inventory
mcl_util.move_item_container(uppos, "main", -1, pos) mcl_util.move_item_container(uppos, "main", -1, pos)
elseif g == 4 then elseif g == 4 then
@ -348,17 +348,17 @@ minetest.register_abm({
local abovenode = minetest.get_node(above) local abovenode = minetest.get_node(above)
if not minetest.registered_nodes[abovenode.name] then return end if not minetest.registered_nodes[abovenode.name] then return end
local g = minetest.registered_nodes[abovenode.name].groups.container local g = minetest.registered_nodes[abovenode.name].groups.container
if g == 2 or g == 3 then if g == 4 then
-- Typical container inventory
mcl_util.move_item_container(above, "main", -1, pos)
elseif g == 4 then
-- Furnace output -- Furnace output
mcl_util.move_item_container(above, "dst", -1, pos) mcl_util.move_item_container(above, "dst", -1, pos)
else
-- Typical container inventory
mcl_util.move_item_container(above, "main", -1, pos)
end end
-- Move an item from the hopper into the container to which the hopper points to -- Move an item from the hopper into the container to which the hopper points to
local g = minetest.registered_nodes[frontnode.name].groups.container local g = minetest.registered_nodes[frontnode.name].groups.container
if g == 2 then if g == 2 or g == 5 or g == 6 then
mcl_util.move_item_container(pos, "main", -1, front) mcl_util.move_item_container(pos, "main", -1, front)
elseif g == 3 then elseif g == 3 then
-- Put non-shulker boxes into shulker box -- Put non-shulker boxes into shulker box