Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/assets/pictures/project-export/actions.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pictures/project-export/settings.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 87 additions & 0 deletions docs/en/project-export.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: Exporting a Project
order: 5
---

<center><h1>Exporting a Project</h1></center>

*Build a HollowEngine project into a distributable JAR, import it back, and prepare it for publishing.*

Starting with HollowEngine 2.3.2, a project can be built into a `.jar` archive that Minecraft loaders recognize as a regular mod. The same exported file works on both **NeoForge** and **Fabric** for Minecraft 1.21.1.

:::warning
An exported project is still a HollowEngine addon. It will not start unless HollowEngine 2.3.2 or newer is installed.
:::

## Project toolbar

The **Project** panel provides three actions:

1. **Project Settings** - metadata and dependencies for the future mod. This is also where you configure the dependent mods and add-ons that you can use in your scripts during development.
2. **Import Project** - restores a previously exported project, provided the source code was included in the archive.
3. **Export Project** - compiles scripts and builds the finished `.jar` archive. If necessary, you can disable the export of the project’s source code here; however, this will make it impossible to import it back later.

![Settings, import, and export buttons in the Project panel](/hollowengine/pictures/project-export/actions.webp)

## Project settings

Open **Project settings** and fill in the mod metadata.

| Setting | Purpose |
|---------|---------|
| **Id** | The project's code name and default namespace. For example, `my_item` in the `dev-project` project receives the identifier `dev-project:my_item`. |
| **Name** | The display name used in the mod list, item tooltips, and other UI. |
| **Version** | The current project version. It is also included in the exported filename. |
| **Runs on** | Where the project may run: client, server, or both sides. |
| **Description** | A short project description stored in the mod metadata. |
| **Authors** | The project authors. |
| **License** | The terms under which the project is distributed. A license is usually required for publishing on CurseForge or Modrinth. |
| **Icon** | A path to a PNG file inside the project, such as `icon.png`. |
| **Addon dependencies** | Additional HollowEngine modules required by the project. |

![Project settings window](/hollowengine/pictures/project-export/settings.webp)

Select **Save** after changing the settings.

## Exporting the project

Select **Export project**, then:

1. Check the version of the resulting mod.
2. Choose whether to include script sources.
3. Select where to save the JAR.
4. Select **Export**.

### Exporting with or without sources

When **Include script sources** is enabled, the archive can later be imported back into the editor to continue development.

When it is disabled, the JAR contains compiled scripts only. Importing it back and recovering the exact source project structure will not be available. This is useful for a public build, but it is not a substitute for keeping a backup of the source project.

HollowEngine compiles all scripts during export. If a script cannot be compiled, the build ends with an error. After a successful build, the engine displays the path to the resulting file and offers to reveal it in the file explorer.

![Successful export message](/hollowengine/pictures/project-export/export-success.webp)

The finished archive contains resources, data, loader metadata, and compiled scripts. It is a normal mod JAR, so it can be sent to another player or published on a mod distribution platform.
For now, cutscenes aren't supported during export because they aren't tied to a specific add-on; you'll likely have to move your cutscenes to a different section later on.

![Contents of an exported JAR](/hollowengine/pictures/project-export/jar-contents.webp)

## Installing and publishing

You can place the finished JAR file in one of the modpack folders:

- `mods` - like a regular mod, it will appear in the mod list;
- `hollowengine/addons` - as a HollowEngine addon, it won't appear in the mod list, but you can update it almost without restarting the game.

Once HollowEngine 2.3.2 is released, the project can be published on CurseForge or Modrinth. Always declare HollowEngine as a required dependency. If the project is started without the engine, the mod loader stops loading and reports the missing dependency.

![Missing HollowEngine dependency error](/hollowengine/pictures/project-export/missing-dependency.webp)

## Importing a project

To continue working on a previously exported project, select **Import project** and choose its JAR file.

![Selecting a JAR to import](/hollowengine/pictures/project-export/import-dialog.webp)

Import is available only for archives that were exported with script sources included. A project exported without sources cannot be restored this way.
87 changes: 87 additions & 0 deletions docs/ru/project-export.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: Экспорт проекта
order: 5
---

<center><h1>Экспорт проекта</h1></center>

*Как экспортировать проект HollowEngine в готовый JAR, импортировать его обратно.*

Начиная с HollowEngine 2.3.3, проект можно собрать в `.jar`-архив, который загрузчики модов распознают как обычный мод. Один и тот же экспортированный файл работает на **NeoForge** и **Fabric** для Minecraft 1.21.1.

:::warning
Экспортированный проект остаётся аддоном HollowEngine. Без установленного HollowEngine версии 2.3.3 или новее он не запустится.
:::

## Панель проекта

На панели **Проект** появились три действия:

1. **Настройки проекта** - метаданные и зависимости будущего мода. Там же настраиваются зависимые моды и аддоны, которые вы можете использовать в скриптах при разработке.
2. **Импорт проекта** - восстановление ранее экспортированного проекта, если в архив были включены исходники.
3. **Экспорт проекта** - компиляция скриптов и сборка готового `.jar` архив. При необходимости здесь можно отключить экспорт исходного кода проекта, тогда импортировать его обратно будет невозможно.

![Кнопки настроек, импорта и экспорта на панели проекта](/hollowengine/pictures/project-export/actions.webp)

## Настройки проекта

Откройте **Настройки проекта** и заполните параметры будущего мода.

| Параметр | Назначение |
|----------|------------|
| **Id** | Кодовое имя проекта и namespace по умолчанию. Например, предмет `my_item` в проекте `dev-project` получит идентификатор `dev-project:my_item`. |
| **Название** | Отображаемое имя проекта. Оно используется в списке модов, подсказках предметов и других элементах интерфейса. |
| **Версия** | Текущая версия проекта. Она также входит в имя экспортированного файла. |
| **Где работает** | Сторона, на которой может запускаться проект: клиент, сервер или обе стороны. |
| **Описание** | Краткое описание проекта для метаданных мода. |
| **Авторы** | Авторы проекта. |
| **Лицензия** | Условия распространения проекта. Лицензия обычно требуется при публикации на CurseForge или Modrinth. |
| **Иконка** | Путь к PNG-файлу внутри проекта, например `icon.png`. |
| **Зависит от аддонов** | Дополнительные модули HollowEngine, которые понадобятся проекту. |

![Окно настроек проекта](/hollowengine/pictures/project-export/settings.webp)

После изменения параметров нажмите **Сохранить**.

## Экспорт проекта

Нажмите **Экспорт проекта**, затем:

1. Проверьте версию будущего мода.
2. Решите, нужно ли включать исходники скриптов.
3. Выберите путь для сохранения JAR.
4. Нажмите **Экспортировать**.

### Экспорт с исходниками и без них

Если включить **Включить исходники скриптов**, архив впоследствии можно импортировать обратно в редактор и продолжить разработку.

Если выключить параметр, в JAR попадут только скомпилированные скрипты. Обратный импорт и точное восстановление исходной структуры проекта будут недоступны. Это подходит для публичной сборки, но не заменяет резервную копию проекта.

Во время экспорта HollowEngine компилирует скрипты. Если какой-либо из них не удастся скомпилировать, сборка завершится с ошибкой. После успешной сборки движок покажет путь к готовому файлу и предложит открыть его в проводнике.

![Сообщение об успешном экспорте](/hollowengine/pictures/project-export/export-success.webp)

Готовый архив содержит ресурсы, данные, метаданные загрузчиков и скомпилированные скрипты. Это обычный JAR мода, поэтому его можно передать другому игроку или опубликовать на платформе распространения модов.
Пока что при экспорте не поддерживаются катсцены, поскольку у них нет привязки к конкретному аддону, позже вероятно придётся переносить ваши катсцены в другой раздел.

![Содержимое экспортированного JAR](/hollowengine/pictures/project-export/jar-contents.webp)

## Установка и публикация

Готовый JAR можно положить в одну из папок модпака:

- `mods` - как обычный мод, будет виден в списке модов;
- `hollowengine/addons` - как аддон HollowEngine, не будет виден в списке модов, но зато можно обновлять его без перезапуска игры.

После выхода HollowEngine 2.3.2 проект можно опубликовать на CurseForge или Modrinth. При публикации обязательно укажите HollowEngine как зависимость. Если запустить проект без движка, загрузчик остановит запуск и сообщит об отсутствующей зависимости.

![Ошибка запуска без установленного HollowEngine](/hollowengine/pictures/project-export/missing-dependency.webp)

## Импорт проекта

Чтобы продолжить работу над ранее экспортированным проектом, нажмите **Импорт проекта** и выберите его JAR-файл.

![Выбор JAR для импорта](/hollowengine/pictures/project-export/import-dialog.webp)

Импорт работает только для архивов, при экспорте которых были включены исходники скриптов. Проект, экспортированный без исходников, восстановить этим способом нельзя.