mirror of
				https://github.com/minetest-mods/armor_monoid.git
				synced 2025-10-31 04:55:31 +01:00 
			
		
		
		
	Compare commits
	
		
			4 Commits
		
	
	
		
			nocompatib
			...
			0f912aca2c
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 0f912aca2c | |||
| adbbe639d7 | |||
|  | 8091b1ebc0 | ||
|  | 648f35e7d6 | 
| @@ -1 +0,0 @@ | ||||
| player_monoids | ||||
| @@ -1 +0,0 @@ | ||||
| A player_monoids monoid for armor | ||||
							
								
								
									
										14
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								init.lua
									
									
									
									
									
								
							| @@ -73,21 +73,27 @@ armor_monoid.monoid = player_monoids.make_monoid({ | ||||
|  | ||||
| 		join_handled[player:get_player_name()] = true | ||||
|  | ||||
| 		player:set_armor_groups(final) | ||||
| 		if player then | ||||
| 			player:set_armor_groups(final) | ||||
| 		end | ||||
| 	end, | ||||
| }) | ||||
|  | ||||
|  | ||||
| -- If the monoid has not fired yet (or won't fire) | ||||
| minetest.register_on_joinplayer(function(player) | ||||
| 	if not join_handled[player:get_player_name()] then | ||||
| 		player:set_armor_groups(armor_groups) | ||||
| 	if player then | ||||
| 		if not join_handled[player:get_player_name()] then | ||||
| 			player:set_armor_groups(armor_groups) | ||||
| 		end | ||||
| 	end | ||||
| end) | ||||
|  | ||||
|  | ||||
| minetest.register_on_leaveplayer(function(player) | ||||
| 	if player then | ||||
| 		join_handled[player:get_player_name()] = nil | ||||
| 	end | ||||
| end) | ||||
|  | ||||
|  | ||||
| @@ -96,3 +102,5 @@ end) | ||||
| function armor_monoid.register_armor_group(name, def) | ||||
| 	armor_groups[name] = def | ||||
| end | ||||
|  | ||||
| minetest.log("action", "[armor_monoid] loaded.") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user