Xag
Terrarian
...a world is showing me this
Index was outside the bounds of the array. at Darkarmod.Darkar.DarkarBiome.<ModifyWorldGenTasks>b__1(GenerationProgress progress) at Terraria.GameContent.Generation.PassLegacy.Apply(GenerationProgress progress) at Terraria.World.Generation.WorldGenerator.GenerateWorld(GenerationProgress progress) at Terraria.WorldGen.generateWorld(Int32 seed, GenerationProgress customProgressObject) at Terraria.WorldGen.do_worldGenCallBack(Object threadContext) at Terraria.WorldGen.worldGenCallBack(Object threadContext)
and here is the code
Index was outside the bounds of the array. at Darkarmod.Darkar.DarkarBiome.<ModifyWorldGenTasks>b__1(GenerationProgress progress) at Terraria.GameContent.Generation.PassLegacy.Apply(GenerationProgress progress) at Terraria.World.Generation.WorldGenerator.GenerateWorld(GenerationProgress progress) at Terraria.WorldGen.generateWorld(Int32 seed, GenerationProgress customProgressObject) at Terraria.WorldGen.do_worldGenCallBack(Object threadContext) at Terraria.WorldGen.worldGenCallBack(Object threadContext)
and here is the code
Code:
using 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 Darkarmod.Darkar
{
public class DarkarkBiome : 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("Darkar Stuff..", delegate (GenerationProgress progress)
{
progress.Message = "Darkar Stuff..";
for (int i = 0; i < Main.maxTilesX / 300; i++)
{
int X = WorldGen.genRand.Next(1, Main.maxTilesX - 300);
int Y = WorldGen.genRand.Next((int)WorldGen.rockLayer - 100, Main.maxTilesY - 200);
int TileType = mod.TileType("Darkdirt1tile");
WorldGen.TileRunner(X, Y, 600, WorldGen.genRand.Next(100, 200), TileType, false, 0f, 0f, true, true); random it looks.
for (int k = 0; k < 100; k++)
{
int Xo = X + Main.rand.Next(-240, 240);
int Yo = Y + Main.rand.Next(-240, 240);
if (Main.tile[Xo, Yo].type == mod.TileType("Darkdirt1tile"))
{
{
WorldGen.TileRunner(Xo, Yo, (double)WorldGen.genRand.Next(5, 10), WorldGen.genRand.Next(5, 10), mod.TileType("DararOreBlock1tile"), false, 0f, 0f, false, true);
}
}
}
}
}));
}
}
}