a-planet-alive/my_changes/minetest_game/default/i3_size.patch

68 lines
2.5 KiB
Diff

diff --git a/chests.lua b/chests.lua
index f4462ae..b8fa2e9 100644
--- a/chests.lua
+++ b/chests.lua
@@ -6,10 +6,10 @@ local S = default.get_translator
function default.chest.get_chest_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," .. pos.z
local formspec =
- "size[8,9]" ..
- "list[nodemeta:" .. spos .. ";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]" ..
+ "size[9,9]" ..
+ "list[nodemeta:" .. spos .. ";main;0,0.3;9,4;]" ..
+ "list[current_player;main;0,4.85;9,1;]" ..
+ "list[current_player;main;0,6.08;9,3;9]" ..
"listring[nodemeta:" .. spos .. ";main]" ..
"listring[current_player;main]" ..
default.get_hotbar_bg(0,4.85)
@@ -92,7 +92,7 @@ function default.chest.register_chest(prefixed_name, d)
meta:set_string("infotext", S("Locked Chest"))
meta:set_string("owner", "")
local inv = meta:get_inventory()
- inv:set_size("main", 8*4)
+ inv:set_size("main", 9*4)
end
def.after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos)
@@ -128,6 +128,10 @@ function default.chest.register_chest(prefixed_name, d)
if not default.can_interact_with_node(clicker, pos) then
return itemstack
end
+
+ local meta = minetest.get_meta(pos)
+ local inv = meta:get_inventory()
+ inv:set_size("main", 9*4)
minetest.sound_play(def.sound_open, {gain = 0.3,
pos = pos, max_hear_distance = 10}, true)
@@ -192,7 +196,7 @@ function default.chest.register_chest(prefixed_name, d)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Chest"))
local inv = meta:get_inventory()
- inv:set_size("main", 8*4)
+ inv:set_size("main", 9*4)
end
def.can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
@@ -200,6 +204,9 @@ function default.chest.register_chest(prefixed_name, d)
return inv:is_empty("main")
end
def.on_rightclick = function(pos, node, clicker)
+ local meta = minetest.get_meta(pos)
+ local inv = meta:get_inventory()
+ inv:set_size("main", 9*4)
minetest.sound_play(def.sound_open, {gain = 0.3, pos = pos,
max_hear_distance = 10}, true)
if not default.chest.chest_lid_obstructed(pos) then
@@ -281,7 +288,7 @@ function default.chest.register_chest(prefixed_name, d)
local inv = meta:get_inventory()
local list = inv:get_list("default:chest")
if list then
- inv:set_size("main", 8*4)
+ inv:set_size("main", 9*4)
inv:set_list("main", list)
inv:set_list("default:chest", nil)
end