Fix some formatting issues

This commit is contained in:
Mikita Wiśniewski 2022-03-25 11:20:07 +07:00
parent 833e32410e
commit 297f9ba11a
3 changed files with 355 additions and 328 deletions

View File

@ -246,4 +246,4 @@ water-16,
water) water)
--spawn egg --spawn egg
mobs:register_egg("extra_mobs:dolphin", S("dolphin"), "extra_mobs_spawn_icon_dolphin.png", 0) mobs:register_egg("extra_mobs:dolphin", S("Dolphin"), "extra_mobs_spawn_icon_dolphin.png", 0)

View File

@ -296,5 +296,5 @@ minetest.LIGHT_MAX+1,
mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_min,
mobs_mc.spawn_height.nether_max) mobs_mc.spawn_height.nether_max)
-- spawn eggs -- spawn eggs
mobs:register_egg("extra_mobs:piglin", S("piglin"), "extra_mobs_spawn_icon_piglin.png", 0) mobs:register_egg("extra_mobs:piglin", S("Piglin"), "extra_mobs_spawn_icon_piglin.png", 0)
mobs:register_egg("extra_mobs:piglin_brute", S("piglin Brute"), "extra_mobs_spawn_icon_piglin.png", 0) mobs:register_egg("extra_mobs:piglin_brute", S("Piglin Brute"), "extra_mobs_spawn_icon_piglin.png", 0)

View File

@ -3,7 +3,7 @@ local S = minetest.get_translator("mcl_mushroom")
-- function grow() -- function grow()
function grow_twisting_vines(pos, moreontop) function grow_twisting_vines(pos, moreontop)
local y = pos.y + 1 local y = pos.y + 1
while not (moreontop == 0) do while not (moreontop == 0) do
if minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air" then if minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air" then
minetest.set_node({x = pos.x, y = y, z = pos.z}, {name="mcl_mushroom:twisting_vines"}) minetest.set_node({x = pos.x, y = y, z = pos.z}, {name="mcl_mushroom:twisting_vines"})
moreontop = moreontop - 1 moreontop = moreontop - 1
@ -13,18 +13,18 @@ function grow_twisting_vines(pos, moreontop)
else else
moreontop = 0 moreontop = 0
end end
end end
end end
-- Warped fungus -- Warped fungus
-- Crimson fungus -- Crimson fungus
--Functions and Biomes -- Functions and Biomes
-- WARNING: The most comments are in german. Please Translate with an translater if you don't speak good german -- WARNING: The most comments are in german. Please Translate with an translater if you don't speak good german
minetest.register_node("mcl_mushroom:warped_fungus", { minetest.register_node("mcl_mushroom:warped_fungus", {
description = S("Warped Fungus Mushroom"), description = S("Warped Fungus Mushroom"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = { "farming_warped_fungus.png" }, tiles = { "farming_warped_fungus.png" },
inventory_image = "farming_warped_fungus.png", inventory_image = "farming_warped_fungus.png",
@ -33,7 +33,6 @@ minetest.register_node("mcl_mushroom:warped_fungus", {
paramtype = "light", paramtype = "light",
walkable = false, walkable = false,
groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, compostability=65}, groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, compostability=65},
light_source = 1, light_source = 1,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
@ -43,22 +42,22 @@ minetest.register_node("mcl_mushroom:warped_fungus", {
on_rightclick = function(pos, node, pointed_thing, itemstack) on_rightclick = function(pos, node, pointed_thing, itemstack)
if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then
itemstack:take_item() itemstack:take_item()
local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
if nodepos.name == "mcl_mushroom:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then if nodepos.name == "mcl_mushroom:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then
local random = math.random(1, 5) local random = math.random(1, 5)
if random == 1 then if random == 1 then
generate_warped_tree(pos) generate_warped_tree(pos)
end end
end end
end end
end, end,
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
stack_max = 64, stack_max = 64,
}) })
minetest.register_node("mcl_mushroom:twisting_vines", { minetest.register_node("mcl_mushroom:twisting_vines", {
description = S("Twisting Vines"), description = S("Twisting Vines"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = { "twisting_vines_plant.png" }, tiles = { "twisting_vines_plant.png" },
inventory_image = "twisting_vines.png", inventory_image = "twisting_vines.png",
@ -117,12 +116,12 @@ minetest.register_node("mcl_mushroom:nether_sprouts", {
drop = "", drop = "",
_mcl_shears_drop = true, _mcl_shears_drop = true,
_mcl_silk_touch_drop = false, _mcl_silk_touch_drop = false,
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
stack_max = 64, stack_max = 64,
}) })
minetest.register_node("mcl_mushroom:warped_roots", { minetest.register_node("mcl_mushroom:warped_roots", {
description = S("Warped Roots"), description = S("Warped Roots"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = { "warped_roots.png" }, tiles = { "warped_roots.png" },
inventory_image = "warped_roots.png", inventory_image = "warped_roots.png",
@ -137,26 +136,26 @@ minetest.register_node("mcl_mushroom:warped_roots", {
}, },
node_placement_prediction = "", node_placement_prediction = "",
_mcl_silk_touch_drop = false, _mcl_silk_touch_drop = false,
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
stack_max = 64, stack_max = 64,
}) })
minetest.register_node("mcl_mushroom:warped_wart_block", { minetest.register_node("mcl_mushroom:warped_wart_block", {
description = S("Warped Wart Block"), description = S("Warped Wart Block"),
tiles = {"warped_wart_block.png"}, tiles = {"warped_wart_block.png"},
groups = {handy=1,hoe=7,swordy=1, compostability=85, deco_block=1, }, groups = {handy=1,hoe=7,swordy=1, compostability=85, deco_block=1, },
stack_max = 64, stack_max = 64,
_mcl_hardness = 2, _mcl_hardness = 2,
}) })
minetest.register_node("mcl_mushroom:shroomlight", { minetest.register_node("mcl_mushroom:shroomlight", {
description = S("Shroomlight"), description = S("Shroomlight"),
tiles = {"shroomlight.png"}, tiles = {"shroomlight.png"},
groups = {handy=1,hoe=7,swordy=1, leaves=1, deco_block=1, compostability=65, }, groups = {handy=1,hoe=7,swordy=1, leaves=1, deco_block=1, compostability=65, },
stack_max = 64, stack_max = 64,
_mcl_hardness = 2, _mcl_hardness = 2,
-- this is 15 in Minecraft -- this is 15 in Minecraft
light_source = 14, light_source = 14,
}) })
minetest.register_node("mcl_mushroom:warped_hyphae", { minetest.register_node("mcl_mushroom:warped_hyphae", {
@ -212,29 +211,29 @@ minetest.register_node("mcl_mushroom:warped_checknode", {
}) })
minetest.register_node("mcl_mushroom:warped_hyphae_wood", { minetest.register_node("mcl_mushroom:warped_hyphae_wood", {
description = S("Warped Hyphae Wood"), description = S("Warped Hyphae Wood"),
tiles = {"warped_hyphae_wood.png"}, tiles = {"warped_hyphae_wood.png"},
groups = {handy=5,axey=1, flammable=3,wood=1,building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=20}, groups = {handy=5,axey=1, flammable=3,wood=1,building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
paramtype2 = "facedir", --paramtype2 = "facedir",
stack_max = 64, stack_max = 64,
_mcl_hardness = 2, _mcl_hardness = 2,
}) })
mcl_stairs.register_stair_and_slab_simple("warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood", S("Warped Stair"), S("Warped Slab"), S("Double Warped Slab")) mcl_stairs.register_stair_and_slab_simple("warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood", S("Warped Stair"), S("Warped Slab"), S("Double Warped Slab"), "woodlike")
minetest.register_craft({ minetest.register_craft({
output = "mcl_mushroom:warped_hyphae_wood 4", output = "mcl_mushroom:warped_hyphae_wood 4",
recipe = { recipe = {
{"mcl_mushroom:warped_hyphae"}, {"mcl_mushroom:warped_hyphae"},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "mcl_mushroom:warped_nylium 2", output = "mcl_mushroom:warped_nylium 2",
recipe = { recipe = {
{"mcl_mushroom:warped_wart_block"}, {"mcl_mushroom:warped_wart_block"},
{"mcl_nether:netherrack"}, {"mcl_nether:netherrack"},
} }
}) })
minetest.register_abm({ minetest.register_abm({
@ -245,11 +244,11 @@ minetest.register_abm({
action = function(pos) action = function(pos)
local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
if nodepos.name == "mcl_mushroom:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then if nodepos.name == "mcl_mushroom:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then
if pos.y < -28400 then if pos.y < -28400 then
generate_warped_tree(pos) generate_warped_tree(pos)
end end
end end
end end
}) })
minetest.register_abm({ minetest.register_abm({
@ -260,27 +259,26 @@ minetest.register_abm({
action = function(pos) action = function(pos)
local nodepos = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}) local nodepos = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z})
if nodepos.name == "air" then if nodepos.name == "air" then
minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_mushroom:warped_nylium" }) minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_mushroom:warped_nylium" })
local randomg = math.random(1, 400) local randomg = math.random(1, 400)
if randomg <= 5 then if randomg <= 5 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_fungus" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_fungus" })
elseif randomg > 5 and randomg <= 15 then elseif randomg > 5 and randomg <= 15 then
local pos1 = { x = pos.x, y = pos.y + 1, z = pos.z } local pos1 = { x = pos.x, y = pos.y + 1, z = pos.z }
generate_warped_tree(pos1) generate_warped_tree(pos1)
elseif randomg > 15 and randomg <= 45 then elseif randomg > 15 and randomg <= 45 then
grow_twisting_vines({ x = pos.x, y = pos.y, z = pos.z } ,math.random(1, 4)) grow_twisting_vines({ x = pos.x, y = pos.y, z = pos.z } ,math.random(1, 4))
elseif randomg > 45 and randomg <= 50 then elseif randomg > 45 and randomg <= 50 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_fungus" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_fungus" })
elseif randomg > 50 and randomg <= 150 then elseif randomg > 50 and randomg <= 150 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:nether_sprouts" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:nether_sprouts" })
elseif randomg > 150 and randomg <= 250 then elseif randomg > 150 and randomg <= 250 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_roots" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_roots" })
end end
else else
minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_nether:netherrack" }) minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_nether:netherrack" })
end end
end end
}) })
@ -297,7 +295,7 @@ minetest.register_abm({
minetest.register_node("mcl_mushroom:crimson_fungus", { minetest.register_node("mcl_mushroom:crimson_fungus", {
description = S("Crimson Fungus Mushroom"), description = S("Crimson Fungus Mushroom"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = { "farming_crimson_fungus.png" }, tiles = { "farming_crimson_fungus.png" },
inventory_image = "farming_crimson_fungus.png", inventory_image = "farming_crimson_fungus.png",
@ -306,7 +304,6 @@ minetest.register_node("mcl_mushroom:crimson_fungus", {
paramtype = "light", paramtype = "light",
walkable = false, walkable = false,
groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,enderman_takable=1,deco_block=1, compostability=65}, groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,enderman_takable=1,deco_block=1, compostability=65},
light_source = 1, light_source = 1,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
@ -315,23 +312,22 @@ minetest.register_node("mcl_mushroom:crimson_fungus", {
node_placement_prediction = "", node_placement_prediction = "",
on_rightclick = function(pos, node, pointed_thing, itemstack) on_rightclick = function(pos, node, pointed_thing, itemstack)
if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then
itemstack:take_item() itemstack:take_item()
local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
if nodepos.name == "mcl_mushroom:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then if nodepos.name == "mcl_mushroom:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then
local random = math.random(1, 5) local random = math.random(1, 5)
if random == 1 then if random == 1 then
generate_crimson_tree(pos) generate_crimson_tree(pos)
end end
end end
end end
end, end,
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
stack_max = 64,
stack_max = 64,
}) })
minetest.register_node("mcl_mushroom:crimson_roots", { minetest.register_node("mcl_mushroom:crimson_roots", {
description = S("Crimson Roots"), description = S("Crimson Roots"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = { "crimson_roots.png" }, tiles = { "crimson_roots.png" },
inventory_image = "crimson_roots.png", inventory_image = "crimson_roots.png",
@ -346,87 +342,90 @@ minetest.register_node("mcl_mushroom:crimson_roots", {
}, },
node_placement_prediction = "", node_placement_prediction = "",
_mcl_silk_touch_drop = false, _mcl_silk_touch_drop = false,
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
stack_max = 64, stack_max = 64,
}) })
minetest.register_node("mcl_mushroom:crimson_hyphae", { minetest.register_node("mcl_mushroom:crimson_hyphae", {
description = S("Crimson Hyphae"), description = S("Crimson Hyphae"),
tiles = {"crimson_hyphae.png", tiles = {
"crimson_hyphae.png", "crimson_hyphae.png",
"crimson_hyphae_side.png", "crimson_hyphae.png",
"crimson_hyphae_side.png", "crimson_hyphae_side.png",
"crimson_hyphae_side.png", "crimson_hyphae_side.png",
"crimson_hyphae_side.png", "crimson_hyphae_side.png",
}, "crimson_hyphae_side.png",
groups = {handy=5,axey=1, bark=1, building_block=1, material_wood=1,}, },
paramtype2 = "facedir", groups = {handy=5,axey=1, bark=1, building_block=1, material_wood=1,},
stack_max = 64, paramtype2 = "facedir",
_mcl_hardness = 2, stack_max = 64,
_mcl_hardness = 2,
}) })
minetest.register_node("mcl_mushroom:crimson_hyphae_wood", { minetest.register_node("mcl_mushroom:crimson_hyphae_wood", {
description = S("Crimson Hyphae Wood"), description = S("Crimson Hyphae Wood"),
tiles = {"crimson_hyphae_wood.png"}, tiles = {"crimson_hyphae_wood.png"},
groups = {handy=5,axey=1, wood=1,building_block=1, material_wood=1,}, groups = {handy=5,axey=1, wood=1,building_block=1, material_wood=1,},
paramtype2 = "facedir", paramtype2 = "facedir",
stack_max = 64, stack_max = 64,
_mcl_hardness = 2, _mcl_hardness = 2,
}) })
minetest.register_node("mcl_mushroom:crimson_nylium", { minetest.register_node("mcl_mushroom:crimson_nylium", {
description = S("Crimson Nylium"), description = S("Crimson Nylium"),
tiles = {"crimson_nylium.png", tiles = {
"mcl_nether_netherrack.png", "crimson_nylium.png",
"mcl_nether_netherrack.png^crimson_nylium_side.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png^crimson_nylium_side.png", "mcl_nether_netherrack.png^crimson_nylium_side.png",
"mcl_nether_netherrack.png^crimson_nylium_side.png", "mcl_nether_netherrack.png^crimson_nylium_side.png",
"mcl_nether_netherrack.png^crimson_nylium_side.png", "mcl_nether_netherrack.png^crimson_nylium_side.png",
}, "mcl_nether_netherrack.png^crimson_nylium_side.png",
groups = {pickaxey=1, building_block=1, material_stone=1}, },
paramtype2 = "facedir", groups = {pickaxey=1, building_block=1, material_stone=1},
stack_max = 64, paramtype2 = "facedir",
_mcl_hardness = 0.4, stack_max = 64,
_mcl_blast_resistance = 0.4, _mcl_hardness = 0.4,
is_ground_content = true, _mcl_blast_resistance = 0.4,
drop = "mcl_nether:netherrack", is_ground_content = true,
_mcl_silk_touch_drop = true, drop = "mcl_nether:netherrack",
_mcl_silk_touch_drop = true,
}) })
minetest.register_node("mcl_mushroom:crimson_checknode", { minetest.register_node("mcl_mushroom:crimson_checknode", {
description = S("Crimson Checknode - only to check!"), description = S("Crimson Checknode - only to check!"),
tiles = {"mcl_nether_netherrack.png", tiles = {
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
"mcl_nether_netherrack.png", "mcl_nether_netherrack.png",
}, "mcl_nether_netherrack.png",
groups = {pickaxey=1, building_block=1, material_stone=1, not_in_creative_inventory=1}, },
paramtype2 = "facedir", groups = {pickaxey=1, building_block=1, material_stone=1, not_in_creative_inventory=1},
stack_max = 64, paramtype2 = "facedir",
_mcl_hardness = 0.4, stack_max = 64,
_mcl_blast_resistance = 0.4, _mcl_hardness = 0.4,
is_ground_content = true, _mcl_blast_resistance = 0.4,
drop = "mcl_nether:netherrack" is_ground_content = true,
drop = "mcl_nether:netherrack"
}) })
minetest.register_craft({ minetest.register_craft({
output = "mcl_mushroom:crimson_hyphae_wood 4", output = "mcl_mushroom:crimson_hyphae_wood 4",
recipe = { recipe = {
{"mcl_mushroom:crimson_hyphae"}, {"mcl_mushroom:crimson_hyphae"},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "mcl_mushroom:crimson_nylium 2", output = "mcl_mushroom:crimson_nylium 2",
recipe = { recipe = {
{"mcl_nether:nether_wart"}, {"mcl_nether:nether_wart"},
{"mcl_nether:netherrack"}, {"mcl_nether:netherrack"},
} }
}) })
mcl_stairs.register_stair_and_slab_simple("crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood", "Crimson Stair", "Crimson Slab", "Double Crimson Slab") mcl_stairs.register_stair_and_slab_simple("crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood", "Crimson Stair", "Crimson Slab", "Double Crimson Slab", "woodlike")
minetest.register_abm({ minetest.register_abm({
label = "mcl_mushroom:crimson_fungus", label = "mcl_mushroom:crimson_fungus",
@ -436,11 +435,11 @@ minetest.register_abm({
action = function(pos) action = function(pos)
local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
if nodepos.name == "mcl_mushroom:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then if nodepos.name == "mcl_mushroom:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then
if pos.y < -28400 then if pos.y < -28400 then
generate_crimson_tree(pos) generate_crimson_tree(pos)
end end
end end
end end
}) })
minetest.register_abm({ minetest.register_abm({
@ -451,176 +450,204 @@ minetest.register_abm({
action = function(pos) action = function(pos)
local nodepos = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}) local nodepos = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z})
if nodepos.name == "air" then if nodepos.name == "air" then
minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_mushroom:crimson_nylium" }) minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_mushroom:crimson_nylium" })
local randomg = math.random(1, 400) local randomg = math.random(1, 400)
if randomg <= 10 then if randomg <= 10 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_fungus" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_fungus" })
elseif randomg > 10 and randomg <= 25 then elseif randomg > 10 and randomg <= 25 then
local pos1 = { x = pos.x, y = pos.y + 1, z = pos.z } local pos1 = { x = pos.x, y = pos.y + 1, z = pos.z }
generate_crimson_tree(pos1) generate_crimson_tree(pos1)
elseif randomg > 25 and randomg <= 30 then elseif randomg > 25 and randomg <= 30 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_fungus" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:warped_fungus" })
elseif randomg > 30 and randomg <= 130 then elseif randomg > 30 and randomg <= 130 then
minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_roots" }) minetest.set_node({ x = pos.x, y = pos.y + 1, z = pos.z }, { name = "mcl_mushroom:crimson_roots" })
end end
else else
minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_nether:netherrack" }) minetest.swap_node({ x = pos.x, y = pos.y, z = pos.z }, { name = "mcl_nether:netherrack" })
end end
end end
}) })
function generate_warped_tree(pos) function generate_warped_tree(pos)
local breakgrow = false local breakgrow = false
local breakgrow2 = false local breakgrow2 = false
-- Baumgenerator -- Tree generator
-- erste und zweite Etage -- first and second floor
for x = pos.x - 2,pos.x + 2 do for x = pos.x - 2,pos.x + 2 do
for y = pos.y + 3, pos.y + 4 do for y = pos.y + 3, pos.y + 4 do
for z = pos.z - 2, pos.z + 2 do for z = pos.z - 2, pos.z + 2 do
if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then breakgrow = true end if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then
end breakgrow = true
end
end end
end end
end
-- dritte und vierte Etage -- third and fourth floors
for x = pos.x - 1,pos.x + 1 do for x = pos.x - 1,pos.x + 1 do
for y = pos.y + 5, pos.y + 6 do for y = pos.y + 5, pos.y + 6 do
for z = pos.z - 1, pos.z + 1 do for z = pos.z - 1, pos.z + 1 do
if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then breakgrow = true end if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then
end breakgrow = true
end end
end end
end
end
-- fünfte Etage -- fifth floor
if not (minetest.get_node({x = pos.x, y = pos.y + 7, z = pos.z}).name == "air") then breakgrow = true end if not (minetest.get_node({x = pos.x, y = pos.y + 7, z = pos.z}).name == "air") then
breakgrow = true
end
-- Holz -- Wood
if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:warped_fungus") then breakgrow = true end if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:warped_fungus") then
for y = pos.y + 1, pos.y + 4 do breakgrow = true
if not (minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air") then breakgrow = true end end
end for y = pos.y + 1, pos.y + 4 do
if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:warped_fungus") then breakgrow2 = true end if not (minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air") then
if breakgrow == false then breakgrow = true
-- Warzen end
-- erste und zweite Etage end
for x = pos.x - 2,pos.x + 2 do if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:warped_fungus") then
for y = pos.y + 3, pos.y + 4 do breakgrow2 = true
for z = pos.z - 2, pos.z + 2 do end
minetest.set_node({x = x, y = y, z = z}, { name = "mcl_mushroom:warped_wart_block" }) if breakgrow == false then
end -- Warts
end -- first and second floor
end for x = pos.x - 2,pos.x + 2 do
for y = pos.y + 3, pos.y + 4 do
for z = pos.z - 2, pos.z + 2 do
minetest.set_node({x = x, y = y, z = z}, { name = "mcl_mushroom:warped_wart_block" })
end
end
end
-- dritte und vierte Etage -- third and fourth floors
for x = pos.x - 1,pos.x + 1 do for x = pos.x - 1,pos.x + 1 do
for y = pos.y + 5, pos.y + 6 do for y = pos.y + 5, pos.y + 6 do
for z = pos.z - 1, pos.z + 1 do for z = pos.z - 1, pos.z + 1 do
minetest.set_node({x = x, y = y, z = z}, { name = "mcl_mushroom:warped_wart_block" }) minetest.set_node({x = x, y = y, z = z}, { name = "mcl_mushroom:warped_wart_block" })
end end
end end
end end
-- fünfte Etage -- fifth floor
minetest.set_node({x = pos.x, y = pos.y + 7, z = pos.z}, { name = "mcl_mushroom:warped_wart_block" }) minetest.set_node({x = pos.x, y = pos.y + 7, z = pos.z}, { name = "mcl_mushroom:warped_wart_block" })
-- Pilzlich -- Fungal
local randomgenerate = math.random(1, 2) local randomgenerate = math.random(1, 2)
if randomgenerate == 1 then if randomgenerate == 1 then
local randomx = math.random(-2, 2) local randomx = math.random(-2, 2)
local randomz = math.random(-2, 2) local randomz = math.random(-2, 2)
minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" })
end end
local randomgenerate = math.random(1, 8) local randomgenerate = math.random(1, 8)
if randomgenerate == 4 then if randomgenerate == 4 then
local randomx = math.random(-2, 2) local randomx = math.random(-2, 2)
local randomz = math.random(-2, 2) local randomz = math.random(-2, 2)
minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" })
end end
-- Holz -- Wood
for y = pos.y, pos.y + 4 do for y = pos.y, pos.y + 4 do
minetest.set_node({x = pos.x, y = y, z = pos.z}, { name = "mcl_mushroom:warped_hyphae" }) minetest.set_node({x = pos.x, y = y, z = pos.z}, { name = "mcl_mushroom:warped_hyphae" })
--print("Placed at " .. x .. " " .. y .. " " .. z) --print("Placed at " .. x .. " " .. y .. " " .. z)
end end
else else
if breakgrow2 == false then minetest.set_node(pos,{ name = "mcl_mushroom:warped_fungus" }) end if breakgrow2 == false then
end minetest.set_node(pos,{ name = "mcl_mushroom:warped_fungus" })
end
end
end end
function generate_crimson_tree(pos) function generate_crimson_tree(pos)
local breakgrow = false local breakgrow = false
local breakgrow2 = false local breakgrow2 = false
-- Baumgenerator -- Tree generator
-- erste und zweite Etage -- first and second floor
for x = pos.x - 2,pos.x + 2 do for x = pos.x - 2,pos.x + 2 do
for y = pos.y + 3, pos.y + 4 do for y = pos.y + 3, pos.y + 4 do
for z = pos.z - 2, pos.z + 2 do for z = pos.z - 2, pos.z + 2 do
if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then breakgrow = true end if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then
end breakgrow = true
end
end end
end end
end
-- dritte und vierte Etage -- third and fourth floors
for x = pos.x - 1,pos.x + 1 do for x = pos.x - 1,pos.x + 1 do
for y = pos.y + 5, pos.y + 6 do for y = pos.y + 5, pos.y + 6 do
for z = pos.z - 1, pos.z + 1 do for z = pos.z - 1, pos.z + 1 do
if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then breakgrow = true end if not (minetest.get_node({x = x, y = y, z = z}).name == "air") then
end breakgrow = true
end end
end end
end
end
-- fünfte Etage -- fifth floor
if not (minetest.get_node({x = pos.x, y = pos.y + 7, z = pos.z}).name == "air") then breakgrow = true end if not (minetest.get_node({x = pos.x, y = pos.y + 7, z = pos.z}).name == "air") then
breakgrow = true
end
-- Holz -- Wood
if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:crimson_fungus") then breakgrow = true end if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:crimson_fungus") then
for y = pos.y + 1, pos.y + 4 do breakgrow = true
if not (minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air") then breakgrow = true end end
end for y = pos.y + 1, pos.y + 4 do
if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:crimson_fungus") then breakgrow2 = true end if not (minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air") then
if breakgrow == false then breakgrow = true
-- Warzen end
-- erste und zweite Etage end
for x = pos.x - 2,pos.x + 2 do if not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "air") and not (minetest.get_node({x = pos.x, y = pos.y, z = pos.z}).name == "mcl_mushroom:crimson_fungus") then
for y = pos.y + 3, pos.y + 4 do breakgrow2 = true
for z = pos.z - 2, pos.z + 2 do end
minetest.set_node({x = x, y = y, z = z}, { name = "mcl_nether:nether_wart_block" }) if breakgrow == false then
end -- Warts
end -- first and second floor
end for x = pos.x - 2,pos.x + 2 do
for y = pos.y + 3, pos.y + 4 do
for z = pos.z - 2, pos.z + 2 do
minetest.set_node({x = x, y = y, z = z}, { name = "mcl_nether:nether_wart_block" })
end
end
end
-- dritte und vierte Etage -- third and fourth floors
for x = pos.x - 1,pos.x + 1 do for x = pos.x - 1,pos.x + 1 do
for y = pos.y + 5, pos.y + 6 do for y = pos.y + 5, pos.y + 6 do
for z = pos.z - 1, pos.z + 1 do for z = pos.z - 1, pos.z + 1 do
minetest.set_node({x = x, y = y, z = z}, { name = "mcl_nether:nether_wart_block" }) minetest.set_node({x = x, y = y, z = z}, { name = "mcl_nether:nether_wart_block" })
end end
end end
end end
-- fünfte Etage -- fifth floor
minetest.set_node({x = pos.x, y = pos.y + 7, z = pos.z}, { name = "mcl_nether:nether_wart_block" }) minetest.set_node({x = pos.x, y = pos.y + 7, z = pos.z}, { name = "mcl_nether:nether_wart_block" })
-- Pilzlich -- Fungal
local randomgenerate = math.random(1, 2) local randomgenerate = math.random(1, 2)
if randomgenerate == 1 then if randomgenerate == 1 then
local randomx = math.random(-2, 2) local randomx = math.random(-2, 2)
local randomz = math.random(-2, 2) local randomz = math.random(-2, 2)
minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" })
end end
local randomgenerate = math.random(1, 8) local randomgenerate = math.random(1, 8)
if randomgenerate == 4 then if randomgenerate == 4 then
local randomx = math.random(-2, 2) local randomx = math.random(-2, 2)
local randomz = math.random(-2, 2) local randomz = math.random(-2, 2)
minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" }) minetest.set_node({x = pos.x + randomx, y = pos.y + 3, z = pos.z + randomz}, { name = "mcl_mushroom:shroomlight" })
end end
-- Holz -- Wood
for y = pos.y, pos.y + 4 do for y = pos.y, pos.y + 4 do
minetest.set_node({x = pos.x, y = y, z = pos.z}, { name = "mcl_mushroom:crimson_hyphae" }) minetest.set_node({x = pos.x, y = y, z = pos.z}, { name = "mcl_mushroom:crimson_hyphae" })
--print("Placed at " .. x .. " " .. y .. " " .. z) --print("Placed at " .. x .. " " .. y .. " " .. z)
end end
else else
if breakgrow2 == false then minetest.set_node(pos,{ name = "mcl_mushroom:crimson_fungus" }) end if breakgrow2 == false then
end minetest.set_node(pos,{ name = "mcl_mushroom:crimson_fungus" })
end
end
end end
@ -662,45 +689,45 @@ minetest.register_decoration({
}) })
]] ]]
minetest.register_ore({ minetest.register_ore({
ore_type = "sheet", ore_type = "sheet",
ore = "mcl_mushroom:warped_checknode", ore = "mcl_mushroom:warped_checknode",
-- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally -- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally
-- in v6, but instead set with the on_generated function in mcl_mapgen_core. -- in v6, but instead set with the on_generated function in mcl_mapgen_core.
wherein = {"mcl_nether:netherrack", "mcl_core:stone"}, wherein = {"mcl_nether:netherrack", "mcl_core:stone"},
clust_scarcity = 14 * 14 * 14, clust_scarcity = 14 * 14 * 14,
clust_size = 10, clust_size = 10,
y_min = -29065, y_min = -29065,
y_max = -28940, y_max = -28940,
noise_threshold = 0.0, noise_threshold = 0.0,
noise_params = { noise_params = {
offset = 0.5, offset = 0.5,
scale = 0.1, scale = 0.1,
spread = {x = 8, y = 8, z = 8}, spread = {x = 8, y = 8, z = 8},
seed = 4996, seed = 4996,
octaves = 1, octaves = 1,
persist = 0.0 persist = 0.0
}, },
}) })
minetest.register_ore({ minetest.register_ore({
ore_type = "sheet", ore_type = "sheet",
ore = "mcl_mushroom:crimson_checknode", ore = "mcl_mushroom:crimson_checknode",
-- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally -- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally
-- in v6, but instead set with the on_generated function in mcl_mapgen_core. -- in v6, but instead set with the on_generated function in mcl_mapgen_core.
wherein = {"mcl_nether:netherrack", "mcl_core:stone"}, wherein = {"mcl_nether:netherrack", "mcl_core:stone"},
clust_scarcity = 10 * 10 * 10, clust_scarcity = 10 * 10 * 10,
clust_size = 10, clust_size = 10,
y_min = -29065, y_min = -29065,
y_max = -28940, y_max = -28940,
noise_threshold = 0.0, noise_threshold = 0.0,
noise_params = { noise_params = {
offset = 1, offset = 1,
scale = 0.5, scale = 0.5,
spread = {x = 12, y = 12, z = 12}, spread = {x = 12, y = 12, z = 12},
seed = 12948, seed = 12948,
octaves = 1, octaves = 1,
persist = 0.0 persist = 0.0
}, },
}) })