-- plants and other small decorations
minetest.register_decoration({
  deco_type = "simple",
  place_on = {"group:grass"},
  sidelen = 16,
  fill_ratio = 0.009,
  biomes = PyuTest.get_flowering_biomes(),
  decoration = PyuTest.registered_flowers
})

minetest.register_decoration({
  deco_type = "simple",
  place_on = {"group:grass"},
  sidelen = 16,
  fill_ratio = 0.032,
  biomes = PyuTest.get_extra_flowering_biomes(),
  decoration = PyuTest.registered_flowers
})

minetest.register_decoration({
  deco_type = "simple",
  place_on = {"group:grass"},
  sidelen = 16,
  fill_ratio = 0.048,
  biomes = {"grassland"},
  decoration = "pyutest_flowers:grass_plant"
})

minetest.register_decoration({
  deco_type = "simple",
  place_on = {"group:grass"},
  sidelen = 16,
  fill_ratio = 0.0018,
  biomes = {"grassland"},
  decoration = "pyutest_blocks:haybale_block"
})

minetest.register_decoration({
  deco_type = "simple",
  place_on = {"pyutest_blocks:dirt_block", "pyutest_blocks:sand_block"},
  sidelen = 16,
  fill_ratio = 0.019,
  biomes = {"desert"},
  decoration = "pyutest_flowers:deadbush"
})

minetest.register_decoration({
  deco_type = "simple",
  sidelen = 16,
  fill_ratio = 0.03,
  place_on = {"pyutest_blocks:water_source"},
  biomes = {"swamp", "swamp_ocean"},
  y_max = PyuTest.OVERWORLD_TOP,
  y_min = 0,
  decoration = "pyutest_flowers:lilypad",
  flags = "liquid_surface"
})

minetest.register_decoration({
  deco_type = "simple",
  sidelen = 16,
  fill_ratio = 0.04,
  place_on = {"group:sugarcane_spawn_on"},
  decoration = "pyutest_blocks:sugarcane",
  y_max = PyuTest.OVERWORLD_SURFACE_BOTTOM,
  y_min = 0,
  spawn_by = {"pyutest_blocks:water_source"},
  num_spawn_by = 1,
  height = 1,
  height_max = 4
})

-- trees
minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"group:grass"},
  sidelen = 16,
  fill_ratio = 0.004,
  biomes = {"forest"},
  schematic = PyuTest.get_schem_path("Tree"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"group:grass"},
  sidelen = 16,
  fill_ratio = 0.00045,
  biomes = {"grassland"},
  schematic = PyuTest.get_schem_path("Tree"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"group:grass"},
  sidelen = 16,
  fill_ratio = 0.00085,
  biomes = {"savanna"},
  schematic = PyuTest.get_schem_path("SavannaTree"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true,
  place_offset_y = 1
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"pyutest_blocks:mycelium_block"},
  sidelen = 16,
  fill_ratio = 0.003,
  biomes = PyuTest.util.tableconcat2({"mushroom_fields", "large_mushroom_forest"}, PyuTest.MushroomWorld.biome_names),
  schematic = PyuTest.get_schem_path("Mushroom"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true,
  place_offset_y = 1
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"group:grass"},
  sidelen = 16,
  fill_ratio = 0.005,
  biomes = {"taiga"},
  schematic = PyuTest.get_schem_path("TaigaTree"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true,
  place_offset_y = 1
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"pyutest_blocks:grass_block"},
  sidelen = 16,
  fill_ratio = 0.005,
  biomes = {"birch_forest"},
  schematic = PyuTest.get_schem_path("BirchTree"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"pyutest_blocks:grass_block"},
  sidelen = 16,
  fill_ratio = 0.005,
  biomes = {"birch_forest", "old_growth_birch_forest"},
  schematic = PyuTest.get_schem_path("TallBirchTree"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"pyutest_blocks:grass_block"},
  sidelen = 16,
  fill_ratio = 0.005,
  biomes = {"cherry_grove"},
  schematic = PyuTest.get_schem_path("CherryTree"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true,
  place_offset_y = 1
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"pyutest_blocks:snow_block"},
  sidelen = 16,
  fill_ratio = 0.004,
  biomes = {"snowy_forest"},
  schematic = PyuTest.get_schem_path("SnowyTree1"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"pyutest_blocks:snow_block"},
  sidelen = 16,
  fill_ratio = 0.004,
  biomes = {"snowy_forest"},
  schematic = PyuTest.get_schem_path("SnowyTree2"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true,
  place_offset_y = 1
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"group:grass"},
  sidelen = 16,
  fill_ratio = 0.004,
  biomes = {"swamp"},
  schematic = PyuTest.get_schem_path("SwampTree"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"pyutest_blocks:grass_block"},
  sidelen = 16,
  fill_ratio = 0.004,
  biomes = {"old_growth_birch_forest"},
  schematic = PyuTest.get_schem_path("VeryTallBirchTree"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"group:grass"},
  sidelen = 16,
  fill_ratio = 0.016,
  biomes = {"aspen_forest"},
  schematic = PyuTest.get_schem_path("AspenTree1"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"group:grass"},
  sidelen = 16,
  fill_ratio = 0.008,
  biomes = {"aspen_forest"},
  schematic = PyuTest.get_schem_path("AspenTree2"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"pyutest_blocks:podzol_block"},
  sidelen = 16,
  fill_ratio = 0.019,
  biomes = {"redwood_forest"},
  schematic = PyuTest.get_schem_path("RedwoodTree"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"pyutest_blocks:mycelium_block"},
  sidelen = 16,
  fill_ratio = 0.006,
  biomes = PyuTest.util.tableconcat2({"large_mushroom_forest"}, PyuTest.MushroomWorld.biome_names),
  schematic = PyuTest.get_schem_path("TallMushroom"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  force_placement = true
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"pyutest_blocks:mycelium_block"},
  sidelen = 16,
  fill_ratio = 0.002,
  biomes = PyuTest.util.tableconcat2({"large_mushroom_forest"}, PyuTest.MushroomWorld.biome_names),
  schematic = PyuTest.get_schem_path("SmallMushroom"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  place_offset_y = 1,
  force_placement = true
})

minetest.register_decoration({
  deco_type = "schematic",
  place_on = {"pyutest_blocks:mycelium_block"},
  sidelen = 16,
  fill_ratio = 0.007,
  biomes = {"large_mushroom_forest"},
  schematic = PyuTest.get_schem_path("FallenMushroom"),
  rotation = "random",
  flags = "place_center_x, place_center_z",
  place_offset_y = 1,
  force_placement = true
})
