Remplissage du dépôt
This commit is contained in:
		
							
								
								
									
										13
									
								
								mods/automappercolors/LICENSE
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								mods/automappercolors/LICENSE
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
|             DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | ||||
|                     Version 2, December 2004 | ||||
|   | ||||
|  Copyright (C) 2015 gravgun | ||||
|   14 rue de Plaisance, 75014 Paris, France | ||||
|  Everyone is permitted to copy and distribute verbatim or modified | ||||
|  copies of this license document, and changing it is allowed as long | ||||
|  as the name is changed. | ||||
|   | ||||
|             DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | ||||
|    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | ||||
|   | ||||
|   0. You just DO WHAT THE FUCK YOU WANT TO. | ||||
							
								
								
									
										50
									
								
								mods/automappercolors/init.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								mods/automappercolors/init.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,50 @@ | ||||
| -- Automappercolors by gravgun, modified by s-l-teichmann | ||||
| -- WTFPL | ||||
|  | ||||
| function amc_dumpnodes() | ||||
| 	local fd, err = io.open(minetest.get_worldpath()..'/amc_nodes.txt', 'wb') | ||||
| 	if not fd then | ||||
| 		return 0, err | ||||
| 	end | ||||
| 	local n = 0 | ||||
| 	for name, def in pairs(minetest.registered_nodes) do | ||||
| 		if def.drawtype ~= 'airlike' then | ||||
| 			local tile = def.tiles or def.tile_images | ||||
| 			if type(tile) == 'table' then | ||||
| 				tile = tile[1] | ||||
| 				if type(tile) == 'table' then | ||||
| 					tile = tile.name | ||||
| 				end | ||||
| 			end | ||||
| 			if tile ~= nil then | ||||
| 				tile = (tile .. '^'):match('([a-zA-Z0-9\\._-]-)^') | ||||
| 				fd:write(name .. ' ' .. def.drawtype .. ' '  .. tile .. '\n') | ||||
| 				n = n + 1 | ||||
| 			end | ||||
| 		end | ||||
| 	end | ||||
| 	fd:close() | ||||
| 	return n, "done" | ||||
| end | ||||
|  | ||||
| minetest.register_chatcommand("amcdumpnodes", { | ||||
| 	params = "", | ||||
| 	description = "", | ||||
| 	func = function(plname, param) | ||||
| 		local n, msg = amc_dumpnodes() | ||||
| 		if n == 0 then | ||||
| 			minetest.chat_send_player(plname, 'io.open: ' .. msg) | ||||
| 		else | ||||
| 			minetest.chat_send_player(plname, n .. " nodes dumped.") | ||||
| 		end | ||||
| 	end, | ||||
| }) | ||||
|  | ||||
| minetest.after(1, function(args) | ||||
| 	amc_dumpnodes() | ||||
| 	if minetest.setting_getbool("log_mods") then | ||||
| 		minetest.log("action", "[automappercolors] nodes dumped") | ||||
| 	end | ||||
| end) | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user