MagicStorageVoidBag/MagicStorageVoidBag.cs

31 lines
1.1 KiB
C#
Raw Normal View History

2022-07-02 04:35:56 +01:00
using Terraria.ModLoader;
using MagicStorageVoidBag.ILPatches;
using MagicStorageVoidBag.Hooks;
2022-07-02 04:35:56 +01:00
2022-07-02 11:38:45 +01:00
namespace MagicStorageVoidBag {
public class MagicStorageVoidBag : Mod {
public static MagicStorageVoidBag Instance => ModContent.GetInstance<MagicStorageVoidBag>();
2022-07-02 11:38:45 +01:00
// IL Patches
private PlayerUpdatePatch playerUpdatePatch = new();
2022-07-02 11:38:45 +01:00
public override void Load() {
IL.Terraria.Player.Update += playerUpdatePatch.Patch;
2022-07-02 11:38:45 +01:00
On.Terraria.Player.GetItem_VoidVault += GetItemVoidVaultHook.Hook;
On.Terraria.Player.ItemSpaceForCofveve += ItemSpaceForCofveveHook.Hook;
On.MagicStorage.Components.StorageHeart.RightClick += StorageHeartRightClickHook.Hook;
}
2022-07-02 11:38:45 +01:00
public override void Unload() {
IL.Terraria.Player.Update -= playerUpdatePatch.Patch;
2022-07-02 11:38:45 +01:00
On.Terraria.Player.GetItem_VoidVault -= GetItemVoidVaultHook.Hook;
On.Terraria.Player.ItemSpaceForCofveve -= ItemSpaceForCofveveHook.Hook;
On.MagicStorage.Components.StorageHeart.RightClick -= StorageHeartRightClickHook.Hook;
2022-07-02 11:38:45 +01:00
base.Unload();
2022-07-02 11:38:45 +01:00
}
}
2022-07-02 04:35:56 +01:00
}