forked from nalc/homedecor_modpack
		
	Added support for glomie's node protection mod. Like the node_ownership mod,
you can only place doors on land that is either not protected, or is protected by you (singleplayer mode is unaffected).
This commit is contained in:
		| @@ -114,6 +114,12 @@ minetest.register_node("homedecor:door_closet_mahogany_bottom_left", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
| @@ -252,6 +258,12 @@ minetest.register_node("homedecor:door_closet_mahogany_bottom_right", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
|   | |||||||
| @@ -92,6 +92,12 @@ minetest.register_node("homedecor:door_exterior_fancy_bottom_left", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
| @@ -204,6 +210,12 @@ minetest.register_node("homedecor:door_exterior_fancy_bottom_right", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
|   | |||||||
| @@ -82,6 +82,12 @@ minetest.register_node("homedecor:door_glass_bottom_left", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
| @@ -188,6 +194,12 @@ minetest.register_node("homedecor:door_glass_bottom_right", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
|   | |||||||
| @@ -94,6 +94,12 @@ minetest.register_node("homedecor:door_wood_glass_bottom_left", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
| @@ -212,6 +218,12 @@ minetest.register_node("homedecor:door_wood_glass_bottom_right", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
|   | |||||||
| @@ -94,6 +94,12 @@ minetest.register_node("homedecor:door_wood_glass_mahogany_bottom_left", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
| @@ -212,6 +218,12 @@ minetest.register_node("homedecor:door_wood_glass_mahogany_bottom_right", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
|   | |||||||
| @@ -94,6 +94,12 @@ minetest.register_node("homedecor:door_wood_glass_white_bottom_left", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
| @@ -212,6 +218,12 @@ minetest.register_node("homedecor:door_wood_glass_white_bottom_right", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
|   | |||||||
| @@ -78,6 +78,12 @@ minetest.register_node("homedecor:door_wood_plain_bottom_left", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
| @@ -180,6 +186,12 @@ minetest.register_node("homedecor:door_wood_plain_bottom_right", { | |||||||
| 				pd = false | 				pd = false | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  | 		if type(isprotect)=="function" then | ||||||
|  | 			pd = isprotect(5, pos, placer) | ||||||
|  | 			if not pd then  | ||||||
|  | 				minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
| 		if pd then | 		if pd then | ||||||
| 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | 			fdir = minetest.dir_to_facedir(placer:get_look_dir()) | ||||||
| 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | 			if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user