コード例 #1
0
        public string GetDisplayName()
        {
            if (Nbt != null)
            {
                if (Nbt.TryGet("display", out NbtCompound display))
                {
                    if (display.TryGet("Name", out NbtString name))
                    {
                        return(name.Value);
                    }
                }
            }

            return(DisplayName);
        }
コード例 #2
0
        public string GetDisplayName()
        {
            if (Nbt != null)
            {
                if (Nbt.TryGet("display", out NbtCompound display))
                {
                    if (display.TryGet("Name", out NbtString name))
                    {
                        if (ValidateJSON(name.Value))
                        {
                            return(ChatParser.ParseText(name.Value));
                        }
                        return(name.Value);
                    }
                }
            }

            return(DisplayName);
        }
コード例 #3
0
ファイル: Item.cs プロジェクト: astroffnet/Alex
        public string GetDisplayName()
        {
            if (Nbt != null)
            {
                if (Nbt.TryGet("display", out NbtCompound display))
                {
                    if (display.TryGet("Name", out NbtString name))
                    {
                        if (Alex.ServerType == ServerType.Java)
                        {
                            return(ChatParser.ParseText(name.Value));
                        }
                        return(name.Value);
                    }
                }
            }

            return(DisplayName);
        }