When I tried to make my New custom ore generate underground randomly once the custom boss is defeated I got this error
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\EpicnessWorld.cs(51,9) : error CS0103: The name 'Codable' does not exist in the current context
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\EpicnessWorld.cs(51,67) : error CS0103: The name 'Codable' does not exist in the current context
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\EpicnessWorld.cs(72,202) : error CS0103: The name 'Config' does not exist in the current context
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\EpicnessWorld.cs(75,27) : error CS0117: 'Terraria.ModLoader.ModWorld' does not contain a definition for 'misc'
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\EpicnessWorld.cs(77,46) : error CS0117: 'Terraria.ModLoader.ModWorld' does not contain a definition for 'misc'
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\EpicnessWorld.cs(81,20) : error CS0117: 'Terraria.NetMessage' does not contain a definition for 'SendModData'
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\EpicnessWorld.cs(81,32) : error CS0103: The name 'modId' does not exist in the current context
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\EpicnessWorld.cs(82,5) : error CS0103: The name 'Codable' does not exist in the current context
Here is the code for the World.cs file
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 System;
namespace EpicnessMod
{
public class EpicnessWorld : ModWorld
{
private const int saveVersion = 0;
public static bool downedDarkNebula = false;
public static int DarkNebulaDefeated;
public const int MSG_BLESS = 1;
//public struct EpicnessMsgs
//{
public static string[] misc = {"Your world has been infected with Corrupt Ore!"};
//}
public override void Initialize()
{
downedDarkNebula = false;
}
public override void SaveCustomData(BinaryWriter writer)
{
writer.Write(saveVersion);
byte flags = 0;
writer.Write(DarkNebulaDefeated);
if (downedDarkNebula)
{
flags |= 1;
}
writer.Write(flags);
}
public override void LoadCustomData(BinaryReader reader)
{
reader.ReadInt32();
DarkNebulaDefeated = reader.ReadInt32();
byte flags = reader.ReadByte();
downedDarkNebula = ((flags & 1) == 1);
}
#region Bless() : void [STATIC]
public static void Bless()
{
if (Codable.RunGlobalMethod("ModWorld", "PreBless") && !(bool)Codable.customMethodReturn)
return;
if (Main.netMode == 1) return;
DarkNebulaDefeated++;
int amount = 0;
double num5;
num5 = Main.rockLayer;
int xloc = -100 + Main.maxTilesX - 100;
int yloc = -(int)num5 + Main.maxTilesY - 200;
int sum = xloc * yloc;
amount = (int)(sum / 10000) * 10;
if (DarkNebulaDefeated == 1)
{
if (DarkNebulaDefeated == 1)
{
for(int zz = 0; zz < amount; zz++)
{
int i2 = WorldGen.genRand.Next(100, Main.maxTilesX - 100);
double num6;
num6 = Main.rockLayer;
int j2 = WorldGen.genRand.Next((int)num6, Main.maxTilesY - 200);
WorldGen.OreRunner(i2, j2, (double)WorldGen.genRand.Next(WorldGen.genRand.Next(2, 4), WorldGen.genRand.Next(4, 7)), WorldGen.genRand.Next(WorldGen.genRand.Next(3, 5), WorldGen.genRand.Next(4, 8)), Config.tileDefs.ID["Corrupted Ore"]);
}
if (Main.netMode == 0)
Main.NewText(ModWorld.misc[1], 80, 65, 130);
else if (Main.netMode == 2)
NetMessage.SendData(25, -1, -1, ModWorld.misc[1], 255, 80f, 65f, 130f, 0);
}
}
if (Main.netMode == 2)
NetMessage.SendModData(modId, MSG_BLESS, -1, -1, -1);
Codable.RunGlobalMethod("ModWorld", "PostBless");
}
#endregion
}
}