@@ -51,10 +51,8 @@ minetest.register_node("bones:bones", {
51
51
52
52
on_metadata_inventory_take = function (pos , listname , index , stack , player )
53
53
local meta = minetest .get_meta (pos )
54
- if meta :get_string (" owner" ) ~= " " and meta :get_inventory ():is_empty (" main" ) then
55
- meta :set_string (" infotext" , meta :get_string (" owner" ).. " 's old bones" )
56
- meta :set_string (" formspec" , " " )
57
- meta :set_string (" owner" , " " )
54
+ if meta :get_inventory ():is_empty (" main" ) then
55
+ minetest .remove_node (pos )
58
56
end
59
57
end ,
60
58
@@ -82,6 +80,12 @@ minetest.register_on_dieplayer(function(player)
82
80
return
83
81
end
84
82
83
+ local player_inv = player :get_inventory ()
84
+ if player_inv :is_empty (" main" ) and
85
+ player_inv :is_empty (" craft" ) then
86
+ return
87
+ end
88
+
85
89
local pos = player :getpos ()
86
90
pos .x = math.floor (pos .x + 0.5 )
87
91
pos .y = math.floor (pos .y + 0.5 )
@@ -91,8 +95,6 @@ minetest.register_on_dieplayer(function(player)
91
95
local nn = minetest .get_node (pos ).name
92
96
if minetest .registered_nodes [nn ].can_dig and
93
97
not minetest .registered_nodes [nn ].can_dig (pos , player ) then
94
- local player_inv = player :get_inventory ()
95
-
96
98
for i = 1 ,player_inv :get_size (" main" ) do
97
99
player_inv :set_stack (" main" , i , nil )
98
100
end
@@ -107,7 +109,6 @@ minetest.register_on_dieplayer(function(player)
107
109
108
110
local meta = minetest .get_meta (pos )
109
111
local inv = meta :get_inventory ()
110
- local player_inv = player :get_inventory ()
111
112
inv :set_size (" main" , 8 * 4 )
112
113
113
114
local empty_list = inv :get_list (" main" )
0 commit comments