2020-03-26 15:01:42 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MinecraftClient.Inventory
|
|
|
|
|
|
{
|
2020-03-28 15:01:08 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents an item inside a Container
|
|
|
|
|
|
/// </summary>
|
2020-03-26 15:01:42 +08:00
|
|
|
|
public class Item
|
|
|
|
|
|
{
|
2020-03-28 15:01:08 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Item Type ID
|
|
|
|
|
|
/// </summary>
|
2020-03-26 15:01:42 +08:00
|
|
|
|
public int ID;
|
2020-03-28 15:01:08 +01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Item Count
|
|
|
|
|
|
/// </summary>
|
2020-03-26 15:01:42 +08:00
|
|
|
|
public int Count;
|
2020-03-28 15:01:08 +01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2020-03-28 17:56:17 +01:00
|
|
|
|
/// Slot ID in the parent inventory
|
2020-03-28 15:01:08 +01:00
|
|
|
|
/// </summary>
|
2020-03-28 17:56:17 +01:00
|
|
|
|
/// <remarks>-1 means currently being dragged by mouse</remarks>
|
|
|
|
|
|
public int SlotID;
|
2020-03-28 15:01:08 +01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Item Metadata
|
|
|
|
|
|
/// </summary>
|
2020-03-26 15:01:42 +08:00
|
|
|
|
public Dictionary<string, object> NBT;
|
|
|
|
|
|
|
2020-03-28 15:01:08 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Create an item with Type ID, Count, Slot ID and Metadata
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="ID">Item Type ID</param>
|
|
|
|
|
|
/// <param name="Count">Item Count</param>
|
|
|
|
|
|
/// <param name="SlotID">Item Slot ID in parent inventory</param>
|
|
|
|
|
|
/// <param name="NBT">Item Metadata</param>
|
2020-03-28 17:56:17 +01:00
|
|
|
|
public Item(int id, int count, int slotID, Dictionary<string, object> nbt)
|
2020-03-26 15:01:42 +08:00
|
|
|
|
{
|
2020-03-28 17:56:17 +01:00
|
|
|
|
this.ID = id;
|
|
|
|
|
|
this.Count = count;
|
|
|
|
|
|
this.SlotID = slotID;
|
|
|
|
|
|
this.NBT = nbt;
|
2020-03-26 15:01:42 +08:00
|
|
|
|
}
|
2020-03-28 15:01:08 +01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Create an item with Type ID, Count and Slot ID
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="ID">Item Type ID</param>
|
|
|
|
|
|
/// <param name="Count">Item Count</param>
|
|
|
|
|
|
/// <param name="SlotID">Item Slot ID in parent inventory</param>
|
2020-03-28 17:56:17 +01:00
|
|
|
|
public Item(int id, int count, int slotID)
|
2020-03-26 15:01:42 +08:00
|
|
|
|
{
|
2020-03-28 17:56:17 +01:00
|
|
|
|
this.ID = id;
|
|
|
|
|
|
this.Count = count;
|
|
|
|
|
|
this.SlotID = slotID;
|
|
|
|
|
|
this.NBT = new Dictionary<string, object>();
|
2020-03-26 15:01:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|