-
Notifications
You must be signed in to change notification settings - Fork 0
/
API.cs
23 lines (18 loc) · 827 Bytes
/
API.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using HamstarHelpers.Helpers.TModLoader;
using System;
using Terraria;
using Terraria.ModLoader.Config;
namespace Licenses {
public static partial class LicensesAPI {
public static void TrialLicenseItemForCurrentPlayer( Item item, bool playSound ) {
var itemDef = new ItemDefinition( item.type );
var myplayer = (LicensesPlayer)TmlHelpers.SafelyGetModPlayer( Main.LocalPlayer, LicensesMod.Instance, "LicensesPlayer" );
myplayer.TrialLicenseItemByDefinition( itemDef, playSound );
}
public static void LicenseItemForCurrentPlayer( Item item, bool playSound ) {
var itemDef = new ItemDefinition( item.type );
var myplayer = (LicensesPlayer)TmlHelpers.SafelyGetModPlayer( Main.LocalPlayer, LicensesMod.Instance, "LicensesPlayer" );
myplayer.LicenseItemByDefinition( itemDef, playSound );
}
}
}