dev: tmodporter changes
This commit is contained in:
parent
d8c4649f92
commit
278a0d9278
@ -12,7 +12,7 @@ using Terraria.ModLoader;
|
||||
namespace MagicStorageVoidBag.Hooks {
|
||||
internal class GetItemVoidVaultHook {
|
||||
private static readonly log4net.ILog Logger = MagicStorageVoidBag.Instance.Logger;
|
||||
public static bool Hook(On.Terraria.Player.orig_GetItem_VoidVault orig, Player player, int plr, Item[] inventory, Item newItem, GetItemSettings settings, Item returnItem) {
|
||||
public static bool Hook(Terraria.On_Player.orig_GetItem_VoidVault orig, Player player, int plr, Item[] inventory, Item newItem, GetItemSettings settings, Item returnItem) {
|
||||
var i = player.inventory.FirstOrDefault(i => i.type == ModContent.ItemType<MSVoidBag>(), null);
|
||||
|
||||
newItem = newItem.Clone();
|
||||
|
@ -16,7 +16,7 @@ namespace MagicStorageVoidBag.Hooks {
|
||||
private static readonly log4net.ILog Logger = MagicStorageVoidBag.Instance.Logger;
|
||||
|
||||
// Despite the constant negative press cofveve
|
||||
public static bool Hook(On.Terraria.Player.orig_ItemSpaceForCofveve orig, Player player, Item newItem) {
|
||||
public static bool Hook(Terraria.On_Player.orig_ItemSpaceForCofveve orig, Player player, Item newItem) {
|
||||
var i = player.inventory.FirstOrDefault(i => i.type == ModContent.ItemType<MSVoidBag>(), null);
|
||||
if (i == null) goto original;
|
||||
|
||||
|
@ -11,17 +11,17 @@ namespace MagicStorageVoidBag {
|
||||
private PlayerUpdatePatch playerUpdatePatch = new();
|
||||
|
||||
public override void Load() {
|
||||
IL.Terraria.Player.Update += playerUpdatePatch.Patch;
|
||||
Terraria.IL_Player.Update += playerUpdatePatch.Patch;
|
||||
|
||||
On.Terraria.Player.GetItem_VoidVault += GetItemVoidVaultHook.Hook;
|
||||
On.Terraria.Player.ItemSpaceForCofveve += ItemSpaceForCofveveHook.Hook;
|
||||
Terraria.On_Player.GetItem_VoidVault += GetItemVoidVaultHook.Hook;
|
||||
Terraria.On_Player.ItemSpaceForCofveve += ItemSpaceForCofveveHook.Hook;
|
||||
}
|
||||
|
||||
public override void Unload() {
|
||||
IL.Terraria.Player.Update -= playerUpdatePatch.Patch;
|
||||
Terraria.IL_Player.Update -= playerUpdatePatch.Patch;
|
||||
|
||||
On.Terraria.Player.GetItem_VoidVault -= GetItemVoidVaultHook.Hook;
|
||||
On.Terraria.Player.ItemSpaceForCofveve -= ItemSpaceForCofveveHook.Hook;
|
||||
Terraria.On_Player.GetItem_VoidVault -= GetItemVoidVaultHook.Hook;
|
||||
Terraria.On_Player.ItemSpaceForCofveve -= ItemSpaceForCofveveHook.Hook;
|
||||
|
||||
base.Unload();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user