-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathLivingWorldMod.cs
63 lines (52 loc) · 1.68 KB
/
LivingWorldMod.cs
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
global using Terraria;
global using Terraria.ModLoader;
global using Terraria.ID;
global using LWM = LivingWorldMod.LivingWorldMod;
using System.IO;
using LivingWorldMod.Globals.Configs;
using LivingWorldMod.Globals.ModTypes;
namespace LivingWorldMod;
public class LivingWorldMod : Mod {
/// <summary>
/// Whether or not to enable IL edit patches on load.
/// Do NOT change unless you know what you're doing!
/// </summary>
public const bool EnableILPatches = true;
/// <summary>
/// Single-ton instance of the Mod class.
/// </summary>
public static LWM Instance {
get;
private set;
}
/// <summary>
/// Whether or not the mod is in Debug, which is determined by if you are building from some
/// IDE as Debug.
/// </summary>
public static bool IsDebug {
get {
bool isDebug = ModContent.GetInstance<DebugConfig>().forceDebugMode;
#if DEBUG
isDebug = true;
#endif
return isDebug;
}
}
/// <summary>
/// Directory of the Sprites for LivingWorldMod.
/// </summary>
public static string SpritePath => nameof(LivingWorldMod) + "/Assets/Sprites/";
/// <summary>
/// Directory of the Music files for LivingWorldMod.
/// </summary>
public static string MusicPath => "Assets/Audio/Music/";
public LivingWorldMod() {
Instance = this;
}
public override void HandlePacket(BinaryReader reader, int whoAmI) {
byte handlerType = reader.ReadByte();
if (PacketHandler.GetHandler(handlerType) is { } handler) {
handler.HandlePacket(reader, whoAmI);
}
}
}