forked from mtcontrib/plantlife_modpack
don't spawn apples too close together.
This commit is contained in:
parent
7b9aac91b2
commit
9032385b61
|
@ -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)
|
||||||
|
if not minetest.find_node_near(pos, APPLE_SPREAD, { "default:apple" }) then
|
||||||
spawn_apple_under(pos)
|
spawn_apple_under(pos)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user