forked from mtcontrib/homedecor_modpack
		
	verify inbox owner when taking items
This commit is contained in:
		
				
					committed by
					
						 Vanessa Ezekowitz
						Vanessa Ezekowitz
					
				
			
			
				
	
			
			
			
						parent
						
							7925897748
						
					
				
				
					commit
					ad4790f74c
				
			| @@ -92,6 +92,19 @@ minetest.register_node("inbox:empty", { | |||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
| 	end, | 	end, | ||||||
|  | 	allow_metadata_inventory_take = function(pos, listname, index, stack, player) | ||||||
|  | 		local meta = minetest.get_meta(pos) | ||||||
|  | 		local owner = meta:get_string("owner") | ||||||
|  | 		if player:get_player_name() == owner or | ||||||
|  | 				minetest.check_player_privs(player, "protection_bypass") and | ||||||
|  | 				clicker:get_player_control().aux1 then | ||||||
|  | 			return stack:get_count() | ||||||
|  | 		end | ||||||
|  | 		return 0 | ||||||
|  | 	end, | ||||||
|  | 	allow_metadata_inventory_move = function(pos) | ||||||
|  | 		return 0 | ||||||
|  | 	end, | ||||||
| }) | }) | ||||||
|  |  | ||||||
| function inbox.get_inbox_formspec(pos) | function inbox.get_inbox_formspec(pos) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user