Hello, I've been trying to make a new biome for my Terraria mod. I have been trying to add more then one block to the world, but it only comes out as all one block or the other. Code:
System.IO;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.World.Generation;
using Microsoft.Xna.Framework;
using Terraria.GameContent.Generation;
using System.Linq;
namespace VolcanoMod
{
public class ModNameWorld : ModWorld
{
public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
{
int genIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies"));
if (genIndex == -1)
{
return;
}
tasks.Insert(genIndex + 1, new PassLegacy("Custom Biome", delegate (GenerationProgress progress)
{
progress.Message = "Custom Biome Progress";
for (int i = 0; i < Main.maxTilesX / 900; i++)
{
int X = WorldGen.genRand.Next(1, Main.maxTilesX - 300);
int Y = WorldGen.genRand.Next((int)WorldGen.rockLayer - 100, Main.maxTilesY - 200);
int TileType = 57;
WorldGen.TileRunner(X, Y, 350, WorldGen.genRand.Next(100, 200), TileType, false, 0f, 0f, true, true);
{
int Xo = X + Main.rand.Next(100, 200);
int Yo = Y + Main.rand.Next(100, 200);
if (Main.tile[Xo, Yo].type == mod.TileType("CustomTileBlock"))
{
{
WorldGen.TileRunner(Xo, Yo, (double)WorldGen.genRand.Next(5, 10), WorldGen.genRand.Next(5, 10), mod.TileType("CustomOreTile"), false, 0f, 0f, false, true);
}
}
}
}
}));
}
}
}