Basic setup for Forge-based mod development workspace. Essentially serves as ennobled version of last official setup provided by Forge itself (can be found here). Has a couple features that original setup does not:
Building Features:
Gradle wrapper 4.9 is used by default;
Custom ForgeGradle 2.3 fork is used (this one). Though ForgeGradle 3.+ does partially support 1.12.2 projects already, it does not have GradleStart wrapper, which in 1.12.2 and below is relied upon for discovering coremods on the classpath. Without it coremods and tweakers are effectively unable to load in development environment, which is a critical issue for a lot of projects;
Brought back eclipse folder with its embedded workspace shenanigans and integrated launch configurations;
Enforced UTF-8 encoding for all files;
Buildscript contains tasks for generating dev and sources artifacts for your mod, as well as ensures they will be generated alongside main jar when executing gradlew build;
All data in mcmod.info file is filled when actually building a mod. This illustrates both how to inflate text files upon building and how to use gradle.properties file for declaring custom properties used by build.gradle;
Illustration of how to add another mod to project dependencies, in a form of local file.
Ennobled Example Mod:
Creates basic logger for itself;
Provides an example of registering custom SimpleNetworkWrapper, as well as an example packet sent from server to every player upon logging in. Shows a chat message to that player upon being received, just as demonstration that packet have performed its journey successfully;
Has one method that interacts with Baubles - BaublesHelper#hasEquipped. Just to demonstrate that our example of local modfile dependency, which is Baubles modfile in this case, actually works;
Mod version in the code (ExampleMod.VERSION) is defined as token string, which is replaced by actual project version when building;
Has CommonProxy/ClientProxy thing, which also serves as an example of implementation;
Assistant
Обе версии проекта предоставляют базовую настройку рабочего пространства для разработки модов на базе Forge для Minecraft версии 1.12.2, но они сфокусированы на разных потребностях и возможностях. Вот основные различия между ними:
Целевая аудитория и зависимость:
IGuiHandler
Contains uncomplicated event handler with a couple event receivers;
Illustrates how to create a config file using Forge's Configuration;
Creates custom creative tab.
Short Setup Guide:
If you ended up here, I assume you are already familiar with how to setup basic Forge workspace, so I won't be covering it all in great detail. Only the most important steps, just in case you forgot something:
Ensure you have JDK 8 installed (not just JRE), and JAVA_HOME environment variable is set in your system, pointing to that JDK;
Download this repository contents (like this, for instance), create folder for your mod-specific workspace and unpack those contents into that folder;
Open up a command line in that folder, and execure gradlew setupDecompWorkspace. Once its done, run IDE-specific command to generate project for your IDE; either gradlew eclipse or gradlew idea;
In case you use Eclipse, don't forget that you need to open your workspace by choosing eclipse folder within your mod-specific folder as workspace location. In case you use Idea... I dunno, you know better what to do;
Use gradlew build whenever you need to build a .jar with your mod. It will end up being in build/libs directory within your mod-specific workspace folder.
Important note on repository setup: Setup on this repository contains eclipse and .settings folders, which are important for setting up an Eclipse project, but you generally shouldn't commit them when you set up a repository for actual mod. For that purpose, it is unrecommended to use this repository as actual template via GitHub; you should instead copy its contents manually, so that .gitignore takes effect and doesn't let you commit these alongside all other stuff. Alternatively, after creating a repository using this one as template you should make a commit that removes these folders. Once pushed - put them back, thanks to .gitignore they won't be recognized any longer.
2:
Forge Workspace Setup: Grimmix 1.12.2
Basic setup for Forge-based mod development workspace, but for mod that depends on Grimoire. Besides all advantages of standalone 1.12.2 setup, which you can familiarize yourself with here, this setup includes:
Building Features:
MixinGradle plugin is added to buildscript. Mostly just takes care of handling refmap generation and embedding. Check out its repository to know more;
Grimoire Shenanigans plugin is added to buildscript. Does some amount of heavy lifting for ya, like specifying proper compile-time and runtime dependencies. For more details - pay that plugin's reporitory a personal visit;
Custom refmap name specified in gradle.properties.
Extended Example Mod:
Includes simple implementation of grimmix controller;
Uses IConfigBuildingEvent to generate its mixin configurations at runtime. Alongside demonstrates how wildcards can be used when specifying mixin classes, and how @MIXIN_REFMAP@ token can be used, which is replaced with actual refmap name as specified in gradle.properties when building modfile;
Contains an example of both core- and mod-targeting mixins;
Uses @AnnotationConfig to create mod's config file.
Short Setup Guide:
Same steps as for standalone version, which you can familirize yourself with here.
Standalone (1 версия): Предназначена для разработки модов без обязательной зависимости от других крупных модов. Это "стандартная" настройка для 1.12.2, которая позволяет начать разработку собственных модификаций.
Grimmix (2 версия): Специально настроена для разработки модов, которые зависят от Grimoire. Это подход для тех, кто требует интеграции и поддержки с Grimoire API.
Особенности сборки:
Standalone:
Использует кастомный форк ForgeGradle 2.3 для совместимости с 1.12.2.
Поддерживает генерацию dev и sources артефактов.
Ориентирована на простое и эффективное управление основными аспектами сборки мода.
Grimmix:
Включает MixinGradle для управления миксинами, что важно для сложных модификаций на основе Mixin.
Включает плагин Grimoire Shenanigans для упрощения работы с зависимостями Grimoire.
Использует специальные наименования refmap и управление ими через gradle.properties.
Пример мода:
Standalone:
Содержит простые примеры использования таких элементов, как сетевые пакеты и регистрация настроек.
Предоставляет примеры взаимодействия с другими модами, такими как Baubles.
Grimmix:
Реализует контроллер grimmix и использует события конфигурации для генерации настроек миксинов в рантайме.
Показывает, как использовать более сложные миксин-классы и как работать с core и мод-ориентированными миксинами.
Документация и инструкции по установке:
Обе версии предоставляют сходные пошаговые инструкции по базовой установке, но документация для Grimmix также включает указания по работе с Mixin и Grimoire.
Таким образом, выбор между этими двумя версиями зависит от вашего проекта: если ваш мод требует интеграции с Grimoire и миксинами, стоит выбрать Grimmix; если вы хотите что-то более независимое и общее, то Standalone подойдет лучше.