mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Inventory: Show item Damage (#1213)
* /inventory add show item Damage * Removing unnecessary using * Upgrade * Fix * Update Inventory.cs * add Damage * Done * Done, Fix * Remove extra space, Fix documentation
This commit is contained in:
parent
08db87e5f6
commit
33781c5de5
2 changed files with 35 additions and 4 deletions
|
|
@ -70,5 +70,24 @@ namespace MinecraftClient.Inventory
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve item damage from NBT properties. Returns 0 if no damage is defined.
|
||||
/// </summary>
|
||||
public int Damage
|
||||
{
|
||||
get
|
||||
{
|
||||
if (NBT != null && NBT.ContainsKey("Damage"))
|
||||
{
|
||||
object damage = NBT["Damage"];
|
||||
if (damage != null)
|
||||
{
|
||||
return int.Parse(damage.ToString());
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue