2022-07-04 12:00:19 +01:00
|
|
|
|
2022-07-02 04:35:56 +01:00
|
|
|
using Terraria.ModLoader;
|
2022-07-04 12:00:19 +01:00
|
|
|
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 {
|
2022-07-04 12:00:19 +01:00
|
|
|
public static MagicStorageVoidBag Instance => ModContent.GetInstance<MagicStorageVoidBag>();
|
2022-07-02 11:38:45 +01:00
|
|
|
|
2022-07-04 12:00:19 +01:00
|
|
|
// IL Patches
|
|
|
|
private PlayerUpdatePatch playerUpdatePatch = new();
|
2022-07-02 11:38:45 +01:00
|
|
|
|
2022-07-04 12:00:19 +01:00
|
|
|
public override void Load() {
|
|
|
|
IL.Terraria.Player.Update += playerUpdatePatch.Patch;
|
2022-07-02 11:38:45 +01:00
|
|
|
|
2022-07-04 12:00:19 +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
|
|
|
|
2022-07-04 12:00:19 +01:00
|
|
|
public override void Unload() {
|
|
|
|
IL.Terraria.Player.Update -= playerUpdatePatch.Patch;
|
2022-07-02 11:38:45 +01:00
|
|
|
|
2022-07-04 12:00:19 +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
|
|
|
|
2022-07-04 12:00:19 +01:00
|
|
|
base.Unload();
|
2022-07-02 11:38:45 +01:00
|
|
|
}
|
|
|
|
}
|
2022-07-02 04:35:56 +01:00
|
|
|
}
|