1
0
mirror of https://github.com/BlockMen/invtweak.git synced 2025-06-30 07:20:47 +02:00

5 Commits

View File

@ -9,7 +9,7 @@ tweak.buttons = {
--sort_desc
"0.55,0.6;sort_desc;v]".."tooltip[sort_desc;sort Items desc.;#30434C;#FFF]",
--concatenate
"0.65,0.6;sort;<EFBFBD><EFBFBD>]".."tooltip[sort;stack Items and sort asc.;#30434C;#FFF]"
"0.65,0.6;sort;#]".."tooltip[sort;stack Items and sort asc.;#30434C;#FFF]"
}
local function get_formspec_size(formspec)
@ -191,13 +191,15 @@ end
-- tool break sound + autorefill
function refill(player, stck_name, index)
local inv = player:get_inventory()
for i,stack in ipairs(inv:get_list("main")) do
if stack:get_name() == stck_name then
inv:set_stack("main", index, stack)
stack:clear()
inv:set_stack("main", i, stack)
minetest.log("action", "Inventory Tweaks: refilled stack("..stck_name..") of " .. player:get_player_name() )
return
if inv:get_list("main") then
for i,stack in ipairs(inv:get_list("main")) do
if stack:get_name() == stck_name then
inv:set_stack("main", index, stack)
stack:clear()
inv:set_stack("main", i, stack)
minetest.log("action", "Inventory Tweaks: refilled stack("..stck_name..") of " .. player:get_player_name() )
return
end
end
end
end
@ -272,6 +274,14 @@ minetest.register_on_dignode(function(pos, oldnode, digger)
if not old and tname == "" then
old = 0
end
--debug
if not old then
old = 0
print("Debug invtweak: OLD is nil\nplayer is ")
print(name)
print("\nname is ")
print(tname)
end
local new = item:get_wear()
if old ~= new then
@ -288,3 +298,5 @@ minetest.register_on_dignode(function(pos, oldnode, digger)
end
end
end)
minetest.log("action", "[invtweak] loaded.")