@@ -10,22 +10,25 @@ function creative.init_creative_inventory(player)
10
10
11
11
minetest .create_detached_inventory (" creative_" .. player_name , {
12
12
allow_move = function (inv , from_list , from_index , to_list , to_index , count , player2 )
13
- if not to_list == " main " then
14
- return count
15
- else
13
+ local name = player2 and player2 : get_player_name () or " "
14
+ if not creative . is_enabled_for ( name ) or
15
+ to_list == " main " then
16
16
return 0
17
17
end
18
+ return count
18
19
end ,
19
20
allow_put = function (inv , listname , index , stack , player2 )
20
21
return 0
21
22
end ,
22
23
allow_take = function (inv , listname , index , stack , player2 )
24
+ local name = player2 and player2 :get_player_name () or " "
25
+ if not creative .is_enabled_for (name ) then
26
+ return 0
27
+ end
23
28
return - 1
24
29
end ,
25
30
on_move = function (inv , from_list , from_index , to_list , to_index , count , player2 )
26
31
end ,
27
- on_put = function (inv , listname , index , stack , player2 )
28
- end ,
29
32
on_take = function (inv , listname , index , stack , player2 )
30
33
if stack and stack :get_count () > 0 then
31
34
minetest .log (" action" , player_name .. " takes " .. stack :get_name ().. " from creative inventory" )
0 commit comments