Merge branch 'master' into luacheck-script
Before Width: | Height: | Size: 361 B After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 611 B |
Before Width: | Height: | Size: 439 B After Width: | Height: | Size: 681 B |
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 438 B After Width: | Height: | Size: 695 B |
Before Width: | Height: | Size: 415 B After Width: | Height: | Size: 650 B |
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 637 B |
Before Width: | Height: | Size: 551 B After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 523 B After Width: | Height: | Size: 729 B |
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 556 B After Width: | Height: | Size: 733 B |
@ -309,7 +309,7 @@ minetest.register_node("mcl_end:chorus_plant", {
|
||||
})
|
||||
|
||||
-- Grow a complete chorus plant at pos
|
||||
mcl_end.grow_chorus_plant = function(pos, node)
|
||||
mcl_end.grow_chorus_plant = function(pos, node, pr)
|
||||
local flowers = { pos }
|
||||
-- Plant initial flower (if it isn't there already)
|
||||
if not node then
|
||||
@ -321,7 +321,7 @@ mcl_end.grow_chorus_plant = function(pos, node)
|
||||
while true do
|
||||
local new_flowers_list = {}
|
||||
for f=1, #flowers do
|
||||
local new_flowers = mcl_end.grow_chorus_plant_step(flowers[f], minetest.get_node(flowers[f]))
|
||||
local new_flowers = mcl_end.grow_chorus_plant_step(flowers[f], minetest.get_node(flowers[f]), pr)
|
||||
if #new_flowers > 0 then
|
||||
table.insert(new_flowers_list, new_flowers)
|
||||
end
|
||||
@ -340,7 +340,7 @@ end
|
||||
|
||||
-- Grow a single step of a chorus plant at pos.
|
||||
-- Pos must be a chorus flower.
|
||||
mcl_end.grow_chorus_plant_step = function(pos, node)
|
||||
mcl_end.grow_chorus_plant_step = function(pos, node, pr)
|
||||
local new_flower_buds = {}
|
||||
local above = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
local node_above = minetest.get_node(above)
|
||||
@ -396,7 +396,7 @@ mcl_end.grow_chorus_plant_step = function(pos, node)
|
||||
|
||||
if grow_chance then
|
||||
local new_flowers = {}
|
||||
local r = math.random(1, 100)
|
||||
local r = pr:next(1, 100)
|
||||
local age = node.param2
|
||||
if r <= grow_chance then
|
||||
table.insert(new_flowers, above)
|
||||
@ -404,13 +404,13 @@ mcl_end.grow_chorus_plant_step = function(pos, node)
|
||||
age = age + 1
|
||||
local branches
|
||||
if branching == false then
|
||||
branches = math.random(1, 4)
|
||||
branches = pr:next(1, 4)
|
||||
elseif branching == true then
|
||||
branches = math.random(0, 3)
|
||||
branches = pr:next(0, 3)
|
||||
end
|
||||
local branch_grown = false
|
||||
for b=1, branches do
|
||||
local next_branch = math.random(1, #around)
|
||||
local next_branch = pr:next(1, #around)
|
||||
local branch = vector.add(pos, around[next_branch])
|
||||
local below_branch = vector.add(branch, {x=0,y=-1,z=0})
|
||||
if minetest.get_node(below_branch).name == "air" then
|
||||
@ -457,7 +457,7 @@ minetest.register_abm({
|
||||
interval = 35.0,
|
||||
chance = 4.0,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
mcl_end.grow_chorus_plant_step(pos, node)
|
||||
mcl_end.grow_chorus_plant_step(pos, node, pr)
|
||||
end,
|
||||
})
|
||||
|
||||
|
@ -3974,9 +3974,16 @@ if mg_name ~= "singlenode" then
|
||||
mcl_mapgen_core.register_generator("chorus_grow", nil, function(minp, maxp, blockseed)
|
||||
local gennotify = minetest.get_mapgen_object("gennotify")
|
||||
--local poslist = {}
|
||||
local pr = PseudoRandom(blockseed + 14)
|
||||
for _, pos in ipairs(gennotify["decoration#"..deco_id_chorus_plant] or {}) do
|
||||
local realpos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
mcl_end.grow_chorus_plant(realpos)
|
||||
local x, y, z = pos.x, pos.y, pos.z
|
||||
if x < -2 or x > 2 or z < -2 or z > 2 then
|
||||
local realpos = { x = x, y = y + 1, z = z }
|
||||
local node = minetest.get_node(realpos)
|
||||
if node and node.name == "mcl_end:chorus_flower" then
|
||||
mcl_end.grow_chorus_plant(realpos, node, pr)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
@ -1248,9 +1248,14 @@ local function generate_clay(minp, maxp, blockseed, voxelmanip_data, voxelmanip_
|
||||
end
|
||||
|
||||
local function generate_end_exit_portal(pos)
|
||||
local dragon_entity = minetest.add_entity(vector.add(pos, vector.new(3, 11, 3)), "mobs_mc:enderdragon"):get_luaentity()
|
||||
dragon_entity._initial = true
|
||||
dragon_entity._portal_pos = pos
|
||||
local obj = minetest.add_entity(vector.add(pos, vector.new(3, 11, 3)), "mobs_mc:enderdragon")
|
||||
if obj then
|
||||
local dragon_entity = obj:get_luaentity()
|
||||
dragon_entity._initial = true
|
||||
dragon_entity._portal_pos = pos
|
||||
else
|
||||
minetest.log("error", "[mcl_mapgen_core] ERROR! Ender dragon doesn't want to spawn")
|
||||
end
|
||||
mcl_structures.call_struct(pos, "end_exit_portal")
|
||||
end
|
||||
|
||||
|