Advertisement
Guest User

BobakBiome

a guest
Apr 3rd, 2017
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.45 KB | None | 0 0
  1. using System.IO;
  2. using System.Collections.Generic;
  3. using Terraria;
  4. using Terraria.ID;
  5. using Terraria.ModLoader;
  6. using Terraria.World.Generation;
  7. using Microsoft.Xna.Framework;
  8. using Terraria.GameContent.Generation;
  9. using System.Linq;
  10.  
  11.  
  12. namespace TileNation
  13. {
  14.     public class TileNationWorld : ModWorld
  15.     {
  16.  
  17.         public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
  18.         {
  19.             int genIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies"));
  20.             if (genIndex == -1)
  21.             {
  22.                 return;
  23.             }
  24.             tasks.Insert(genIndex + 1, new PassLegacy("Bobak Biome", delegate (GenerationProgress progress)
  25.             {
  26.                 progress.Message = "Sending Evil Bobak's To your World";
  27.                 for (int i = 0; i < Main.maxTilesX / 3000; i++)  
  28.                 {
  29.                     int X = WorldGen.genRand.Next(1, Main.maxTilesX - 500);
  30.                     int Y = WorldGen.genRand.Next((int)WorldGen.rockLayer - 50, Main.maxTilesY - 300);
  31.                     int TileType = mod.TileType("BobakHiveBlock");  
  32.  
  33.                     WorldGen.TileRunner(X, Y, 300, WorldGen.genRand.Next(300, 300), TileType, false, 0f, 0f, true, true);
  34.  
  35.                 }
  36.  
  37.             }));
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement