-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGradiusModWorld.cs
More file actions
47 lines (39 loc) · 1.16 KB
/
GradiusModWorld.cs
File metadata and controls
47 lines (39 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System.Collections.Generic;
using System.IO;
using Terraria;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
namespace ChensGradiusMod
{
public class GradiusModWorld : ModWorld
{
public static bool bigcoreDowned;
public override void Initialize()
{
bigcoreDowned = false;
}
public override void Load(TagCompound tag)
{
var downed = tag.GetList<string>("downed");
bigcoreDowned = downed.Contains("bigcorecustom");
}
public override TagCompound Save()
{
var downed = new List<string>();
if (bigcoreDowned) downed.Add("bigcorecustom");
return new TagCompound { ["downed"] = downed };
}
public override void NetSend(BinaryWriter writer)
{
var flags = new BitsByte();
flags[0] = bigcoreDowned;
writer.Write(flags);
}
public override void NetReceive(BinaryReader reader)
{
BitsByte flags = reader.ReadByte();
bigcoreDowned = flags[0];
}
public static bool IsBigCoreDowned() => bigcoreDowned;
}
}