コード例 #1
0
ファイル: Head.cs プロジェクト: Sidneys1/MinecraftMultitool
        public override string GenerateJson(bool topLevel)
        {
            var b = new StringBuilder(base.GenerateJson(false));

            if (Type != SkullType.Inherit)
            {
                b.AppendFormat("SkullType:{0:D}b,", Type);
            }

            if (Rotation != SignRotation.Inherit)
            {
                b.AppendFormat("Rot:{0:D}b,", Rotation);
            }

            if (Type == SkullType.Player && !string.IsNullOrWhiteSpace(ExtraType))
            {
                b.AppendFormat("ExtraType:\"{0}\",", ExtraType.EscapeJsonString());
            }

            return(b.ToString());
        }