97 private static readonly
object IOLock =
new object();
276 worldFileData.WorldGeneratorVersion =
binaryReader.ReadUInt64();
281 worldFileData.WorldGeneratorVersion = 0
uL;
307 worldFileData.ForTheWorthy =
binaryReader.ReadBoolean();
327 worldFileData.NoTrapsWorld =
binaryReader.ReadBoolean();
335 worldFileData.ZenithWorld = worldFileData.DrunkWorld &&
worldFileData.RemixWorld;
343 worldFileData.GameMode = 1;
347 worldFileData.GameMode = 0;
497 for (
int i = 0; i <
num3; i++)
513 worldFileData.DefeatedMoonlord =
binaryReader.ReadBoolean();
529 Main.autoGenFileLocation =
null;
531 worldFileData.Name = name;
532 worldFileData.GameMode = GameMode;
536 worldFileData.WorldGeneratorVersion = 1198295875585
uL;
559 Main.anglerQuestFinished =
false;
578 Main.lockMenuBGChange =
true;
598 string text = (Main.AutogenSeedName ??
"").Trim();
599 if (
text.Length == 0)
617 WorldGen.loadFailed =
false;
618 WorldGen.loadSuccess =
false;
622 WorldGen.loadFailed =
true;
634 Main.ActiveWorldFileData.CreationTime =
DateTime.
Now;
642 WorldGen.loadFailed =
true;
646 WorldGen.loadSuccess =
true;
659 Liquid.quickSettle =
true;
678 Main.statusText =
Lang.
gen[27].Value +
" " + (int)(
num7 * 100f / 2f + 50f) +
"%";
681 Liquid.quickSettle =
false;
685 WorldGen.gen =
false;
696 WorldGen.loadFailed =
true;
697 WorldGen.loadSuccess =
false;
713 WorldGen.loadFailed =
true;
714 WorldGen.loadSuccess =
false;
730 for (
int i = 0; i <
array.Length; i += 2)
739 WorldGen.SavedOreTiers.Copper = 7;
743 WorldGen.SavedOreTiers.Copper = 166;
749 WorldGen.SavedOreTiers.Iron = 6;
753 WorldGen.SavedOreTiers.Iron = 167;
759 WorldGen.SavedOreTiers.Silver = 9;
763 WorldGen.SavedOreTiers.Silver = 168;
769 WorldGen.SavedOreTiers.Gold = 8;
773 WorldGen.SavedOreTiers.Gold = 169;
801 Main.worldName =
"World";
805 Main.statusText =
Lang.
gen[48].Value;
874 text = Main.worldPathName +
".bak";
875 Main.statusText =
Lang.
gen[50].Value;
902 for (
int i = 1; i < num; i++)
1042 for (
int k = 0;
k < 2;
k++)
1044 for (
int l = 0;
l < 3;
l++)
1047 tile2.frameX %= 100;
1048 if (
tile2.type == 269)
1074 for (
int m = 0;
m < 3;
m++)
1076 for (
int n = 0;
n < 3;
n++)
1080 tile3.frameX = (
short)((flag ? 54 : 0) +
m * 18);
1081 tile3.frameY = (
short)(
n * 18);
1118 for (
int i = 0; i < num; i++)
1125 for (
int i = 0; i <
count; i++)
1146 return (
int)
writer.BaseStream.Position;
1151 writer.BaseStream.Position = 0
L;
1153 writer.BaseStream.Position += 20
L;
1155 for (
int i = 0; i <
pointers.Length; i++)
1159 return (
int)
writer.BaseStream.Position;
1355 return (
int)
writer.BaseStream.Position;
1360 byte[]
array =
new byte[16];
1364 Main.statusText =
Lang.
gen[49].Value +
" " + (int)(num * 100f + 1f) +
"%";
1373 byte b4 = (
b3 = (
b2 = (
b = 0)));
1381 b4 = (byte)(
b4 | 2
u);
1384 if (tile.
type > 255)
1392 array[
num3] = (byte)((uint)tile.frameX & 0xFF
u);
1396 array[
num3] = (byte)((uint)tile.frameY & 0xFF
u);
1401 if (tile.
color() != 0)
1403 b2 = (byte)(
b2 | 8
u);
1410 b4 = (byte)(
b4 | 4
u);
1429 b4 = (byte)(
b4 | 8
u);
1436 b3 = (byte)(
b3 | 2
u);
1440 b3 = (byte)(
b3 | 4
u);
1444 b3 = (byte)(
b3 | 8
u);
1450 b2 = (byte)(
b2 | 2
u);
1454 b2 = (byte)(
b2 | 4
u);
1460 if (tile.
wall > 255)
1485 b2 = (byte)(
b2 | 1
u);
1491 b3 = (byte)(
b3 | 1
u);
1497 b4 = (byte)(
b4 | 1
u);
1503 int num8 = Main.maxTilesY -
num2 - 1;
1530 return (
int)
writer.BaseStream.Position;
1536 for (
int i = 0; i < 8000; i++)
1544 for (
int j = chest.
x;
j <= chest.x + 1;
j++)
1546 for (
int k = chest.
y;
k <= chest.y + 1;
k++)
1572 for (
int i = 0; i < 8000; i++)
1582 for (
int l = 0;
l < 40;
l++)
1602 return (
int)
writer.BaseStream.Position;
1608 for (
int i = 0; i < 1000; i++)
1611 if (sign !=
null && sign.
text !=
null)
1617 for (
int j = 0;
j < 1000;
j++)
1620 if (sign !=
null && sign.
text !=
null)
1627 return (
int)
writer.BaseStream.Position;
1634 for (
int i = 0; i <
array.Length; i++)
1644 if (
nPC.active &&
nPC.townNPC &&
nPC.type != 368)
1659 writer.Write(
nPC.townNpcVariationIndex);
1675 return (
int)
writer.BaseStream.Position;
1683 return (
int)
writer.BaseStream.Position;
1688 reader.BaseStream.Position = 0
L;
1792 for (
int i = 0; i < 8000; i++)
1828 for (
int i = 0; i < num; i++)
1836 for (
int i = 0; i <
num2; i++)
1859 if (versionNumber >= 179)
1863 Main.ActiveWorldFileData.WorldGeneratorVersion = reader.
ReadUInt64();
1865 if (versionNumber >= 181)
1867 Main.ActiveWorldFileData.UniqueId =
new Guid(reader.
ReadBytes(16));
1871 Main.ActiveWorldFileData.UniqueId =
Guid.
NewGuid();
1881 if (versionNumber >= 209)
1884 if (versionNumber >= 222)
1888 if (versionNumber >= 227)
1892 if (versionNumber >= 238)
1894 Main.tenthAnniversaryWorld = reader.
ReadBoolean();
1896 if (versionNumber >= 239)
1900 if (versionNumber >= 241)
1904 if (versionNumber >= 249)
1908 if (versionNumber >= 266)
1912 if (versionNumber >= 267)
1923 if (versionNumber >= 112)
1936 if (versionNumber >= 141)
1956 Main.jungleBackStyle = reader.
ReadInt32();
1957 Main.hellBackStyle = reader.
ReadInt32();
1981 if (versionNumber >= 118)
1994 WorldGen.shadowOrbCount = reader.
ReadByte();
1995 WorldGen.altarCount = reader.
ReadInt32();
1997 if (versionNumber >= 257)
2003 Main.afterPartyOfDoom =
false;
2005 Main.invasionDelay = reader.
ReadInt32();
2009 if (versionNumber >= 118)
2013 if (versionNumber >= 113)
2015 Main.sundialCooldown = reader.
ReadByte();
2020 WorldGen.SavedOreTiers.Cobalt = reader.
ReadInt32();
2021 WorldGen.SavedOreTiers.Mythril = reader.
ReadInt32();
2022 WorldGen.SavedOreTiers.Adamantite = reader.
ReadInt32();
2031 Main.cloudBGActive = reader.
ReadInt32();
2037 if (versionNumber < 95)
2042 for (
int num = reader.
ReadInt32(); num > 0; num--)
2046 if (versionNumber < 99)
2051 if (versionNumber < 101)
2056 if (versionNumber < 104)
2061 if (versionNumber >= 129)
2065 if (versionNumber >= 201)
2069 if (versionNumber < 107)
2078 Main.invasionSizeStart = reader.
ReadInt32();
2080 if (versionNumber < 108)
2088 if (versionNumber < 109)
2093 for (
int i = 0; i <
num2; i++)
2104 if (versionNumber < 128)
2108 Main.fastForwardTimeToDawn = reader.
ReadBoolean();
2109 if (versionNumber < 131)
2119 NPC.downedChristmasIceQueen = reader.
ReadBoolean();
2120 NPC.downedChristmasSantank = reader.
ReadBoolean();
2122 if (versionNumber < 140)
2151 if (versionNumber < 170)
2165 for (
int j = 0;
j <
num3;
j++)
2170 if (versionNumber < 174)
2185 if (versionNumber > 194)
2193 if (versionNumber >= 215)
2201 if (versionNumber > 195)
2213 if (versionNumber >= 204)
2217 if (versionNumber < 207)
2232 if (versionNumber >= 212)
2234 Main.forceHalloweenForToday = reader.
ReadBoolean();
2239 Main.forceHalloweenForToday =
false;
2240 Main.forceXMasForToday =
false;
2242 if (versionNumber >= 216)
2244 WorldGen.SavedOreTiers.Copper = reader.
ReadInt32();
2245 WorldGen.SavedOreTiers.Iron = reader.
ReadInt32();
2246 WorldGen.SavedOreTiers.Silver = reader.
ReadInt32();
2247 WorldGen.SavedOreTiers.Gold = reader.
ReadInt32();
2251 WorldGen.SavedOreTiers.Copper = -1;
2252 WorldGen.SavedOreTiers.Iron = -1;
2253 WorldGen.SavedOreTiers.Silver = -1;
2254 WorldGen.SavedOreTiers.Gold = -1;
2256 if (versionNumber >= 217)
2264 NPC.boughtCat =
false;
2265 NPC.boughtDog =
false;
2266 NPC.boughtBunny =
false;
2268 if (versionNumber >= 223)
2275 NPC.downedEmpressOfLight =
false;
2276 NPC.downedQueenSlime =
false;
2278 if (versionNumber >= 240)
2284 NPC.downedDeerclops =
false;
2286 if (versionNumber >= 250)
2288 NPC.unlockedSlimeBlueSpawn = reader.
ReadBoolean();
2292 NPC.unlockedSlimeBlueSpawn =
false;
2294 if (versionNumber >= 251)
2297 NPC.unlockedDemolitionistSpawn = reader.
ReadBoolean();
2298 NPC.unlockedPartyGirlSpawn = reader.
ReadBoolean();
2299 NPC.unlockedDyeTraderSpawn = reader.
ReadBoolean();
2301 NPC.unlockedArmsDealerSpawn = reader.
ReadBoolean();
2307 NPC.unlockedMerchantSpawn =
false;
2308 NPC.unlockedDemolitionistSpawn =
false;
2309 NPC.unlockedPartyGirlSpawn =
false;
2310 NPC.unlockedDyeTraderSpawn =
false;
2311 NPC.unlockedTruffleSpawn =
false;
2312 NPC.unlockedArmsDealerSpawn =
false;
2313 NPC.unlockedNurseSpawn =
false;
2314 NPC.unlockedPrincessSpawn =
false;
2316 if (versionNumber >= 259)
2318 NPC.combatBookVolumeTwoWasUsed = reader.
ReadBoolean();
2322 NPC.combatBookVolumeTwoWasUsed =
false;
2324 if (versionNumber >= 260)
2326 NPC.peddlersSatchelWasUsed = reader.
ReadBoolean();
2330 NPC.peddlersSatchelWasUsed =
false;
2332 if (versionNumber >= 261)
2334 NPC.unlockedSlimeGreenSpawn = reader.
ReadBoolean();
2336 NPC.unlockedSlimePurpleSpawn = reader.
ReadBoolean();
2337 NPC.unlockedSlimeRainbowSpawn = reader.
ReadBoolean();
2339 NPC.unlockedSlimeYellowSpawn = reader.
ReadBoolean();
2340 NPC.unlockedSlimeCopperSpawn = reader.
ReadBoolean();
2344 NPC.unlockedSlimeGreenSpawn =
false;
2345 NPC.unlockedSlimeOldSpawn =
false;
2346 NPC.unlockedSlimePurpleSpawn =
false;
2347 NPC.unlockedSlimeRainbowSpawn =
false;
2348 NPC.unlockedSlimeRedSpawn =
false;
2349 NPC.unlockedSlimeYellowSpawn =
false;
2350 NPC.unlockedSlimeCopperSpawn =
false;
2352 if (versionNumber >= 264)
2354 Main.fastForwardTimeToDusk = reader.
ReadBoolean();
2355 Main.moondialCooldown = reader.
ReadByte();
2359 Main.fastForwardTimeToDusk =
false;
2360 Main.moondialCooldown = 0;
2370 Main.statusText =
Lang.
gen[51].Value +
" " + (int)((
double)num * 100.0 + 1.0) +
"%";
2376 byte b3 = (
b2 = (
b = 0));
2386 if (flag && (
b3 & 1) == 1)
2398 tile.
active(active:
true);
2399 if ((
b4 & 0
x20) == 32)
2409 tile.type = (ushort)
num2;
2414 if (tile.
type == 144)
2436 if ((
b2 & 0
x10) == 16)
2441 b5 = (byte)((
b4 & 0
x18) >> 3);
2445 if ((
b2 & 0
x80) == 128)
2453 tile.
lava(lava:
true);
2457 tile.
honey(honey:
true);
2465 tile.
wire(wire:
true);
2469 tile.
wire2(wire2:
true);
2473 tile.
wire3(wire3:
true);
2475 b5 = (byte)((
b3 & 0
x70) >> 4);
2498 if ((
b2 & 0
x20) == 32)
2500 tile.
wire4(wire4:
true);
2502 if ((
b2 & 0
x40) == 64)
2505 tile.wall = (ushort)((
b5 << 8) | tile.
wall);
2526 if ((
b & 0
x10) == 16)
2531 int num3 = (byte)((
b4 & 0
xC0) >> 6)
switch
2589 for (i = 0; i < num; i++)
2595 for (
int j = 0;
j <
num3;
j++)
2613 for (
int k = 0;
k <
num4;
k++)
2625 for (
int l = 0;
l < i;
l++)
2640 for (; i < 8000; i++)
2675 for (i = 0; i < num; i++)
2696 for (
int j = 0;
j < 1000;
j++)
2711 for (; i < 1000; i++)
2720 for (
int i = 0; i < num; i++)
2758 nPC.townNpcVariationIndex = reader.
ReadInt32();
2779 nPC.position = reader.ReadVector2();
2786 NPC.unlockedDemolitionistSpawn =
NPC.
AnyNPCs(38);
2787 NPC.unlockedPartyGirlSpawn =
NPC.
AnyNPCs(208);
2788 NPC.unlockedDyeTraderSpawn =
NPC.
AnyNPCs(207);
2790 NPC.unlockedArmsDealerSpawn =
NPC.
AnyNPCs(19);
2792 NPC.unlockedPrincessSpawn =
NPC.
AnyNPCs(663);
2798 int num =
fileIO.ReadInt32();
2803 bool flag =
fileIO.ReadBoolean();
2817 flag =
fileIO.ReadBoolean();
2819 flag =
fileIO.ReadBoolean();
2825 flag =
fileIO.ReadBoolean();
2852 int num =
fileIO.ReadInt32();
2853 if (num == 0 || num > 279)
2857 baseStream.Position = 0
L;
2887 for (
int i = 0; i <
num4; i++)
2890 Main.statusText =
Lang.
gen[73].Value +
" " + (int)(
num5 * 100f + 1f) +
"%";
2904 if (flag && (
b2 & 1) == 1)
2909 if (
flag2 && (
b & 1) == 1)
2916 if ((
b3 & 0
x20) == 32)
2939 if ((
b & 0
x10) == 16)
2944 if ((
b3 & 0
x18) >> 3 != 0)
2948 if ((
b & 0
x40) == 64)
2966 for (
int j = 0;
j <
num8;
j++)
2971 for (
int k = 0;
k <
num9;
k++)
2973 if (
fileIO.ReadInt16() > 0)
3045 bool result =
false;
3076 num = ((SocialAPI.Cloud !=
null) ? 1 : 0);
3127 return (
int)
writer.BaseStream.Position;
3136 for (
int i = 0; i < num; i++)
3139 tileEntity.ID =
num2++;
3147 TileEntity.TileEntitiesNextID = num;
3191 return (
int)
writer.BaseStream.Position;
3197 PressurePlateHelper.NeedsFirstUpdate =
true;
3199 for (
int i = 0; i < num; i++)
3209 return (
int)
writer.BaseStream.Position;
3220 return (
int)
writer.BaseStream.Position;
3236 return (
int)
writer.BaseStream.Position;
3248 if (versionNumber > 279)
3252 Main.worldName =
fileIO.ReadString();
3253 Main.worldID =
fileIO.ReadInt32();
3254 Main.leftWorld =
fileIO.ReadInt32();
3255 Main.rightWorld =
fileIO.ReadInt32();
3256 Main.topWorld =
fileIO.ReadInt32();
3257 Main.bottomWorld =
fileIO.ReadInt32();
3258 Main.maxTilesY =
fileIO.ReadInt32();
3259 Main.maxTilesX =
fileIO.ReadInt32();
3260 if (versionNumber >= 112)
3262 Main.GameMode = (
fileIO.ReadBoolean() ? 1 : 0);
3268 if (versionNumber >= 63)
3270 Main.moonType =
fileIO.ReadByte();
3277 if (versionNumber >= 44)
3287 if (versionNumber >= 60)
3296 Main.iceBackStyle =
fileIO.ReadInt32();
3297 if (versionNumber >= 61)
3299 Main.jungleBackStyle =
fileIO.ReadInt32();
3300 Main.hellBackStyle =
fileIO.ReadInt32();
3307 Main.spawnTileX =
fileIO.ReadInt32();
3308 Main.spawnTileY =
fileIO.ReadInt32();
3309 Main.worldSurface =
fileIO.ReadDouble();
3310 Main.rockLayer =
fileIO.ReadDouble();
3315 if (versionNumber >= 70)
3320 Main.dungeonX =
fileIO.ReadInt32();
3321 Main.dungeonY =
fileIO.ReadInt32();
3322 if (versionNumber >= 56)
3324 WorldGen.crimson =
fileIO.ReadBoolean();
3328 WorldGen.crimson =
false;
3330 NPC.downedBoss1 =
fileIO.ReadBoolean();
3331 NPC.downedBoss2 =
fileIO.ReadBoolean();
3332 NPC.downedBoss3 =
fileIO.ReadBoolean();
3333 if (versionNumber >= 66)
3335 NPC.downedQueenBee =
fileIO.ReadBoolean();
3337 if (versionNumber >= 44)
3339 NPC.downedMechBoss1 =
fileIO.ReadBoolean();
3340 NPC.downedMechBoss2 =
fileIO.ReadBoolean();
3341 NPC.downedMechBoss3 =
fileIO.ReadBoolean();
3342 NPC.downedMechBossAny =
fileIO.ReadBoolean();
3344 if (versionNumber >= 64)
3346 NPC.downedPlantBoss =
fileIO.ReadBoolean();
3347 NPC.downedGolemBoss =
fileIO.ReadBoolean();
3349 if (versionNumber >= 29)
3351 NPC.savedGoblin =
fileIO.ReadBoolean();
3352 NPC.savedWizard =
fileIO.ReadBoolean();
3353 if (versionNumber >= 34)
3355 NPC.savedMech =
fileIO.ReadBoolean();
3356 if (versionNumber >= 80)
3358 NPC.savedStylist =
fileIO.ReadBoolean();
3361 if (versionNumber >= 129)
3363 NPC.savedTaxCollector =
fileIO.ReadBoolean();
3365 if (versionNumber >= 201)
3367 NPC.savedGolfer =
fileIO.ReadBoolean();
3369 NPC.downedGoblins =
fileIO.ReadBoolean();
3371 if (versionNumber >= 32)
3373 NPC.downedClown =
fileIO.ReadBoolean();
3375 if (versionNumber >= 37)
3377 NPC.downedFrost =
fileIO.ReadBoolean();
3379 if (versionNumber >= 56)
3381 NPC.downedPirates =
fileIO.ReadBoolean();
3383 WorldGen.shadowOrbSmashed =
fileIO.ReadBoolean();
3384 WorldGen.spawnMeteor =
fileIO.ReadBoolean();
3385 WorldGen.shadowOrbCount =
fileIO.ReadByte();
3386 if (versionNumber >= 23)
3388 WorldGen.altarCount =
fileIO.ReadInt32();
3389 Main.hardMode =
fileIO.ReadBoolean();
3391 Main.invasionDelay =
fileIO.ReadInt32();
3392 Main.invasionSize =
fileIO.ReadInt32();
3393 Main.invasionType =
fileIO.ReadInt32();
3394 Main.invasionX =
fileIO.ReadDouble();
3395 if (versionNumber >= 113)
3397 Main.sundialCooldown =
fileIO.ReadByte();
3399 if (versionNumber >= 53)
3405 if (versionNumber >= 54)
3407 WorldGen.SavedOreTiers.Cobalt =
fileIO.ReadInt32();
3408 WorldGen.SavedOreTiers.Mythril =
fileIO.ReadInt32();
3409 WorldGen.SavedOreTiers.Adamantite =
fileIO.ReadInt32();
3413 WorldGen.SavedOreTiers.Cobalt = -1;
3414 WorldGen.SavedOreTiers.Mythril = -1;
3415 WorldGen.SavedOreTiers.Adamantite = -1;
3419 WorldGen.SavedOreTiers.Cobalt = 107;
3420 WorldGen.SavedOreTiers.Mythril = 108;
3421 WorldGen.SavedOreTiers.Adamantite = 111;
3433 if (versionNumber >= 55)
3435 style =
fileIO.ReadByte();
3439 if (versionNumber >= 60)
3460 if (versionNumber >= 60)
3462 Main.cloudBGActive =
fileIO.ReadInt32();
3465 Main.cloudBGAlpha = 1f;
3469 Main.cloudBGAlpha = 0f;
3476 if (versionNumber >= 62)
3478 Main.numClouds =
fileIO.ReadInt16();
3479 Main.windSpeedTarget =
fileIO.ReadSingle();
3489 Main.statusText =
Lang.
gen[51].Value +
" " + (int)(num * 100f + 1f) +
"%";
3498 tile.type = (ushort)
num2;
3499 if (tile.
type == 127 || tile.
type == 504)
3501 tile.
active(active:
false);
3503 if (versionNumber < 72 && (tile.
type == 35 || tile.
type == 36 || tile.
type == 170 || tile.
type == 171 || tile.
type == 172))
3505 tile.frameX =
fileIO.ReadInt16();
3506 tile.frameY =
fileIO.ReadInt16();
3510 if (versionNumber < 28 &&
num2 == 4)
3515 else if (versionNumber < 40 && tile.
type == 19)
3520 else if (versionNumber < 195 && tile.
type == 49)
3527 tile.frameX =
fileIO.ReadInt16();
3528 tile.frameY =
fileIO.ReadInt16();
3529 if (tile.
type == 144)
3540 if (versionNumber >= 48 &&
fileIO.ReadBoolean())
3545 if (versionNumber <= 25)
3549 if (
fileIO.ReadBoolean())
3551 tile.wall =
fileIO.ReadByte();
3556 if (versionNumber >= 48 &&
fileIO.ReadBoolean())
3561 if (
fileIO.ReadBoolean())
3563 tile.liquid =
fileIO.ReadByte();
3565 if (versionNumber >= 51)
3570 if (versionNumber >= 33)
3574 if (versionNumber >= 43)
3579 if (versionNumber >= 41)
3586 if (versionNumber >= 49)
3595 if (versionNumber >= 42)
3601 if (versionNumber >= 25)
3627 for (
int k =
j + 1;
k <
j +
num3 + 1;
k++)
3636 if (versionNumber < 67)
3640 if (versionNumber < 72)
3645 if (versionNumber < 58)
3650 for (
int l = 0;
l <
num7;
l++)
3652 if (!
fileIO.ReadBoolean())
3659 if (versionNumber >= 85)
3662 if (
text.Length > 20)
3668 for (
int m = 0;
m < 40;
m++)
3679 if (versionNumber >= 38)
3689 if (versionNumber >= 36)
3696 for (
int n = 0;
n < 1000;
n++)
3698 if (
fileIO.ReadBoolean())
3712 bool flag =
fileIO.ReadBoolean();
3716 if (versionNumber >= 190)
3724 if (versionNumber >= 83)
3733 flag =
fileIO.ReadBoolean();
3736 if (versionNumber >= 31 && versionNumber <= 83)
3747 if (versionNumber >= 35)
3750 if (versionNumber >= 65)
3760 if (versionNumber >= 79)
3771 if (versionNumber >= 7)
void Add(TKey key, TValue value)
virtual bool ReadBoolean()
virtual double ReadDouble()
virtual string ReadString()
virtual ulong ReadUInt64()
virtual float ReadSingle()
virtual ushort ReadUInt16()
virtual Stream BaseStream
virtual short ReadInt16()
virtual byte[] ReadBytes(int count)
static DateTime GetCreationTime(string path)
static readonly char DirectorySeparatorChar
static void Exit(object obj)
static bool TryEnter(object obj)
static int CreateChest(int X, int Y, int id=-1)
static void resetClouds()
static Dictionary< int, TileEntity > ByID
static TileEntitiesManager manager
static Dictionary< Point16, TileEntity > ByPosition
static void Write(BinaryWriter writer, TileEntity ent, bool networkSend=false)
static TileEntity Read(BinaryReader reader, bool networkSend=false)
static object EntityCreationLock
static readonly CreativePowerManager Instance
static int PartyDaysOnCooldown
static List< int > CelebratingNPCs
static void Load(BinaryReader reader, int gameVersionNumber)
static void Save(BinaryWriter writer)
static bool ManualLanterns
static int LanternNightsOnCooldown
static bool GenuineLanterns
static bool NextNightIsLanternNight
static float IntendedSeverity
static Dictionary< Point, bool[]> PressurePlatesPressed
static object EntityCreationLock
static int Place(int x, int y)
static void TryPlacing(int x, int y, int netid, int prefix, int stack)
static int Place(int x, int y)
static void ProcessSpecialWorldSeeds(string processedSeed)
static bool[] ItemsThatShouldNotBeInInventory
static short FromLegacyName(string name, int release)
static bool[] SavesAndLoads
static readonly short Count
static int FromLegacyName(string name)
static bool[] NonSolidSaveSlopes
static bool[] AllowsSaveCompressionBatching
static readonly ushort Count
static readonly ushort Count
static WorldFileData FromInvalidWorld(string path, bool cloudSave)
static ? float _cachedSandstormIntendedSeverity
static void LoadWorldTiles(BinaryReader reader, bool[] importance)
static ? bool _cachedLanternNightGenuine
static int SaveFileFormatHeader(BinaryWriter writer)
static void LoadNPCs(BinaryReader reader)
static bool LoadFileFormatHeader(BinaryReader reader, out bool[] importance, out int[] positions)
static void LoadTileEntities(BinaryReader reader)
static bool _tempSandstormHappening
static readonly object IOLock
static void InternalSaveWorld(bool useCloudSaving, bool resetTime)
static bool _tempLanternNightManual
static void LoadWorld(bool loadFromCloud)
static int SaveCreativePowers(BinaryWriter writer)
static ? bool _cachedLanternNightNextNightIsGenuine
static void ConvertIlluminantPaintToNewField()
static void LoadBestiary(BinaryReader reader, int loadVersionNumber)
static void FixAgainstExploits()
static void CheckSavedOreTiers()
static float _tempSandstormSeverity
static int SaveFooter(BinaryWriter writer)
static int LoadWorld_Version2(BinaryReader reader)
static void LoadCreativePowers(BinaryReader reader, int loadVersionNumber)
static int _tempCultistDelay
static bool _tempLanternNightGenuine
static int SaveWeightedPressurePlates(BinaryWriter writer)
static void LoadTownManager(BinaryReader reader)
static int SaveBestiary(BinaryWriter writer)
static void SetTempToCache()
static int SaveTownManager(BinaryWriter writer)
static int SaveChests(BinaryWriter writer)
static Action OnWorldLoad
static FileMetadata GetFileMetadata(string file, bool cloudSave)
static void ClearTempTiles()
static ? bool _cachedLanternNightManual
static ? bool _cachedSandstormHappening
static int _tempPartyCooldown
static void LoadDummies(BinaryReader reader)
static bool ValidateWorld(BinaryReader fileIO)
static float _tempSandstormIntendedSeverity
static void FixDresserChests()
static void SaveWorld_Version2(BinaryWriter writer)
static readonly List< int > CachedCelebratingNPCs
static ? bool _cachedBloodMoon
static void SaveWorld(bool useCloudSaving, bool resetTime=false)
static int SaveHeaderPointers(BinaryWriter writer, int[] pointers)
static void CacheSaveTime()
static bool _tempPartyGenuine
static WorldFileData CreateMetadata(string name, bool cloudSave, int GameMode)
static void ConvertOldTileEntities()
static readonly List< int > TempPartyCelebratingNPCs
static ? int _cachedPartyDaysOnCooldown
static bool IsValidWorld(string file, bool cloudSave)
static ? bool _cachedPartyManual
static int _tempSandstormTimeLeft
static ? float _cachedSandstormSeverity
static float _tempMaxRain
static bool _isWorldOnCloud
static ? int _cachedMoonPhase
static ? int _cachedLanternNightCooldown
static int SaveWorldTiles(BinaryWriter writer)
static bool _tempBloodMoon
static void LoadBestiaryForVersionsBefore210()
static int SaveSigns(BinaryWriter writer)
static void LoadSigns(BinaryReader reader)
static WorldFileData GetAllMetadata(string file, bool cloudSave)
static void ResetTempsToDayTime()
static ? bool _cachedEclipse
static bool _tempPartyManual
static int LoadWorld_Version1_Old_BeforeRelease88(BinaryReader fileIO)
static bool _tempLanternNightNextNightIsGenuine
static int SaveWorldHeader(BinaryWriter writer)
static int SaveTileEntities(BinaryWriter writer)
static void ValidateLoadNPCs(BinaryReader fileIO)
static int _versionNumber
static int LoadFooter(BinaryReader reader)
static ? int _cachedCultistDelay
static void SetOngoingToTemps()
static void LoadWorld_LastMinuteFixes()
static void LoadChests(BinaryReader reader)
static ? int _cachedSandstormTimeLeft
static void SetTempToOngoing()
static int _tempMoonPhase
static int _tempLanternNightCooldown
static ? bool _cachedPartyGenuine
static ? bool _cachedDayTime
static void LoadHeader(BinaryReader reader)
static void DoRollingBackups(string backupWorldWritePath)
static int SaveNPCs(BinaryWriter writer)
static ? double _cachedTime
static Exception LastThrownLoadException
static void LoadWeightedPressurePlates(BinaryReader reader)
static LocalizedText[] gen
static int numLiquidBuffer
static void UpdateLiquid()
static void QuickWater(int verbose=0, int minY=-1, int maxY=-1)
static string GetTextValue(string key)
static string GetWorldPathFromName(string worldName, bool cloudSave)
static float windSpeedTarget
static bool forceXMasForToday
static WorldFileData ActiveWorldFileData
static int invasionSizeStart
static double worldSurface
static bool forceHalloweenForToday
static bool[] tileContainer
static int[] caveBackStyle
static void checkHalloween()
static string DefaultSeed
static string worldPathName
static bool validateSaves
static List< string > anglerWhoFinishedToday
static BestiaryUnlocksTracker BestiaryTracker
static int WorldRollingBackupsCountToKeep
static int moondialCooldown
static bool fastForwardTimeToDawn
static int jungleBackStyle
static bool notTheBeesWorld
static void UpdateTimeRate()
static bool afterPartyOfDoom
static void FakeLoadInvasionStart()
static bool dontStarveWorld
static GenerationProgress AutogenProgress
static bool tenthAnniversaryWorld
static double slimeRainTime
static int sundialCooldown
static float cloudBGActive
static string autoGenFileLocation
static bool[] tileFrameImportant
static FileMetadata WorldFileMetadata
static void StartSlimeRain(bool announce=true)
static bool fastForwardTimeToDusk
static bool downedChristmasSantank
static bool downedTowerSolar
static bool unlockedSlimeRainbowSpawn
static bool unlockedSlimeGreenSpawn
static bool downedTowerVortex
static bool downedMechBoss2
static bool downedFishron
static bool unlockedSlimePurpleSpawn
static bool savedTaxCollector
static void setFireFlyChance()
static int ShieldStrengthTowerMax
static bool TowerActiveStardust
static bool unlockedMerchantSpawn
static bool unlockedSlimeBlueSpawn
static bool downedMechBossAny
static bool downedEmpressOfLight
static bool unlockedDyeTraderSpawn
static bool downedHalloweenKing
static bool downedSlimeKing
static bool unlockedPrincessSpawn
static bool TowerActiveVortex
static bool unlockedTruffleSpawn
static bool combatBookWasUsed
static bool[] ShimmeredTownNPCs
static bool downedTowerStardust
static bool unlockedSlimeRedSpawn
static bool downedMechBoss3
static bool downedPirates
static bool downedMoonlord
static bool unlockedPartyGirlSpawn
static bool TowerActiveSolar
static bool AnyNPCs(int Type)
static bool downedQueenBee
static bool downedHalloweenTree
static bool downedChristmasTree
static bool unlockedSlimeOldSpawn
static bool downedGoblins
static bool peddlersSatchelWasUsed
static bool combatBookVolumeTwoWasUsed
static bool unlockedNurseSpawn
static bool downedGolemBoss
static bool LunarApocalypseIsUp
static bool downedMartians
static bool downedChristmasIceQueen
static bool downedAncientCultist
static void SetWorldSpecificMonstersByWorldID()
static bool unlockedSlimeYellowSpawn
static bool downedPlantBoss
static bool savedBartender
static bool unlockedDemolitionistSpawn
static bool TowerActiveNebula
static bool downedMechBoss1
static bool downedDeerclops
static bool unlockedSlimeCopperSpawn
static bool unlockedArmsDealerSpawn
static bool downedTowerNebula
static bool downedQueenSlime
static void setNPCName(string newName, int npcType, bool resetExtras=false)
static Terraria.Social.Base.CloudSocialModule Cloud
bool isTheSameAs(Tile compTile)
static void ShowFileSavingFailError(Exception exception, string filePath)
static bool Exists(string path, bool cloud)
static void ProtectedInvoke(Action action)
static void Write(string path, byte[] data, int length, bool cloud)
static byte[] ReadAllBytes(string path, bool cloud)
static void Move(string source, string destination, bool cloud, bool overwrite=true, bool forceDeleteSourceFile=false)
static void WriteAllBytes(string path, byte[] data, bool cloud)
static bool TryCreatingDirectory(string folderPath)
static void GenerateWorld(int seed, GenerationProgress customProgressObject=null)
static int shadowOrbCount
static TownRoomManager TownManager
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static void setBG(int bg, int style)
static UnifiedRandom genRand
static TreeTopsInfo TreeTops
static void RandomizeWeather()
static void FixSunflowers()
static int[] CountTileTypesInWorld(params int[] oreTypes)
static void AddUpAlignmentCounts(bool clearCounts=false)
static void RandomizeMoonState(UnifiedRandom random, bool garenteeNewStyle=false)
static void RandomizeCaveBackgrounds()
static bool InWorld(int x, int y, int fluff=0)
static bool shadowOrbSmashed
static bool IsGeneratingHardMode
static DateTime FromBinary(long dateData)
static readonly Guid Empty