-
Notifications
You must be signed in to change notification settings - Fork 3
/
PoTMod.cs
48 lines (40 loc) · 1.19 KB
/
PoTMod.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
using System.Diagnostics;
using ReLogic.Content.Sources;
using System.IO;
using PathOfTerraria.Common.Systems.Networking;
using PathOfTerraria.Core.Sources;
namespace PathOfTerraria;
/// <summary>
/// Path of Terraria <see cref="Mod"/> implementation.
/// </summary>
public sealed class PoTMod : Mod
{
/// <summary>
/// The internal name of the mod.
/// </summary>
public const string ModName = "PathOfTerraria";
/// <summary>
/// A static reference to the current instance of the mod.
/// </summary>
internal static PoTMod Instance => ModContent.GetInstance<PoTMod>();
public override void Load()
{
base.Load();
Debug.Assert(Name == ModName, "Internal mod name does not match expected contsant.");
}
public override void HandlePacket(BinaryReader reader, int whoAmI)
{
Networking.HandlePacket(reader);
}
public override IContentSource CreateDefaultContentSource()
{
// Use our own SmartContentSource which wraps IContentSource with additional
// behavior.
var source = new SmartContentSource(base.CreateDefaultContentSource());
{
// Redirects requests for ModName/Content/... to ModName/Assets/...
source.AddDirectoryRedirect("Content", "Assets");
}
return source;
}
}