mirror of
https://github.com/BlockMen/invtweak.git
synced 2025-06-30 15:30:42 +02:00
Compare commits
3 Commits
v2.0.1-bet
...
nalc-1.0
Author | SHA1 | Date | |
---|---|---|---|
4fa4977478 | |||
1911b5d160 | |||
e429300d4e |
12
init.lua
12
init.lua
@ -191,6 +191,7 @@ end
|
||||
-- tool break sound + autorefill
|
||||
function refill(player, stck_name, index)
|
||||
local inv = player:get_inventory()
|
||||
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)
|
||||
@ -200,6 +201,7 @@ function refill(player, stck_name, index)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if auto_refill == true then
|
||||
@ -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.")
|
||||
|
Reference in New Issue
Block a user