mirror of
				https://github.com/mt-mods/plantlife_modpack.git
				synced 2025-10-31 05:45:24 +01:00 
			
		
		
		
	don't spawn apples too close together.
This commit is contained in:
		| @@ -1,11 +1,12 @@ | |||||||
| -- Blossom | -- Blossom | ||||||
|  |  | ||||||
| local BLOSSOM_CHANCE = 15 | local BLOSSOM_CHANCE = 15 | ||||||
| local APPLE_CHANCE = 10 |  | ||||||
| local BLOSSOM_DELAY = 3600 | local BLOSSOM_DELAY = 3600 | ||||||
|  |  | ||||||
| local BLOSSOM_NODE = "nature:blossom" | local BLOSSOM_NODE = "nature:blossom" | ||||||
|  |  | ||||||
|  | local APPLE_CHANCE = 10 | ||||||
|  | local APPLE_SPREAD = 2 | ||||||
|  |  | ||||||
| local function spawn_apple_under(pos) | local function spawn_apple_under(pos) | ||||||
|     local below = { |     local below = { | ||||||
| 		x = pos.x, | 		x = pos.x, | ||||||
| @@ -65,6 +66,8 @@ minetest.register_abm({ | |||||||
|     chance = APPLE_CHANCE, |     chance = APPLE_CHANCE, | ||||||
|  |  | ||||||
|     action = function(pos, node, active_object_count, active_object_count_wider) |     action = function(pos, node, active_object_count, active_object_count_wider) | ||||||
| 		spawn_apple_under(pos) | 		if not minetest.find_node_near(pos, APPLE_SPREAD, { "default:apple" }) then | ||||||
|  | 			spawn_apple_under(pos) | ||||||
|  | 		end | ||||||
|     end |     end | ||||||
| }) | }) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user