Fix NetItem serialization/deserialization
This commit is contained in:
parent
d5fb8726cc
commit
ad5ec1c252
2 changed files with 10 additions and 5 deletions
|
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using Terraria;
|
||||
|
||||
namespace TShockAPI
|
||||
|
|
@ -9,6 +10,7 @@ namespace TShockAPI
|
|||
/// <summary>
|
||||
/// Represents an item.
|
||||
/// </summary>
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public struct NetItem
|
||||
{
|
||||
/// <summary>
|
||||
|
|
@ -26,9 +28,12 @@ namespace TShockAPI
|
|||
/// </summary>
|
||||
public static readonly int MaxInventory = 83;
|
||||
|
||||
private readonly int _netId;
|
||||
private readonly byte _prefixId;
|
||||
private readonly int _stack;
|
||||
[JsonProperty("netID")]
|
||||
private int _netId;
|
||||
[JsonProperty("prefix")]
|
||||
private byte _prefixId;
|
||||
[JsonProperty("stack")]
|
||||
private int _stack;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the net ID.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue