Bump version to 1.1.2
Cleaner item list display Allow full item list as file Fixed online status message with new handler
This commit is contained in:
@ -19,4 +19,6 @@ public class Fluid {
|
||||
: $"{Amount:n0} mB of {DisplayName}";
|
||||
[JsonIgnore]
|
||||
public string CleanDisplayName => DisplayName[1..^1];
|
||||
[JsonIgnore]
|
||||
public string? TagString => Tags is string[] tags ? string.Join(", ", tags) : null;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
|
||||
namespace MinecraftDiscordBot.Models;
|
||||
|
||||
@ -10,5 +11,23 @@ public class Item : Fluid {
|
||||
public Md5Hash Fingerprint { get; set; } = default!;
|
||||
[JsonProperty("nbt", Required = Required.DisallowNull)]
|
||||
public dynamic? NBT { get; set; }
|
||||
public override string ToString() => $"{Amount:n0}x {DisplayName}";
|
||||
public override string ToString() => $"{AmountString} {CleanDisplayName}";
|
||||
[JsonIgnore]
|
||||
public string DetailString {
|
||||
get {
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendFormat("{0} {1}, fp: {2}", AmountString, CleanDisplayName, Fingerprint);
|
||||
if (TagString is string tags)
|
||||
sb.AppendFormat(", tags: [{0}]", tags);
|
||||
if (NBT is not null)
|
||||
sb.AppendFormat(", NBT: {0}", JsonConvert.SerializeObject(NBT));
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
[JsonIgnore]
|
||||
public string AmountString => Amount switch {
|
||||
> 1000000 => $"> {Amount / 1000000:n0}m",
|
||||
> 10000 => $"~ {Amount / 1000.0f:n2}k",
|
||||
_ => Amount.ToString()
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user