mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 20:11:06 +01:00
Hooper formspec
This commit is contained in:
parent
452cd26558
commit
1065eb4d8c
2 changed files with 43 additions and 38 deletions
|
@ -366,8 +366,6 @@ local function set_inventory(player, armor_change_only)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
player:set_inventory_formspec(mcl_inventory.build_survival_formspec(player))
|
player:set_inventory_formspec(mcl_inventory.build_survival_formspec(player))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -436,7 +434,7 @@ function mcl_inventory.update_inventory(player, armor_change_only)
|
||||||
local player_gamemode = mcl_gamemode.get_gamemode(player)
|
local player_gamemode = mcl_gamemode.get_gamemode(player)
|
||||||
if player_gamemode == "creative" then
|
if player_gamemode == "creative" then
|
||||||
if armor_change_only then
|
if armor_change_only then
|
||||||
-- Stay on survival inventory plage if only the armor has been changed
|
-- Stay on survival inventory page if only the armor has been changed
|
||||||
mcl_inventory.set_creative_formspec(player, 0, 0, nil, nil, "inv")
|
mcl_inventory.set_creative_formspec(player, 0, 0, nil, nil, "inv")
|
||||||
else
|
else
|
||||||
mcl_inventory.set_creative_formspec(player, 0, 1)
|
mcl_inventory.set_creative_formspec(player, 0, 1)
|
||||||
|
|
|
@ -12,17 +12,24 @@ end
|
||||||
--[[ BEGIN OF NODE DEFINITIONS ]]
|
--[[ BEGIN OF NODE DEFINITIONS ]]
|
||||||
|
|
||||||
local mcl_hoppers_formspec = table.concat({
|
local mcl_hoppers_formspec = table.concat({
|
||||||
"size[9,7]",
|
"formspec_version[4]",
|
||||||
"label[2,0;"..F(C(mcl_formspec.label_color, S("Hopper"))).."]",
|
"size[11.75,8.175]",
|
||||||
"list[context;main;2,0.5;5,1;]",
|
|
||||||
mcl_formspec.get_itemslot_bg(2,0.5,5,1),
|
"label[0.375,0.375;" .. F(C(mcl_formspec.label_color, S("Hopper"))) .. "]",
|
||||||
"label[0,2;"..F(C(mcl_formspec.label_color, S("Inventory"))).."]",
|
|
||||||
"list[current_player;main;0,2.5;9,3;9]",
|
mcl_formspec.get_itemslot_bg_v4(2.875, 0.75, 5, 1),
|
||||||
mcl_formspec.get_itemslot_bg(0,2.5,9,3),
|
"list[context;main;2.875,0.75;5,1;]",
|
||||||
"list[current_player;main;0,5.74;9,1;]",
|
|
||||||
mcl_formspec.get_itemslot_bg(0,5.74,9,1),
|
"label[0.375,2.45;" .. F(C(mcl_formspec.label_color, S("Inventory"))) .. "]",
|
||||||
|
|
||||||
|
mcl_formspec.get_itemslot_bg_v4(0.375, 2.85, 9, 3),
|
||||||
|
"list[current_player;main;0.375,2.85;9,3;9]",
|
||||||
|
|
||||||
|
mcl_formspec.get_itemslot_bg_v4(0.375, 6.8, 9, 1),
|
||||||
|
"list[current_player;main;0.375,6.8;9,1;]",
|
||||||
|
|
||||||
"listring[context;main]",
|
"listring[context;main]",
|
||||||
"listring[current_player;main]"
|
"listring[current_player;main]",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Downwards hopper (base definition)
|
-- Downwards hopper (base definition)
|
||||||
|
@ -31,7 +38,7 @@ local mcl_hoppers_formspec = table.concat({
|
||||||
local def_hopper = {
|
local def_hopper = {
|
||||||
inventory_image = "mcl_hoppers_item.png",
|
inventory_image = "mcl_hoppers_item.png",
|
||||||
wield_image = "mcl_hoppers_item.png",
|
wield_image = "mcl_hoppers_item.png",
|
||||||
groups = {pickaxey = 1, container = 2, deco_block = 1, hopper = 1},
|
groups = { pickaxey = 1, container = 2, deco_block = 1, hopper = 1 },
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
-- FIXME: mcl_hoppers_hopper_inside.png is unused by hoppers.
|
-- FIXME: mcl_hoppers_hopper_inside.png is unused by hoppers.
|
||||||
|
@ -47,25 +54,25 @@ local def_hopper = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
--funnel walls
|
--funnel walls
|
||||||
{-0.5, 0.0, 0.4, 0.5, 0.5, 0.5},
|
{ -0.5, 0.0, 0.4, 0.5, 0.5, 0.5 },
|
||||||
{0.4, 0.0, -0.5, 0.5, 0.5, 0.5},
|
{ 0.4, 0.0, -0.5, 0.5, 0.5, 0.5 },
|
||||||
{-0.5, 0.0, -0.5, -0.4, 0.5, 0.5},
|
{ -0.5, 0.0, -0.5, -0.4, 0.5, 0.5 },
|
||||||
{-0.5, 0.0, -0.5, 0.5, 0.5, -0.4},
|
{ -0.5, 0.0, -0.5, 0.5, 0.5, -0.4 },
|
||||||
--funnel base
|
--funnel base
|
||||||
{-0.5, 0.0, -0.5, 0.5, 0.1, 0.5},
|
{ -0.5, 0.0, -0.5, 0.5, 0.1, 0.5 },
|
||||||
--spout
|
--spout
|
||||||
{-0.3, -0.3, -0.3, 0.3, 0.0, 0.3},
|
{ -0.3, -0.3, -0.3, 0.3, 0.0, 0.3 },
|
||||||
{-0.1, -0.3, -0.1, 0.1, -0.5, 0.1},
|
{ -0.1, -0.3, -0.1, 0.1, -0.5, 0.1 },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
--funnel
|
--funnel
|
||||||
{-0.5, 0.0, -0.5, 0.5, 0.5, 0.5},
|
{ -0.5, 0.0, -0.5, 0.5, 0.5, 0.5 },
|
||||||
--spout
|
--spout
|
||||||
{-0.3, -0.3, -0.3, 0.3, 0.0, 0.3},
|
{ -0.3, -0.3, -0.3, 0.3, 0.0, 0.3 },
|
||||||
{-0.1, -0.3, -0.1, 0.1, -0.5, 0.1},
|
{ -0.1, -0.3, -0.1, 0.1, -0.5, 0.1 },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
|
@ -248,25 +255,25 @@ local def_hopper_side = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
--funnel walls
|
--funnel walls
|
||||||
{-0.5, 0.0, 0.4, 0.5, 0.5, 0.5},
|
{ -0.5, 0.0, 0.4, 0.5, 0.5, 0.5 },
|
||||||
{0.4, 0.0, -0.5, 0.5, 0.5, 0.5},
|
{ 0.4, 0.0, -0.5, 0.5, 0.5, 0.5 },
|
||||||
{-0.5, 0.0, -0.5, -0.4, 0.5, 0.5},
|
{ -0.5, 0.0, -0.5, -0.4, 0.5, 0.5 },
|
||||||
{-0.5, 0.0, -0.5, 0.5, 0.5, -0.4},
|
{ -0.5, 0.0, -0.5, 0.5, 0.5, -0.4 },
|
||||||
--funnel base
|
--funnel base
|
||||||
{-0.5, 0.0, -0.5, 0.5, 0.1, 0.5},
|
{ -0.5, 0.0, -0.5, 0.5, 0.1, 0.5 },
|
||||||
--spout
|
--spout
|
||||||
{-0.3, -0.3, -0.3, 0.3, 0.0, 0.3},
|
{ -0.3, -0.3, -0.3, 0.3, 0.0, 0.3 },
|
||||||
{-0.5, -0.3, -0.1, 0.1, -0.1, 0.1},
|
{ -0.5, -0.3, -0.1, 0.1, -0.1, 0.1 },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
--funnel
|
--funnel
|
||||||
{-0.5, 0.0, -0.5, 0.5, 0.5, 0.5},
|
{ -0.5, 0.0, -0.5, 0.5, 0.5, 0.5 },
|
||||||
--spout
|
--spout
|
||||||
{-0.3, -0.3, -0.3, 0.3, 0.0, 0.3},
|
{ -0.3, -0.3, -0.3, 0.3, 0.0, 0.3 },
|
||||||
{-0.5, -0.3, -0.1, 0.1, -0.1, 0.1},
|
{ -0.5, -0.3, -0.1, 0.1, -0.1, 0.1 },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
|
@ -559,8 +566,8 @@ end
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
label = "Hopper/container item exchange",
|
label = "Hopper/container item exchange",
|
||||||
nodenames = {"mcl_hoppers:hopper"},
|
nodenames = { "mcl_hoppers:hopper" },
|
||||||
neighbors = {"group:container"},
|
neighbors = { "group:container" },
|
||||||
interval = 1.0,
|
interval = 1.0,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
|
@ -591,8 +598,8 @@ minetest.register_abm({
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
label = "Side-hopper/container item exchange",
|
label = "Side-hopper/container item exchange",
|
||||||
nodenames = {"mcl_hoppers:hopper_side"},
|
nodenames = { "mcl_hoppers:hopper_side" },
|
||||||
neighbors = {"group:container"},
|
neighbors = { "group:container" },
|
||||||
interval = 1.0,
|
interval = 1.0,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
|
|
Loading…
Reference in a new issue