- Contribution to TerraFirmaGreg-Modern
- Table of Contents
- English Version
- 1. Required and Recommended Software
- 2. Project Preparation
- Step 1: Creating a New Instance in PrismLauncher
- Step 2: Finding the Prism Folder
- Step 3: Make a fork of the Repository
- Step 4: Cloning the Repository
- Step 5: Copying and linking development & instance folders
- Step 6: Synchronizing Dependencies via Pakku
- Step 7: Working with Branches and Creating Pull Request
- Step 8: Processing and Merging Pull Request
- 3. Additional Recommendations
- Russian Version
- 1. Необходимое и рекомендуемое ПО
- 2. Подготовка проекта
- Шаг 1: Клонирование основного репозитория
- Шаг 2: Создание новой инстанции в PrismLauncher
- Шаг 3: Очистка папки проекта
- Шаг 4: Клонирование репозитория в пустую папку
- Шаг 5: Синхронизация зависимостей через Pakku
- Шаг 6: Работа с ветками и создание Pull Request
- Шаг 7: Обработка и вливание Pull Request
- 3. Дополнительные рекомендации
Video Guide: https://www.youtube.com/watch?v=vLL7jTtuOuw
- Git: A version control system for managing source code.
- Pakku: A tool for dependency management and modpack building.
Warning
Ensure that Java version 17 is installed on your machine, as it is required for Forge and Pakku to function properly.
- PrismLauncher: An optimized launcher for Minecraft modifications, making it easier to create separate instances.
- Github Desktop A graphical client for managing Git repositories developed by GitHub.
- Visual Studio Code: A code editor with extensive capabilities for working with projects and integrating various plugins.
- Github Pull Requests Has many of the features of Github Desktop built in for an all-in-one editing suite.
- Open PrismLauncher and click on the
Add Instancebutton. - In the Name field, enter the name
TerraFirmaGreg-Modern. - Select Minecraft version
1.20.1and Forge version47.4.13— these versions are necessary for the modpack to work correctly.
- Locate the instance folder in the PrismLauncher directory at
TerraFirmaGreg-Modern/minecraft.
You can do all of this in a web browser.
- Open TerraFirmaGreg-Modern repository.
- Make sure you are signed in, and press
Fork. - Configure and press
Create fork
First, create a new folder to store your development folder, to prevent configs getting messed up.
Method A: Visual Studio Code
- Open Visual Studio Code and ensure your are logged into github. (Bottom left user)
- Press Ctrl + Shift + P to open the Command Palette.
- Search
Git: Cloneand select it. - Select
Clone from Github. - Search your repository name ("YourNameHere/TerraFirmaGreg-Modern") and select it.
- If you are prompted to open existing clone, press
Clone Again. - Select your development folder to clone into.
Method B: GitHub Desktop
- Open GitHub Desktop and log in.
- Select File → Clone repository...
- On the URL tab, enter:
https://github.com/YourNameHere/TerraFirmaGreg-Modern.git - In the Local Path field, select your development folder.
- Click Clone.
Method C: Terminal / cmd This can also be done inside VSCode, using the terminal at the bottom of your screen.
- Open terminal or cmd in the root directory of your development folder.
- Execute the command:
git clone https://github.com/YourNameHere/TerraFirmaGreg-Modern.git- Copy all of your files from your development folder into the
minecraftfolder. - Delete any folders you are going to change. The most likely one is
kubejs. - Symbolically link your development
kubejsfolder to your prism folder. There are a few ways to do this, the easiest being usingmklink Link Targetin a command prompt.
Tip
This is done so you can edit files in your development instance without your game messing up most files.
If you update your development instance, you should also update your prism instance.
It is technically possible to develop in your instance folder, but strongly discouraged.
If you do, use .git/info/exclude like a local .gitignore.
- Open terminal or cmd in the root directory of your Prism instance folder.
- Execute the following command:
pakku fetchTip
This command downloads all necessary project files into the modpack's folder. Note that the command may differ depending on how Pakku was installed.
Warning
This will not update your TerraFirmaGreg-Core-Modern! Keep following.
- Open TerraFirmaGreg-Core-Modern and download latest release.
- In your mods folder, find the TerraFirmaGreg-Core-Modern jar file, delete it, and replace it with the one you just downloaded.
Tip
Even newer releases may be available in Github Actions. Additionally, if you are developing TerraFirmaGreg-Core-Modern, you can copy your built jars to test them.
There are two approaches to creating a Pull Request: via terminal and via Visual Studio Code.
Branch Designation
-
main:- This branch contains the stable, tested, and released version of the project.
- It should only contain changes that have passed the full review cycle.
- Changes can be accepted by members of the Project-Lead team; at least one approval is required.
-
dev:- The main development branch where new features, bug fixes, and experimental changes are integrated.
- After testing, changes from dev may be merged into the main branch for a new version release.
- Changes can be accepted by members of the Modern-Team team; at least two approvals are required.
-
feature/bugfix-branch:- For example, (
feature/add-custom-quest) or (bugfix/fix-launch-crash). - It is recommended to create separate branches from dev for developing specific features or fixing bugs.
- After completing the work, merge them back into dev.
- Members of the Modern-Team team can create branches in the main repository.
- For example, (
Tip
Remember, you can make branches in your fork freely! It makes pull requests a lot easier.
Process of Creating Pull Request
Method A: Visual Studio Code
Tip
Most everything in VSCode can also be done through the command palette!
-
Creating a New Branch:
- Open Visual Studio Code and ensure that you are in your development folder.
- In the sidebar, open the Source Control menu.
- Next to changes, click the three dots and click
Branch > Create Branch - In the appearing window, enter a name for your new branch (e.g.,
feature/add-custom-questorbugfix/fix-launch-crash). - Press Enter to confirm. Now you are in a new branch created from the dev branch.
-
Making and Committing Changes:
- Make the necessary changes to the project.
- Return to Source Control, where you will see a list of modified files.
- Add a description of your changes, enter a commit message, and click
Commit.
-
Publishing the Branch:
- After committing changes, click the new
Pushbutton. - This will send your new branch to GitHub.
- After committing changes, click the new
-
Creating Pull Request:
- After a successful push, you can open the Github Pull Requests menu, if installed, and press Create Pull Request.
- Ensure that:
- The base branch for merging is set to
devof the main repository. - The title and description of the Pull Request contain detailed descriptions of the changes made, as well as links to related Issues if necessary.
- The base branch for merging is set to
- Click Create Pull Request to send a request to merge your changes into the dev branch.
Tip
You can also create a pull request using the website, if you prefer.
Method B: GitHub Desktop
-
Creating a New Branch:
- Open GitHub Desktop and ensure that your local repository
TerraFirmaGreg-Modernis selected. - In the top menu, select
Branch → New Branch.... - In the appearing window, enter a name for your new branch (e.g.,
feature/add-custom-questorbugfix/fix-launch-crash). - Click
Create Branch. Now you are in a new branch created from the dev branch.
- Open GitHub Desktop and ensure that your local repository
-
Making and Committing Changes:
- Make the necessary changes to the project using your favorite code editor (e.g., Visual Studio Code).
- Return to GitHub Desktop, go to the
Changestab, where you will see a list of modified files. - Add a description of your changes, enter a commit message, and click
Commit to <branch_name>.
-
Publishing the Branch:
- After committing changes, click the
Push originbutton in the top right corner of GitHub Desktop. - This will send your new branch to GitHub.
- After committing changes, click the
-
Creating Pull Request:
- After a successful push, GitHub Desktop will offer you a Create Pull Request button or a link View on GitHub. Click it.
- In the opened web interface of GitHub, ensure that:
- The base branch for merging is set to
devof the main repository. - The title and description of the Pull Request contain detailed descriptions of the changes made, as well as links to related Issues if necessary.
- The base branch for merging is set to
- Click Create Pull Request to send a request to merge your changes into the dev branch.
Method C: Using terminal / cmd
- Synchronizing with upstream:
- Ensure that your local repository is up-to-date. If you have already set up remote upstream (the official repository), execute:
git checkout dev
git pull upstream dev- Creating a new branch for changes:
- From the dev branch, create a new feature or bugfix branch:
git checkout -b feature/name-of-feature- Name your branch clearly (e.g., feature/add-custom-quest or bugfix/fix-crash-on-launch).
- Making changes:
- Make changes to the code, accompanied by commits with clear messages:
git add .
git commit -m "Brief description of changes made"- Pushing the branch to GitHub:
- Push your branch to your fork:
git push origin feature/name-of-feature- Creating Pull Request:
- Go to the page of your fork on GitHub.
- Click the Compare & Pull Request button next to the just pushed branch.
- Ensure that dev of the main repository is selected as the base branch.
- Fill in the title and description of the Pull Request, mention which problems this PR solves, and if possible, provide links to corresponding Issues.
- Send the request by clicking Create Pull Request.
Tip
If you have questions about formatting a Pull Request or are unsure with which branch to merge, refer to the project documentation or contact the team via Discord.
- Reviewing Pull Request:
- After creating a Pull Request, it enters a queue for review by members of the team.
- Members of Dev-Modern (for merging into main) or Contributor-Modern (for merging into dev) review the changes made, leave comments, and request revisions if necessary.
- Making Corrections:
- If corrections are required, the PR author makes them in their branch, and the updated commit automatically appears in the open request.
- Approval:
- After making all necessary corrections and receiving positive feedback from reviewers, the PR is considered approved.
- To merge changes into main, at least one approval from members of the Dev-Modern team is required.
- For merging into dev – at least two approvals from members of the Contributor-Modern team are required.
- Merging Pull Request:
- After approval, an authorized member or maintainer performs the merge PR (using Squash and Merge according to project rules).
- After successful merging, it is recommended to delete the branch to maintain repository cleanliness.
- Post-Merge:
- The merge of PR triggers build and testing processes to ensure the stability of the changes made.
- If issues are discovered after merging, a new Pull Request is created for their resolution.
-
- The project follows Semantic Versioning.
- Patch: Bug fixes and small changes (
1.0.0→1.0.1) - Minor: New features that don't break compatibility (
1.0.0→1.1.0) - Major: Breaking changes (
1.0.0→2.0.0)
-
- Create separate branches for each new functionality or bug fix.
- Regularly synchronize your fork with the original repository to avoid conflicts.
- Use clear commit messages for better understanding of changes.
-
- Before making your changes, ensure that the project runs without errors.
- Check PrismLauncher logs to identify potential issues.
- Using Visual Studio Code with the ProbeJs extension helps quickly detect and fix errors.
-
- If you have questions or problems, refer to the Issues or Discussions section of the GitHub project, as well as forums on Discord.
- Collective discussion often leads to finding optimal solutions and improving the project overall.
-
- Always test the integration of your changes with the main project.
- Before sending a Pull Request, it is important to ensure that your changes do not disrupt the modpack's operation and comply with internal code of conduct.
-
- If you're looking for Localizing the modpack to a Language, please feel free to head to the Crowdin
-
All development tools configuration is located in the
kubejs/folder.Installation:
# From the modpack root npm install --prefix kubejs # Or from the kubejs folder npm install
Running the linter:
# From the modpack root npm run lint --prefix kubejs npm run lint:fix --prefix kubejs # Or from the kubejs folder cd kubejs npm run lint npm run lint:fix
Code formatting (Prettier):
# Format all files npm run format --prefix kubejs # Check formatting without changes npm run format:check --prefix kubejs
TypeScript checking:
- Install dependencies (see above)
- Run ProbeJS to generate types
- Set
"noCheck": falseinkubejs/tsconfig.json
- Git: Система контроля версий для управления исходным кодом.
- Pakku: Инструмент для управления зависимостями и сборкой модпака.
Warning
Убедитесь, что на вашей машине установлена 17 версия Java, необходимая для работы Forge и Pakku.
- PrismLauncher: Лаунчер, оптимизированный для работы с модификациями Minecraft, облегчающий создание отдельных инстанций.
- Github Desktop: Графический клиент для управления Git-репозиториями, разработанный GitHub.
- Visual Studio Code: Редактор кода с широкими возможностями для работы с проектами и интеграции различных плагинов.
- Github Pull Requests: Имеет многие функции Github Desktop, встроенные в единую среду редактирования.
- Откройте PrismLauncher и нажмите на кнопку
Add Instance. - В поле Name введите название
TerraFirmaGreg-Modern. - Выберите версию Minecraft
1.20.1и версию Forge47.4.13— эти версии необходимы для корректной работы модпака.
- Найдите папку инстанции в директории PrismLauncher по пути
TerraFirmaGreg-Modern/minecraft.
Вы можете сделать всё это в веб-браузере.
- Откройте репозиторий TerraFirmaGreg-Modern.
- Убедитесь, что вы вошли в систему, и нажмите
Fork. - Настройте и нажмите
Create fork.
Сначала создайте новую папку для хранения вашей папки разработки, чтобы избежать путаницы с конфигами.
Способ A: Visual Studio Code
- Откройте Visual Studio Code и убедитесь, что вы вошли в GitHub (пользователь в левом нижнем углу).
- Нажмите Ctrl + Shift + P, чтобы открыть палитру команд.
- Найдите
Git: Cloneи выберите его. - Выберите
Clone from Github. - Найдите имя вашего репозитория ("YourNameHere/TerraFirmaGreg-Modern") и выберите его.
- Если вам предложат открыть существующий клон, нажмите
Clone Again. - Выберите вашу папку разработки для клонирования.
Способ B: GitHub Desktop
- Откройте GitHub Desktop и войдите в систему.
- Выберите File → Clone repository...
- На вкладке URL введите:
https://github.com/YourNameHere/TerraFirmaGreg-Modern.git - В поле Local Path выберите вашу папку разработки.
- Нажмите Clone.
Способ C: Terminal / cmd Это также можно сделать внутри VSCode, используя терминал в нижней части экрана.
- Откройте terminal или cmd в корневой директории вашей папки разработки.
- Выполните команду:
git clone https://github.com/YourNameHere/TerraFirmaGreg-Modern.git- Скопируйте все файлы из вашей папки разработки в папку
minecraft. - Удалите любые папки, которые вы собираетесь изменять. Наиболее вероятная -
kubejs. - Создайте символическую ссылку из вашей папки разработки
kubejsв папку Prism. Есть несколько способов сделать это, самый простой - использоватьmklink Link Targetв командной строке.
Tip
Это делается для того, чтобы вы могли редактировать файлы в вашей среде разработки, не нарушая работу большинства файлов в игре. Если вы обновляете среду разработки, вам также следует обновить инстанцию Prism. Технически возможно разрабатывать прямо в папке инстанции, но это крайне не рекомендуется.
- Откройте terminal или cmd в корневой директории папки вашей инстанции Prism.
- Выполните следующую команду:
pakku fetchTip
Эта команда загружает все необходимые файлы проекта в папку модпака. Учтите, что команда может отличаться в зависимости от способа установки Pakku.
Warning
Это не обновит ваш TerraFirmaGreg-Core-Modern! Продолжайте следовать инструкциям.
- Откройте TerraFirmaGreg-Core-Modern и скачайте последний релиз.
- В папке mods найдите jar-файл TerraFirmaGreg-Core-Modern, удалите его и замените на только что скачанный.
Tip
Более новые версии могут быть доступны в Github Actions. Кроме того, если вы разрабатываете TerraFirmaGreg-Core-Modern, вы можете скопировать собранные jar-файлы для их тестирования.
Есть три подхода для создания Pull Request: через Visual Studio Code, через GitHub Desktop и через терминал.
Назначение веток
-
main::- Эта ветка содержит стабильную, протестированную и релизную версию проекта.
- В ней должны находиться только изменения, прошедшие полный цикл проверки.
- Принимать изменения могут участники команды Project-Lead; требуется одобрение хотя бы одного.
-
dev::- Основная ветка для разработки, где интегрируются новые функции, исправления ошибок и экспериментальные изменения.
- После тестирования изменения из dev могут быть перенесены в ветку main для выпуска новой версии.
- Принимать изменения могут участники команды Modern-Team; требуется одобрение хотя бы двух.
-
feature/bugfix-branch::- Например, (
feature/add-custom-quest) или (bugfix/fix-launch-crash). - Рекомендуется создавать отдельные ветки от dev для разработки конкретных функций или исправления ошибок.
- После завершения работы их следует слить обратно в dev.
- Участники команды Modern-Team могут создавать ветки в основном репозитории.
- Например, (
Tip
Помните, что вы можете свободно создавать ветки в своём форке! Это значительно упрощает создание pull request.
Процесс создания Pull Request
Warning
Если вы изменили конфигурационный файл, он может не учитываться. Почему? Проверьте .gitignore и удалите его из списка, если вы внесли в него изменения. Часто игра обновляет эти файлы самостоятельно, что нормально, но если модпак вообще не использует их, не добавляйте новые файлы в коммит. Если мод обновил конфиг, проверьте его и убедитесь, что наши настройки не были случайно изменены.
Способ A: Visual Studio Code
Tip
Большинство действий в VSCode можно выполнить через палитру команд!
-
Создание новой ветки:
- Откройте Visual Studio Code и убедитесь, что вы находитесь в папке разработки.
- На боковой панели откройте меню Source Control.
- Рядом с изменениями нажмите на три точки и выберите
Branch > Create Branch. - В появившемся окне введите имя для вашей новой ветки (например,
feature/add-custom-questилиbugfix/fix-launch-crash). - Нажмите Enter для подтверждения. Теперь вы находитесь в новой ветке, созданной от ветки dev.
-
Внесение и фиксация изменений:
- Внесите необходимые изменения в проект.
- Вернитесь в Source Control, где вы увидите список изменённых файлов.
- Добавьте описание ваших изменений, введите сообщение коммита и нажмите
Commit.
-
Публикация ветки:
- После фиксации изменений нажмите новую кнопку
Push. - Это отправит вашу новую ветку на GitHub.
- После фиксации изменений нажмите новую кнопку
-
Создание Pull Request:
- После успешной отправки вы можете открыть меню Github Pull Requests, если оно установлено, и нажать Create Pull Request.
- Убедитесь, что:
- Базовая ветка для слияния установлена как
devосновного репозитория. - Заголовок и описание Pull Request содержат подробное описание внесённых изменений, а также при необходимости ссылки на связанные Issues.
- Базовая ветка для слияния установлена как
- Нажмите Create Pull Request, чтобы отправить запрос на слияние ваших изменений в ветку dev.
Tip
Вы также можете создать pull request через веб-сайт, если предпочитаете.
Способ B: GitHub Desktop
-
Создание новой ветки:
- Откройте GitHub Desktop и убедитесь, что выбран ваш локальный репозиторий
TerraFirmaGreg-Modern. - В верхнем меню выберите
Branch → New Branch.... - В появившемся окне введите имя для вашей новой ветки (например,
feature/add-custom-questилиbugfix/fix-launch-crash). - Нажмите
Create Branch. Теперь вы находитесь в новой ветке, созданной от ветки dev.
- Откройте GitHub Desktop и убедитесь, что выбран ваш локальный репозиторий
-
Внесение и фиксация изменений:
- Внесите необходимые изменения в проект с помощью вашего любимого редактора кода (например, Visual Studio Code).
- Вернувшись в GitHub Desktop, перейдите на вкладку
Changes, где вы увидите список изменённых файлов. - Добавьте описание своих изменений, введите сообщение коммита и нажмите
Commit to <имя_ветки>.
-
Публикация ветки:
- После фиксации изменений нажмите кнопку
Push originв правом верхнем углу GitHub Desktop. - Это отправит вашу новую ветку на GitHub.
- После фиксации изменений нажмите кнопку
-
Создание Pull Request:
- После успешной отправки GitHub Desktop предложит вам кнопку Create Pull Request или ссылку View on GitHub. Нажмите её.
- В открывшемся веб-интерфейсе GitHub убедитесь, что:
- Базовая ветка для слияния установлена как
devосновного репозитория. - Заголовок и описание Pull Request содержат подробное описание вносимых изменений, а также при необходимости ссылки на связанные Issues.
- Базовая ветка для слияния установлена как
- Нажмите Create Pull Request для отправки запроса на слияние ваших изменений в ветку dev.
Способ C: Использование terminal / cmd
- Синхронизация с upstream:
- Убедитесь, что ваш локальный репозиторий актуален. Если вы уже настроили remote upstream (официальный репозиторий), выполните:
git checkout dev
git pull upstream dev- Создание новой ветки для изменений:
- Из ветки dev создайте новую feature или bugfix ветку:
git checkout -b feature/имя-фичи- Назовите ветку понятно (например, feature/add-custom-quest или bugfix/fix-crash-on-launch).
- Внесение изменений:
- Делайте изменения в коде, сопровождая их коммитами с понятными сообщениями:
git add .
git commit -m "Краткое описание внесённых изменений"- Отправка ветки на GitHub:
- Запушьте свою ветку в свой форк:
git push origin feature/имя-фичи- Создание Pull Request:
- Перейдите на страницу вашего форка на GitHub.
- Нажмите кнопку Compare & Pull Request напротив только что запушенной ветки.
- Убедитесь, что в качестве базовой ветки выбран dev основного репозитория.
- Заполните заголовок и описание Pull Request, упомяните, какие проблемы решает данный PR, и, если возможно, укажите ссылки на соответствующие Issues.
- Отправьте запрос, нажав Create Pull Request.
Tip
Если у вас возникнут вопросы по оформлению Pull Request или вы не уверены, с какой веткой проводить слияние, обратитесь к документации проекта или свяжитесь с командой через Discord.
- Рассмотрение Pull Request:
- После создания Pull Request он попадает в очередь на рассмотрение членами команды.
- Участники [Project-Lead] (для слияния в main) или [Modern-Team] (для слияния в dev) просматривают внесённые изменения, оставляют комментарии и, при необходимости, запрашивают доработки.
- Внесение корректировок:
- Если требуются изменения, автор PR вносит корректировки в свою ветку, и обновлённый коммит автоматически появляется в открытом запросе.
- Одобрение:
- После внесения всех необходимых правок и получения положительных отзывов от рецензентов PR считается одобренным.
- Для слияния изменений в main требуется минимум одно одобрение от участников команды [Project-Lead].
- Для слияния в dev – минимум два одобрения от участников команды [Modern-Team].
- Слияние Pull Request:
- После одобрения уполномоченный участник или мейнтейнер выполняет слияние PR (при помощи Squash and Merge, согласно правилам проекта).
- После успешного слияния рекомендуется удалить ветку, чтобы поддерживать чистоту репозитория.
- Пост-слияние:
- Слияние PR запускает процессы сборки и тестирования, чтобы убедиться в стабильности внесённых изменений.
- Если после слияния обнаружены проблемы, создаётся новый Pull Request для их исправления.
-
- Проект следует Семантическому версионированию.
- Patch: Исправления ошибок и небольшие изменения (
1.0.0→1.0.1) - Minor: Новые функции, которые не нарушают совместимость (
1.0.0→1.1.0) - Major: Критические изменения (
1.0.0→2.0.0)
-
- Создавайте отдельные ветки для каждой новой функциональности или исправления ошибок.
- Регулярно синхронизируйте свой форк с оригинальным репозиторием, чтобы избежать конфликтов.
- Используйте понятные сообщения коммитов для лучшего понимания изменений.
-
- Перед внесением ваших изменений убедитесь, что проект запускается без ошибок.
- Проверяйте логи PrismLauncher для выявления возможных проблем.
- Использование Visual Studio Code с расширением ProbeJs поможет быстрее обнаруживать и устранять ошибки.
-
- Если у вас возникли вопросы или проблемы, обратитесь к разделу Issues или Discussions на GitHub проекта, а также к форумам на Discord.
- Коллективное обсуждение часто приводит к нахождению оптимальных решений и улучшению проекта в целом.
-
- Всегда тестируйте интеграцию ваших изменений с основным проектом.
- Перед отправкой Pull Request важно убедиться, что ваши изменения не нарушают работу модпака и соответствуют внутренним соглашениям по коду.
-
- Если вы хотите помочь с локализацией модпака на другой язык, пожалуйста, перейдите на Crowdin.
-
Вся конфигурация инструментов разработки находится в папке
kubejs/.Установка:
# Из корня модпака npm install --prefix kubejs # Или из папки kubejs npm install
Запуск линтера:
# Из корня модпака npm run lint --prefix kubejs npm run lint:fix --prefix kubejs # Или из папки kubejs npm run lint npm run lint:fix
Форматирование кода (Prettier):
# Форматировать все файлы npm run format --prefix kubejs # Проверка форматирования без изменений npm run format:check --prefix kubejs
Проверка типов TypeScript:
- Установите зависимости (см. выше)
- Запустите ProbeJS для генерации типов
- Установите
"noCheck": falseвkubejs/tsconfig.json

