Compare commits

..

56 Commits

Author SHA1 Message Date
540c7237ef build: 删减了不必要的publish代码 2026-05-03 17:07:11 +08:00
4266168aab feat: 构建输出调整,添加代码格式检查(主要要求文件编码必须是UTF-8)以及上传到Modrinth,Curseforge平台的工作流程 2026-05-03 13:10:28 +08:00
768f38fc97 feat: 可使用的构建模板
修改了脚本,使其可以推给Maven仓库
2026-05-03 13:02:19 +08:00
Jared
a4a738da53
Merge pull request #101 from MJPC83/fix-datagen
Fix DataGen for Neoforge 1.21.1
2025-08-31 17:02:23 -04:00
MJ
fa6d66835c
Fix DataGen in Neoforge 1.21.1 2025-09-01 00:07:55 +05:30
Jared
4cf41c9b61 Manually add the mixin config to forge's manifest 2024-12-01 14:30:06 -07:00
Jared
cd9f534f2f Fix AT syntax being wrong 2024-11-30 14:20:07 -07:00
Jared
3397eb125a Port to 1.21.1 2024-11-20 22:05:57 -07:00
Jared
d263e7d59d
Merge pull request #69 from MrAmericanMike/patch-1
Update README.md
2024-08-29 09:09:18 -06:00
MrAmericanMike
cd2a14ede7
Update README.md
Fixed the step number mentioned on Step 6 to be the actual step it's referring to.
2024-08-29 08:16:59 -03:00
Jared
4d367e4ab2 Re-add forge support. Close #64 2024-08-05 23:46:16 -06:00
Jared
a32c87e599 Use neoforge as a fallback maven if the parchment maven is down. 2024-06-26 02:46:48 -06:00
Jared
df580e2c11 ModDevGradle is on the Gradle Plugin Portal, Sponge is no longer needed 2024-06-26 02:46:33 -06:00
Jared
794baefc7a Access transformers are no longer in a hardcoded location 2024-06-26 02:36:00 -06:00
Jared
de70d29ca6
Merge pull request #66 from Joel-Paul/patch-1
Remove duplicate section from README.md
2024-06-25 08:06:27 -06:00
Joel Paul
b353c384d1
Remove duplicate section from README.md
Remove duplicate `Removing Platforms and Loaders` section from README.md
2024-06-25 19:28:02 +10:00
Jared
040ca2e79d Replace (Vanilla|Neo)Gradle with ModDevGradle, add ParchmentMC support
https://github.com/neoforged/ModDevGradle
ModDevGradle is a alternative to NeoGradle that in my experience is faster and provides a better development experience.
MDG also offers an easy 'vanilla' mode, so it has replaced VanillaGradle as well.
2024-06-25 01:48:34 -06:00
Jared
56b4f43b90 Port to 1.21. Close #59 2024-06-20 03:22:56 -06:00
Jared
74686cf664
Merge pull request #58 from Cadiboo/patch-1
Fix multiline mod descriptions resulting in an invalid `fabric.mod.json`
2024-06-14 12:00:34 -06:00
Cadiboo
b8be7a400f
Update neoforge.mods.toml 2024-06-15 01:32:00 +10:00
Cadiboo
21257751f6
Update gradle.properties 2024-06-15 01:28:07 +10:00
Jared
f2b74f2074 Port to 1.20.6 2024-05-20 16:51:27 -06:00
Jared
5e833efb61 Add a new capability based on the base archive name 2024-05-20 16:27:02 -06:00
Jared
fc43dd5a3c Remove unneeded jetbrains annotations 2024-05-20 14:38:48 -06:00
Jared
74b6843ef9
Merge pull request #55 from VendoAU/patch-1
Fix typo in license name
2024-05-17 14:58:49 -06:00
Vendo
4cb494647a
Fix typo in license name 2024-05-14 20:13:13 +10:00
Jared
5536dbd85d Port to 1.20.5 and temporarily(?) delete forge
Forge will be re-added when it is ported
2024-04-23 21:05:44 -06:00
Jared
ac3fddf1cc
Merge pull request #54 from jaredlll08/refactor-1.20.4
Modernize the template
2024-04-22 20:55:54 -06:00
Jared
53caea62bb Rename plugins 2024-04-21 22:31:31 -06:00
Jared
79514823e2
pre-emptively support neoforge.mods.toml 2024-04-20 01:03:10 -06:00
Jared
985f33d90c Modernize the template
- Replaced `subprojects` with buildSrc plugins
- Moved to Jetbrains Annotations over jsr305
- Removed timestamp related manifest attributes
- Re-enabled the gradle module metadata, required for NeoForge now.
- Changed the runs folder to `runs/<type>` for consistency
2024-04-19 21:30:40 -06:00
Jared
357c43e511 Remove old scopes 2024-04-19 21:10:15 -06:00
Jared
b46609313c Use exclusive content for plugin repositories 2024-04-19 19:52:25 -06:00
Jared
dacc33f439 Swap the publishing repository with something more versatile 2024-04-19 19:49:10 -06:00
Jared
77d38c6e52 Update gradle and plugins 2024-04-19 18:38:10 -06:00
Jared
4ae44fbc38
Merge pull request #52 from AzureDoom/patch-1
Update Foojay to 0.8.0
2024-03-23 16:45:33 -06:00
AzureDoom
1016738d44
Update Foojay to 0.8.0 2024-03-23 15:11:56 -04:00
Jared
0f2407562e
Merge pull request #44 from Nekretaur/1.20.4
Replace `implementation` with `compileOnly` in the `fabric` subproject for consistency with the `forge` subproject
2024-01-16 15:46:42 -07:00
Nekretaur
3d97a942ae implementation to compileOnly 2024-01-15 17:18:47 +00:00
Jared
9f0b50b3b0 Port to 1.20.4 2024-01-11 04:41:22 -07:00
Jared
10b3870853 Port to 1.20.3 2024-01-11 04:04:15 -07:00
Jared
91061d118e
Merge pull request #41 from Trikzon/patch-1
Remove outdated warning about expanding fabric.mod.json's mod_id
2023-12-21 16:01:37 -07:00
Dion Tryban
783be74125
Remove outdated warning about expanding fabric.mod.json's mod_id 2023-12-21 15:51:55 -05:00
Jared
fbd3ef7017
Merge pull request #38 from Nekretaur/patch-1
Update a few versions
2023-12-06 10:09:54 -07:00
Nekretaur
e56cee18e9
Update a few versions 2023-12-06 13:30:05 +05:30
Jared
32b88f0536
Merge pull request #37 from MerchantPug/fix/fabric-api-modid
Update Fabric Mod ID in fabric.mod.json
2023-12-02 08:59:45 -07:00
Pug
80dd136a7d
Update fabric modid in fabric.mod.json to new fabric-api modid. 2023-12-03 01:41:34 +11:00
Jared
25bcd220c5
Merge pull request #36 from MerchantPug/fix/modids
Replace examplemod with ${mod_id} in mod files.
2023-11-29 13:19:51 -07:00
Pug
2ad03775a6
Replace examplemod with ${mod_id} in mod files. 2023-11-30 01:22:50 +11:00
Jared
1791ae3dc0 Remove usages of TaskCollection.metaClass in favor of a variable 2023-11-22 07:06:28 -07:00
Jared
829e2415e6 Move plugins back to their respective build.gradle files. Close #34 2023-11-14 02:44:36 -07:00
Jared
6152c1e196 Fix access transformer location 2023-11-11 11:43:09 -07:00
Jared
5e12acdb4c
Merge pull request #33 from jaredlll08/1.20.2-doc-update
Update Documentation
2023-11-11 01:47:14 -07:00
Tyler Hancock
f7eca4f6d6
Add info on how to remove a platform. 2023-11-11 01:42:04 -07:00
Tyler Hancock
e744cc2670
Move IDEA to a H3 to match Eclipse 2023-11-11 01:33:31 -07:00
Jared
ec156b6c83 Update to 1.20.2. Add a NeoForge project 2023-11-11 01:19:46 -07:00
3202 changed files with 88053 additions and 15525 deletions

View File

@ -28,7 +28,7 @@ jobs:
- name: Run Forge data generation
run: |
echo "=== 运行 Forge 数据生成 ==="
echo "=== 运行 NeoForge 数据生成 ==="
./gradlew runData --no-daemon
continue-on-error: false
@ -63,6 +63,14 @@ jobs:
find forge/build/libs -name "*.jar" ! -name "*-sources.jar" ! -name "*-javadoc.jar" -exec cp {} release-files/ \;
fi
echo "=== 收集 neoforge 模块构建产物 ==="
if [ -d "neoforge/build/libs" ]; then
cp neoforge/build/libs/*-sources.jar release-files/ 2>/dev/null || true
cp neoforge/build/libs/*-javadoc.jar release-files/ 2>/dev/null || true
# 只复制主jar没有sources/javadoc classifier的jar
find neoforge/build/libs -name "*.jar" ! -name "*-sources.jar" ! -name "*-javadoc.jar" -exec cp {} release-files/ \;
fi
echo "=== 准备发布的文件 ==="
ls -la release-files/
@ -166,11 +174,17 @@ jobs:
FORGE_MODRINTH_DEPS=$(grep "^forge_modrinth_dependencies=" gradle.properties | cut -d'=' -f2- || echo "")
echo "forge_modrinth_dependencies=$FORGE_MODRINTH_DEPS" >> $GITHUB_OUTPUT
NEOFORGE_MODRINTH_DEPS=$(grep "^neoforge_modrinth_dependencies=" gradle.properties | cut -d'=' -f2- || echo "")
echo "neoforge_modrinth_dependencies=$NEOFORGE_MODRINTH_DEPS" >> $GITHUB_OUTPUT
FABRIC_CURSEFORGE_DEPS=$(grep "^fabric_curseforge_dependencies=" gradle.properties | cut -d'=' -f2- || echo "")
echo "fabric_curseforge_dependencies=$FABRIC_CURSEFORGE_DEPS" >> $GITHUB_OUTPUT
FORGE_CURSEFORGE_DEPS=$(grep "^forge_curseforge_dependencies=" gradle.properties | cut -d'=' -f2- || echo "")
echo "forge_curseforge_dependencies=$FORGE_CURSEFORGE_DEPS" >> $GITHUB_OUTPUT
NEOFORGE_CURSEFORGE_DEPS=$(grep "^neoforge_curseforge_dependencies=" gradle.properties | cut -d'=' -f2- || echo "")
echo "neoforge_curseforge_dependencies=$NEOFORGE_CURSEFORGE_DEPS" >> $GITHUB_OUTPUT
- name: Generate CZ-compliant changelog
id: generate_changelog
@ -433,6 +447,54 @@ jobs:
# 失败处理
fail-mode: skip
# NeoForge 发布到 Modrinth 和 CurseForge
- name: Publish NeoForge to Modrinth & CurseForge
uses: Kir-Antipov/mc-publish@v3.3
if: success() && (steps.version_info.outputs.publish_modrinth == 'true' || steps.version_info.outputs.publish_curseforge == 'true')
continue-on-error: true
with:
# 文件匹配规则 - 只匹配 forge 的文件
files: |
dist/${{ steps.version_info.outputs.mod_id }}-neoforge-${{ steps.version_info.outputs.minecraft_version }}-${{ steps.version_info.outputs.version }}.jar
dist/${{ steps.version_info.outputs.mod_id }}-neoforge-${{ steps.version_info.outputs.minecraft_version }}-${{ steps.version_info.outputs.version }}-javadoc.jar
dist/${{ steps.version_info.outputs.mod_id }}-neoforge-${{ steps.version_info.outputs.minecraft_version }}-${{ steps.version_info.outputs.version }}-sources.jar
# 版本信息
name: ${{ steps.version_info.outputs.mod_name }} ${{ steps.version_info.outputs.version }} (Forge/${{ steps.version_info.outputs.minecraft_version }})
version: "${{ steps.version_info.outputs.minecraft_version }}-neoforge-${{ steps.version_info.outputs.version }}"
# 更新日志
changelog: ${{ steps.generate_changelog.outputs.changelog }}
# 版本类型
version-type: ${{ steps.version_type.outputs.type }}
# 只指定 Forge 加载器
loaders: neoforge
# 游戏版本
game-versions: |
${{ steps.version_info.outputs.minecraft_version }}
# Java版本
java: |
${{ steps.version_info.outputs.java_versions }}
# Modrinth 配置
modrinth-id: ${{ steps.version_info.outputs.modrinth_id }}
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-featured: true
modrinth-unfeature-mode: any
modrinth-dependencies: ${{ steps.version_info.outputs.neoforge_modrinth_dependencies }}
# CurseForge 配置
curseforge-id: ${{ steps.version_info.outputs.curseforge_id }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
curseforge-dependencies: ${{ steps.version_info.outputs.neoforge_curseforge_dependencies }}
# 失败处理
fail-mode: skip
# 发布完成后列出结果
- name: Summary
if: always()
@ -447,8 +509,10 @@ jobs:
echo "- 项目ID: ${{ steps.version_info.outputs.modrinth_id }}" >> $GITHUB_STEP_SUMMARY
echo "- Fabric版本: ${{ steps.version_info.outputs.version }}-fabric" >> $GITHUB_STEP_SUMMARY
echo "- Forge版本: ${{ steps.version_info.outputs.version }}-forge" >> $GITHUB_STEP_SUMMARY
echo "- NeoForge版本: ${{ steps.version_info.outputs.version }}-neoforge" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### CurseForge" >> $GITHUB_STEP_SUMMARY
echo "- 项目ID: ${{ steps.version_info.outputs.curseforge_id }}" >> $GITHUB_STEP_SUMMARY
echo "- Fabric版本: ${{ steps.version_info.outputs.version }}-fabric" >> $GITHUB_STEP_SUMMARY
echo "- Forge版本: ${{ steps.version_info.outputs.version }}-forge" >> $GITHUB_STEP_SUMMARY
echo "- Forge版本: ${{ steps.version_info.outputs.version }}-forge" >> $GITHUB_STEP_SUMMARY
echo "- NeoForge版本: ${{ steps.version_info.outputs.version }}-neoforge" >> $GITHUB_STEP_SUMMARY

3
.gitignore vendored
View File

@ -5,7 +5,6 @@ bin
.metadata
.classpath
.project
.idea
# idea
out
@ -22,4 +21,4 @@ build
# other
eclipse
run
/.idea/
runs

View File

@ -1,3 +0,0 @@
<component name="DependencyValidationManager">
<scope name="Fabric sources" pattern="!ext[Gradle: cpw.mods:*:*]:*/&amp;&amp;!ext[Gradle: mezz.jei:*:*:*]:*/&amp;&amp;!ext[Gradle: net.jodah:typetools:*]:*/&amp;&amp;!ext[Gradle: net.minecraft:client:extra:*]:*/&amp;&amp;!ext[Gradle: net.minecraft:joined*:*]:*/&amp;&amp;!ext[Gradle: net.minecraft:mappings_official:zip:*]:*/&amp;&amp;!ext[Gradle: net.minecraftforge:*:*]:*/" />
</component>

View File

@ -1,3 +0,0 @@
<component name="DependencyValidationManager">
<scope name="Forge sources" pattern="!ext[Gradle: loom_mappings_*:*:*]:*/&amp;&amp;!ext[Gradle: net.fabricmc:*:*]:*/&amp;&amp;!ext[Gradle: net.minecraft:joined*:*]:*/&amp;&amp;!ext[Gradle: net.minecraft:mappings_official:zip:*]:*/&amp;&amp;!ext[Gradle: net.minecraft:minecraft-project-*:*]:*/" />
</component>

View File

@ -1,24 +1,32 @@
# MultiLoader Template
This project provides a Gradle project template that can compile mods for both Forge and Fabric using a common sourceset. This project does not require any third party libraries or dependencies. If you have any questions or want to discuss the project join our [Discord](https://discord.myceliummod.network).
This project provides a Gradle project template that can compile Minecraft mods for multiple modloaders using a common project for the sources. This project does not require any third party libraries or dependencies. If you have any questions or want to discuss the project, please join our [Discord](https://discord.myceliummod.network).
## Getting Started
## IntelliJ IDEA
This guide will show how to import the MultiLoader Template into IntelliJ IDEA. The setup process is roughly equivalent to setting up Forge and Fabric independently and should be very familiar to anyone who has worked with their MDKs.
### IntelliJ IDEA
This guide will show how to import the MultiLoader Template into IntelliJ IDEA. The setup process is roughly equivalent to setting up the modloaders independently and should be very familiar to anyone who has worked with their MDKs.
1. Clone or download this repository to your computer.
2. Configure the project by editing the `group`, `mod_name`, `mod_author`, and `mod_id` properties in the `gradle.properties` file. You will also need to change the `rootProject.name` property in `settings.gradle`, this should match the folder name of your project, or else IDEA may complain.
3. Open the template's root folder as a new project in IDEA. This is the folder that contains this README file and the gradlew executable.
4. If your default JVM/JDK is not Java 17 you will encounter an error when opening the project. This error is fixed by going to `File > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JVM`and changing the value to a valid Java 17 JVM. You will also need to set the Project SDK to Java 17. This can be done by going to `File > Project Structure > Project SDK`. Once both have been set open the Gradle tab in IDEA and click the refresh button to reload the project.
5. Open the Gradle tab in IDEA if it has not already been opened. Navigate to `Your Project > Common > Tasks > vanilla gradle > decompile`. Run this task to decompile Minecraft.
6. Open your Run/Debug Configurations. Under the Application category there should now be options to run Forge and Fabric projects. Select one of the client options and try to run it.
7. Assuming you were able to run the game in step 7 your workspace should now be set up.
2. Configure the project by setting the properties in the `gradle.properties` file. You will also need to change the `rootProject.name` property in `settings.gradle`, this should match the folder name of your project, or else IDEA may complain.
3. Open the template's root folder as a new project in IDEA. This is the folder that contains this README.md file and the gradlew executable.
4. If your default JVM/JDK is not Java 21 you will encounter an error when opening the project. This error is fixed by going to `File > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JVM` and changing the value to a valid Java 21 JVM. You will also need to set the Project SDK to Java 21. This can be done by going to `File > Project Structure > Project SDK`. Once both have been set open the Gradle tab in IDEA and click the refresh button to reload the project.
5. Open your Run/Debug Configurations. Under the `Application` category there should now be options to run Fabric and NeoForge projects. Select one of the client options and try to run it.
6. Assuming you were able to run the game in step 5 your workspace should now be set up.
### Eclipse
While it is possible to use this template in Eclipse it is not recommended. During the development of this template multiple critical bugs and quirks related to Eclipse were found at nearly every level of the required build tools. While we continue to work with these tools to report and resolve issues support for projects like these are not there yet. For now Eclipse is considered unsupported by this project. The development cycle for build tools is notoriously slow so there are no ETAs available.
## Development Guide
When using this template the majority of your mod is developed in the Common project. The Common project is compiled against the vanilla game and is used to hold code that is shared between the different loader-specific versions of your mod. The Common project has no knowledge or access to ModLoader specific code, apis, or concepts. Code that requires something from a specific loader must be done through the project that is specific to that loader, such as the Forge or Fabric project.
When using this template the majority of your mod should be developed in the `common` project. The `common` project is compiled against the vanilla game and is used to hold code that is shared between the different loader-specific versions of your mod. The `common` project has no knowledge or access to ModLoader specific code, apis, or concepts. Code that requires something from a specific loader must be done through the project that is specific to that loader, such as the `fabric` or `neoforge` projects.
Loader specific projects such as the Forge and Fabric project are used to load the Common project into the game. These projects also define code that is specific to that loader. Loader specific projects can access all of the code in the Common project. It is important to remember that the Common project can not access code from loader specific projects.
Loader specific projects such as the `fabric` and `neoforge` project are used to load the `common` project into the game. These projects also define code that is specific to that loader. Loader specific projects can access all the code in the `common` project. It is important to remember that the `common` project can not access code from loader specific projects.
## Removing Platforms and Loaders
While this template has support for many modloaders, new loaders may appear in the future, and existing loaders may become less relevant.
Removing loader specific projects is as easy as deleting the folder, and removing the `include("projectname")` line from the `settings.gradle` file.
For example if you wanted to remove support for `forge` you would follow the following steps:
1. Delete the subproject folder. For example, delete `MultiLoader-Template/forge`.
2. Remove the project from `settings.gradle`. For example, remove `include("forge")`.

View File

@ -1,4 +1,6 @@
plugins {
id 'fabric-loom' version '1.9-SNAPSHOT' apply(false)
id 'net.neoforged.moddev.legacyforge' version '2.0.103' apply(false)
// see https://fabricmc.net/develop/ for new versions
id 'fabric-loom' version '1.8-SNAPSHOT' apply false
// see https://projects.neoforged.net/neoforged/moddevgradle for new versions
id 'net.neoforged.moddev' version '2.0.49-beta' apply false
}

View File

@ -31,18 +31,13 @@ repositories {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org/'
},
maven { url = "https://neoforged.forgecdn.net/releases" },
maven { url = "https://neoforged.forgecdn.net/mojang-meta" }
maven {
name = "NeoForge"
url = 'https://maven.neoforged.net/releases'
}
)
filter { includeGroup('org.parchmentmc.data') }
}
maven { url = "https://libraries.minecraft.net/" }
maven {
url "https://cursemaven.com"
content { includeGroup "curse.maven" }
}
maven {
name = 'BlameJared'
url = 'https://maven.blamejared.com'
@ -53,7 +48,6 @@ repositories {
// Read more about capabilities here: https://docs.gradle.org/current/userguide/component_capabilities.html#sec:declaring-additional-capabilities-for-a-local-component
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements'].each { variant ->
configurations."$variant".outgoing {
capability("$group:${project.name}:$version")
capability("$group:${base.archivesName.get()}:$version")
capability("$group:$mod_id-${project.name}-${minecraft_version}:$version")
capability("$group:$mod_id:$version")
@ -100,24 +94,17 @@ processResources {
'mod_id' : mod_id,
'license' : license,
'description' : project.description,
"forge_version" : forge_version,
"forge_loader_version_range" : forge_loader_version_range,
'neoforge_version' : neoforge_version,
'neoforge_loader_version_range': neoforge_loader_version_range,
"forge_version": forge_version,
"forge_loader_version_range": forge_loader_version_range,
'credits' : credits,
'java_version' : java_version
]
var jsonExpandProps = expandProps.collectEntries {
key, value -> [(key): value instanceof String ? value.replace("\n", "\\\\n") : value]
}
filesMatching(['META-INF/mods.toml']) {
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', 'META-INF/neoforge.mods.toml', '*.mixins.json']) {
expand expandProps
}
filesMatching(['pack.mcmeta', 'fabric.mod.json', '*.mixins.json']) {
expand jsonExpandProps
}
inputs.properties(expandProps)
}

View File

@ -36,7 +36,7 @@ tasks.named('javadoc', Javadoc).configure {
source(configurations.commonJava)
options.encoding = 'UTF-8'
options.charSet = 'UTF-8'
options.links("https://docs.oracle.com/en/java/javase/17/docs/api/")
options.links("https://docs.oracle.com/en/java/javase/21/docs/api/")
options.memberLevel = JavadocMemberLevel.PUBLIC
options.addBooleanOption('Xdoclint:none', true)
options.addStringOption('doctitle', "${mod_id} ${minecraft_version} ${version} Javadoc")

View File

@ -1,12 +1,14 @@
plugins {
id 'multiloader-common'
id 'net.neoforged.moddev.legacyforge'
id 'net.neoforged.moddev'
}
legacyForge {
mcpVersion = minecraft_version
if (file("src/main/resources/META-INF/accesstransformer.cfg").exists()) {
accessTransformers = ["src/main/resources/META-INF/accesstransformer.cfg"]
neoForge {
neoFormVersion = neo_form_version
// Automatically enable AccessTransformers if the file exists
def at = file('src/main/resources/META-INF/accesstransformer.cfg')
if (at.exists()) {
accessTransformers.from(at.absolutePath)
}
parchment {
minecraftVersion = parchment_minecraft
@ -16,7 +18,9 @@ legacyForge {
dependencies {
compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5'
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
// fabric and neoforge both bundle mixinextras, so it is safe to use it in common
compileOnly group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.3.5'
annotationProcessor group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.3.5'
}
configurations {
@ -38,3 +42,4 @@ artifacts {
clean {
delete 'generated'
}

View File

@ -2,7 +2,6 @@ package com.example.examplemod.mixin;
import com.example.examplemod.Constants;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.TitleScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;

View File

@ -1,18 +1,16 @@
{
"required": true,
"minVersion": "0.8",
"package": "com.example.examplemod.mixin",
"refmap": "${mod_id}.refmap.json",
"compatibilityLevel": "JAVA_17",
"mixins": [
],
"client": [
"MixinMinecraft"
],
"server": [
],
"injectors": {
"defaultRequire": 1
}
"required": true,
"minVersion": "0.8",
"package": "com.example.examplemod.mixin",
"refmap": "${mod_id}.refmap.json",
"compatibilityLevel": "JAVA_18",
"mixins": [],
"client": [
"MixinMinecraft"
],
"server": [],
"injectors": {
"defaultRequire": 1
}
}

View File

@ -1,5 +1,3 @@
import net.fabricmc.loom.task.RemapJarTask
plugins {
id 'multiloader-loader'
id 'fabric-loom'
@ -12,8 +10,7 @@ dependencies {
}
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
implementation project(":common")
localRuntime 'net.covers1624:DevLogin:0.1.0.5'
}
loom {
@ -32,9 +29,9 @@ loom {
runs {
client {
client()
setConfigName("Fabric Client")
setConfigName('Fabric Client')
ideConfigGenerated(true)
runDir("run")
runDir('runs/client')
programArgs "--username", "dev"
def args = [
"-Dlib39.modid=${mod_id}".toString(),
@ -52,14 +49,11 @@ loom {
"-Dmixin.debug.export=true"
)
}
server {
server()
serverWithGui()
setConfigName("Fabric Server")
setConfigName('Fabric Server')
ideConfigGenerated(true)
runDir("run")
runDir('runs/server')
def args = [
"-Dlib39.modid=${mod_id}".toString(),
"-Dlib39.output=${generatedOutput}".toString(),
@ -71,104 +65,78 @@ loom {
vmArgs.addAll(args)
}
}
}
tasks.named('sourcesJar', Jar) {
dependsOn classes
dependsOn project(':common').tasks.named('sourcesJar') // common的source
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set('sources')
from sourceSets.main.allSource
from project(':common').sourceSets.main.allSource
}
tasks.named('sourcesJar', Jar) {
dependsOn classes
dependsOn project(':common').tasks.named('sourcesJar') // common的source
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set('sources')
from sourceSets.main.allSource
from project(':common').sourceSets.main.allSource
}
// javadoc任务
tasks.named('javadoc', Javadoc) {
source project(':common').sourceSets.main.allJava
dependsOn project(':common').tasks.named('javadoc') // common的javadoc
source sourceSets.main.allJava
classpath = configurations.compileClasspath
classpath += project(':common').sourceSets.main.compileClasspath
options.encoding = 'UTF-8'
options.charSet = 'UTF-8'
options.links("https://docs.oracle.com/en/java/javase/17/docs/api/")
options.memberLevel = JavadocMemberLevel.PUBLIC
options.addBooleanOption('Xdoclint:none', true)
options.addStringOption('doctitle', "${mod_id} ${minecraft_version} ${version} Javadoc")
}
tasks.named('javadoc', Javadoc) {
source project(':common').sourceSets.main.allJava
dependsOn project(':common').tasks.named('javadoc') // common的javadoc
source sourceSets.main.allJava
classpath = configurations.compileClasspath
classpath += project(':common').sourceSets.main.compileClasspath
options.encoding = 'UTF-8'
options.charSet = 'UTF-8'
options.links("https://docs.oracle.com/en/java/javase/21/docs/api/")
options.memberLevel = JavadocMemberLevel.PUBLIC
options.addBooleanOption('Xdoclint:none', true)
options.addStringOption('doctitle', "${mod_id} ${minecraft_version} ${version} Javadoc")
}
// javadocJar任务
tasks.named('javadocJar', Jar) {
dependsOn javadoc
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set('javadoc')
from javadoc.destinationDir
from project(':common').javadoc.destinationDir
}
tasks.named('javadocJar', Jar) {
dependsOn javadoc
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set('javadoc')
from javadoc.destinationDir
from project(':common').javadoc.destinationDir
}
// build任务包含所有需要的jar
tasks.named('build') {
dependsOn tasks.named('sourcesJar')
dependsOn tasks.named('javadocJar')
}
// remap任务以包含sources和javadoc
remapJar {
dependsOn tasks.named('sourcesJar')
dependsOn tasks.named('javadocJar')
inputFile.set(tasks.named('jar').get().archiveFile)
addNestedDependencies = false
}
remapSourcesJar {
dependsOn tasks.named('sourcesJar')
inputFile.set(tasks.named('sourcesJar').get().archiveFile)
}
// javadocJar创建remap任务
tasks.register('remapJavadocJar', RemapJarTask) {
dependsOn tasks.named('javadocJar')
inputFile.set(tasks.named('javadocJar').get().archiveFile)
archiveClassifier.set('javadoc')
addNestedDependencies = false
}
// remapped artifacts添加到发布配置
publishing {
publications {
mavenJava(MavenPublication) {
// artifactsId
artifactId = "${mod_id}-fabric-${minecraft_version}"
artifacts.clear()
// artifacts
artifact(remapJar) {
builtBy remapJar
}
artifact(remapSourcesJar) {
builtBy remapSourcesJar
classifier = 'sources'
}
artifact(remapJavadocJar) {
builtBy remapJavadocJar
classifier = 'javadoc'
}
pom {
name = mod_name
description = project.description ?: "default"
developers {
developer {
id = mod_author
name = mod_author
tasks.named('build') {
dependsOn tasks.named('sourcesJar')
dependsOn tasks.named('javadocJar')
}
publishing {
publications {
mavenJava(MavenPublication) {
// artifactsId
artifactId = "${mod_id}-fabric-${minecraft_version}"
artifacts.clear()
// artifacts
artifact(remapJar) {
builtBy remapJar
}
artifact(remapSourcesJar) {
builtBy remapSourcesJar
classifier = 'sources'
}
artifact(javadocJar) {
builtBy javadocJar
classifier = 'javadoc'
}
pom {
name = mod_name
description = project.description ?: "default"
developers {
developer {
id = mod_author
name = mod_author
}
}
}
}
}
}
}
tasks.named('generateMetadataFileForMavenJavaPublication') {
dependsOn tasks.named('remapJavadocJar')
dependsOn tasks.named('remapJar')
dependsOn tasks.named('remapSourcesJar')
}
tasks.named('generateMetadataFileForMavenJavaPublication') {
dependsOn tasks.named('remapJar')
dependsOn tasks.named('remapSourcesJar')
dependsOn tasks.named('javadocJar')
}
}

View File

@ -1,18 +1,16 @@
{
"required": true,
"minVersion": "0.8",
"package": "com.example.examplemod.mixin",
"refmap": "${mod_id}.refmap.json",
"compatibilityLevel": "JAVA_17",
"mixins": [
],
"client": [
"MixinTitleScreen"
],
"server": [
],
"injectors": {
"defaultRequire": 1
}
"required": true,
"minVersion": "0.8",
"package": "com.example.examplemod.mixin",
"refmap": "${mod_id}.refmap.json",
"compatibilityLevel": "JAVA_21",
"mixins": [],
"client": [
"MixinTitleScreen"
],
"server": [],
"injectors": {
"defaultRequire": 1
}
}

View File

@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"id": "mod_id",
"id": "${mod_id}",
"version": "${version}",
"name": "${mod_name}",
"description": "${description}",
@ -12,7 +12,7 @@
"sources": "https://github.com/FabricMC/fabric-example-mod"
},
"license": "${license}",
"icon": "assets/modid/${mod_id}.png",
"icon": "${mod_id}.png",
"environment": "*",
"entrypoints": {
"main": [
@ -24,10 +24,10 @@
"${mod_id}.fabric.mixins.json"
],
"depends": {
"fabricloader": ">=0.14",
"fabric": "*",
"fabricloader": ">=${fabric_loader_version}",
"fabric-api": "*",
"minecraft": "${minecraft_version}",
"java": ">=17"
"java": ">=${java_version}"
},
"suggests": {
"another-mod": "*"

View File

@ -1,69 +1,95 @@
plugins {
id 'multiloader-loader'
id 'net.neoforged.moddev.legacyforge'
id 'net.minecraftforge.gradle' version '[6.0.24,6.2)'
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT'
}
base {
archivesName = "${mod_name}-forge-${minecraft_version}"
}
mixin {
add(sourceSets.main, "${mod_id}.refmap.json")
config("${mod_id}.mixins.json")
config("${mod_id}.forge.mixins.json")
}
def commonResources = project(':common').file('src/main/resources/').getAbsolutePath()
def forgeResources = file('src/main/resources/').getAbsolutePath()
def forgeBuildResources = file('build/resources/main/').getAbsolutePath()
def commonBuildResources = project(':common').file('build/resources/main/').getAbsolutePath()
def generatedOutput = project(':common').file('src/generated/resources/').getAbsolutePath()
jar {
manifest {
attributes["MixinConfigs"] = "${mod_id}.mixins.json,${mod_id}.forge.mixins.json"
}
}
legacyForge {
version = "${minecraft_version}-${forge_version}"
minecraft {
def commonResources = project(':common').file('src/main/resources/').getAbsolutePath()
def forgeResources = file('src/main/resources/').getAbsolutePath()
def forgeBuildResources = file('build/resources/main/').getAbsolutePath()
def commonBuildResources = project(':common').file('build/resources/main/').getAbsolutePath()
def generatedOutput = project(':common').file('src/generated/resources/').getAbsolutePath()
validateAccessTransformers = true
mappings channel: 'official', version: minecraft_version
copyIdeResources = true //Calls processResources when in dev
reobf = false // Forge 1.20.6+ uses official mappings at runtime, so we shouldn't reobf from official to SRG
// Automatically enable forge AccessTransformers if the file exists
// This location is hardcoded in Forge and can not be changed.
// https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123
// Forge still uses SRG names during compile time, so we cannot use the common AT's
def at = project(':common').file('src/main/resources/META-INF/accesstransformer.cfg')
def generated = project(':common').file('src/generated/resources/')
if (at.exists()) {
accessTransformers = ["src/main/resources/META-INF/accesstransformer.cfg"]
}
parchment {
minecraftVersion = parchment_minecraft
mappingsVersion = parchment_version
}
runs {
client {
client()
devLogin = true
programArguments.addAll(
'--mod', project.mod_id,
workingDirectory file('runs/client')
ideaModule "${rootProject.name}.${project.name}.main"
taskName 'Client'
mods {
modClientRun {
source sourceSets.main
}
}
args '--mod', project.mod_id,
'--all',
'--existing', forgeResources,
'--existing', commonResources,
'--existing', forgeBuildResources,
'--existing', commonBuildResources
)
}
data {
data()
// 使
programArguments.addAll(
'--mod', project.mod_id,
server {
workingDirectory file('runs/server')
ideaModule "${rootProject.name}.${project.name}.main"
taskName 'Server'
mods {
modServerRun {
source sourceSets.main
}
}
args '--mod', project.mod_id,
'--all',
'--existing', forgeResources,
'--existing', commonResources,
'--existing', forgeBuildResources,
'--existing', commonBuildResources
}
data {
workingDirectory file('runs/data')
ideaModule "${rootProject.name}.${project.name}.main"
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
taskName 'Data'
mods {
modDataRun {
source sourceSets.main
}
}
args '--mod', mod_id,
'--all',
'--output', generatedOutput,
'--existing', forgeResources,
'--existing', commonResources,
'--existing', forgeBuildResources,
'--existing', commonBuildResources
)
}
server {
server()
}
}
mods {
"${mod_id}" {
sourceSet sourceSets.main
}
}
}
@ -71,15 +97,11 @@ legacyForge {
sourceSets.main.resources.srcDir project(':common').file('src/generated/resources')
dependencies {
compileOnly project(":common")
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT:processor")
}
jar {
finalizedBy('reobfJar')
manifest.attributes([
"MixinConfigs": "${mod_id}.mixins.json,${mod_id}.forge.mixins.json"
])
// Forge's hack fix
implementation('net.sf.jopt-simple:jopt-simple:5.0.4') { version { strictly '5.0.4' } }
}
// sourceJar任务
@ -123,44 +145,13 @@ tasks.named('build') {
dependsOn tasks.named('javadocJar')
}
// reobf
tasks.named('reobfJar') {
dependsOn tasks.named('sourcesJar')
dependsOn tasks.named('javadocJar')
sourceSets.each {
def dir = layout.buildDirectory.dir("sourcesSets/$it.name")
it.output.resourcesDir = dir
it.java.destinationDirectory = dir
}
//
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = "${mod_id}-forge-${minecraft_version}"
artifacts.clear()
artifact(tasks.named('reobfJar').get()) {
builtBy tasks.named('reobfJar')
}
artifact(tasks.named('sourcesJar').get()) {
builtBy tasks.named('sourcesJar')
classifier = 'sources'
}
artifact(tasks.named('javadocJar').get()) {
builtBy tasks.named('javadocJar')
classifier = 'javadoc'
}
pom {
name = mod_name
description = project.description ?: "default"
developers {
developer {
id = mod_author
name = mod_author
}
}
}
}
}
}
//
processResources {
from project(':common').sourceSets.main.resources
inputs.property "version", project.version
@ -183,4 +174,4 @@ processResources {
])
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}

View File

@ -4,16 +4,16 @@ import net.minecraftforge.fml.common.Mod;
@Mod(Constants.MOD_ID)
public class ExampleMod {
public ExampleMod() {
// This method is invoked by the Forge mod loader when it is ready
// to load your mod. You can access Forge and Common code in this
// project.
// Use Forge to bootstrap the Common mod.
Constants.LOG.info("Hello Forge world!");
CommonClass.init();
}
}

View File

@ -2,14 +2,15 @@ modLoader = "javafml" #mandatory
loaderVersion = "${forge_loader_version_range}" #mandatory This is typically bumped every Minecraft version by Forge. See https://files.minecraftforge.net/ for a list of versions.
license = "${license}" # Review your options at https://choosealicense.com/.
#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional
#clientSideOnly=true #optional
[[mods]] #mandatory
modId = "${mod_id}" #mandatory
version = "${version}" #mandatory
displayName = "${mod_name}" #mandatory
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional (see https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/)
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional (displayed in the mod UI)
logoFile = "${mod_id}.png" #optional (needs to be in the root of your mod jar (root of your 'resources' folder))
credits = "Thanks for this example mod goes to Java" #optional
logoFile = "${mod_id}.png" #optional
credits = "${credits}" #optional
authors = "${mod_author}" #optional
description = '''${description}''' #mandatory (Supports multiline text)
[[dependencies.${mod_id}]] #optional
@ -23,4 +24,4 @@ modId = "minecraft"
mandatory = true
versionRange = "${minecraft_version_range}"
ordering = "NONE"
side = "BOTH"
side = "BOTH"

View File

@ -1,17 +1,14 @@
{
"required": true,
"minVersion": "0.8",
"package": "com.example.examplemod.mixin",
"refmap": "${mod_id}.refmap.json",
"compatibilityLevel": "JAVA_17",
"mixins": [
],
"client": [
"MixinTitleScreen"
],
"server": [
],
"injectors": {
"defaultRequire": 1
}
"required": true,
"minVersion": "0.8",
"package": "com.example.examplemod.mixin",
"compatibilityLevel": "JAVA_18",
"mixins": [],
"client": [
"MixinTitleScreen"
],
"server": [],
"injectors": {
"defaultRequire": 1
}
}

View File

@ -1,48 +1,39 @@
# Important Notes:
# fabric.mod.json's modid field cannot be expanded, you must change it manually.
# Every field you add must be added to buildSrc/src/main/groovy/multiloader-common.gradle expandProps map.
# Every field you add must be added to the root build.gradle expandProps map.
# Project
version=1.0.0
group=com.example.examplemod
java_version=17
java_version=21
# Common
minecraft_version=1.20.1
minecraft_version=1.21.1
mod_name=ExampleMod
mod_author=Jared
mod_id=examplemod
license=CC0-1.0
credits=
description=The description of your mod. \nAccepts multilines.
minecraft_version_range=[1.20.1, 1.22)
minecraft_version_range=[1.21.1, 1.22)
## This is the version of minecraft that the 'common' project uses, you can find a list of all versions here
## https://projects.neoforged.net/neoforged/neoform
neo_form_version=1.21.1-20240808.144430
# The version of ParchmentMC that is used, see https://parchmentmc.org/docs/getting-started#choose-a-version for new versions
parchment_minecraft=1.20.1
parchment_version=2023.09.03
parchment_minecraft=1.21
parchment_version=2024.11.10
# Fabric
fabric_version=0.92.1+1.20.1
fabric_version=0.109.0+1.21.1
fabric_loader_version=0.16.9
# Forge
forge_version=47.2.30
forge_loader_version_range=[47,)
forge_version=52.0.28
forge_loader_version_range=[52,)
# NeoForge
neoforge_version=21.1.80
neoforge_loader_version_range=[4,)
# Gradle
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
# Release
publish_github=true
publish_modrinth=false
publish_curseforge=false
modrinth_id=
curseforge_id=
java_versions=
fabric_modrinth_dependencies=
forge_modrinth_dependencies=
fabric_curseforge_dependencies=
forge_curseforge_dependencies=

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

112
neoforge/build.gradle Normal file
View File

@ -0,0 +1,112 @@
plugins {
id 'multiloader-loader'
id 'net.neoforged.moddev'
}
def commonResources = project(':common').file('src/main/resources/').getAbsolutePath()
def neoforgeResources = file('src/main/resources/').getAbsolutePath()
def neoforgeBuildResources = file('build/resources/main/').getAbsolutePath()
def commonBuildResources = project(':common').file('build/resources/main/').getAbsolutePath()
def generatedOutput = project(':common').file('src/generated/resources/').getAbsolutePath()
neoForge {
version = neoforge_version
// Automatically enable neoforge AccessTransformers if the file exists
def at = project(':common').file('src/main/resources/META-INF/accesstransformer.cfg')
if (at.exists()) {
accessTransformers.from(at.absolutePath)
}
parchment {
minecraftVersion = parchment_minecraft
mappingsVersion = parchment_version
}
runs {
configureEach {
systemProperty('neoforge.enabledGameTestNamespaces', mod_id)
ideName = "NeoForge ${it.name.capitalize()} (${project.path})" // Unify the run config names with fabric
}
client {
client()
programArguments.addAll(
'--mod', project.mod_id,
'--all',
'--existing', neoforgeResources,
'--existing', commonResources,
'--existing', neoforgeBuildResources,
'--existing', commonBuildResources
)
}
data {
data()
// DataGen can be run by - "./gradlew :neoforge:runData" in Terminal.
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
programArguments.addAll(
'--mod', project.mod_id,
'--all',
'--output', generatedOutput,
'--existing', neoforgeResources,
'--existing', commonResources,
'--existing', neoforgeBuildResources,
'--existing', commonBuildResources
)
}
server {
server()
programArguments.addAll(
'--mod', project.mod_id,
'--all',
'--existing', neoforgeResources,
'--existing', commonResources,
'--existing', neoforgeBuildResources,
'--existing', commonBuildResources
)
}
}
mods {
"${mod_id}" {
sourceSet sourceSets.main
}
}
}
// sourceJar任务
tasks.named('sourcesJar', Jar) {
dependsOn classes
dependsOn project(':common').tasks.named('sourcesJar') // common的source
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set('sources')
from sourceSets.main.allSource
from project(':common').sourceSets.main.allSource
}
// javadoc任务
tasks.named('javadoc', Javadoc) {
source project(':common').sourceSets.main.allJava
source sourceSets.main.allJava
classpath = configurations.compileClasspath
classpath += project(':common').sourceSets.main.compileClasspath
options.encoding = 'UTF-8'
options.charSet = 'UTF-8'
options.links("https://docs.oracle.com/en/java/javase/21/docs/api/")
options.memberLevel = JavadocMemberLevel.PUBLIC
options.addBooleanOption('Xdoclint:none', true)
options.addStringOption('doctitle', "${mod_id} ${minecraft_version} ${version} Javadoc")
}
// javadocJar任务
tasks.named('javadocJar', Jar) {
dependsOn javadoc
dependsOn project(':common').tasks.named('javadoc') // common的javadoc
archiveClassifier.set('javadoc')
from javadoc.destinationDir
from project(':common').javadoc.destinationDir
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
// build任务包含所有需要的jar
tasks.named('build') {
dependsOn tasks.named('sourcesJar')
dependsOn tasks.named('javadocJar')
}
sourceSets.main.resources.srcDir project(':common').file('src/generated/resources')

View File

@ -0,0 +1,21 @@
package com.example.examplemod;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.common.Mod;
@Mod(Constants.MOD_ID)
public class ExampleMod {
public ExampleMod(IEventBus eventBus) {
// This method is invoked by the NeoForge mod loader when it is ready
// to load your mod. You can access NeoForge and Common code in this
// project.
// Use NeoForge to bootstrap the Common mod.
Constants.LOG.info("Hello NeoForge world!");
CommonClass.init();
}
}

View File

@ -0,0 +1,20 @@
package com.example.examplemod.mixin;
import com.example.examplemod.Constants;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.TitleScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(TitleScreen.class)
public class MixinTitleScreen {
@Inject(at = @At("HEAD"), method = "init()V")
private void init(CallbackInfo info) {
Constants.LOG.info("This line is printed by an example mod mixin from NeoForge!");
Constants.LOG.info("MC Version: {}", Minecraft.getInstance().getVersionType());
}
}

View File

@ -0,0 +1,26 @@
package com.example.examplemod.platform;
import com.example.examplemod.platform.services.IPlatformHelper;
import net.neoforged.fml.ModList;
import net.neoforged.fml.loading.FMLLoader;
public class NeoForgePlatformHelper implements IPlatformHelper {
@Override
public String getPlatformName() {
return "NeoForge";
}
@Override
public boolean isModLoaded(String modId) {
return ModList.get().isLoaded(modId);
}
@Override
public boolean isDevelopmentEnvironment() {
return !FMLLoader.isProduction();
}
}

View File

@ -0,0 +1,36 @@
modLoader = "javafml" #mandatory
loaderVersion = "${neoforge_loader_version_range}" #mandatory
license = "${license}" # Review your options at https://choosealicense.com/.
#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional
[[mods]] #mandatory
modId = "${mod_id}" #mandatory
version = "${version}" #mandatory
displayName = "${mod_name}" #mandatory
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional (see https://docs.neoforged.net/docs/misc/updatechecker/)
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional (displayed in the mod UI)
logoFile="${mod_id}.png" #optional
credits="${credits}" #optional
authors = "${mod_author}" #optional
description = '''${description}''' #mandatory (Supports multiline text)
[[mixins]]
config = "${mod_id}.mixins.json"
[[mixins]]
config = "${mod_id}.neoforge.mixins.json"
[[dependencies.${mod_id}]] #optional
modId = "neoforge" #mandatory
type="required" #mandatory (Can be one of "required", "optional", "incompatible" or "discouraged")
versionRange = "[${neoforge_version},)" #mandatory
ordering = "NONE" # The order that this dependency should load in relation to your mod, required to be either 'BEFORE' or 'AFTER' if the dependency is not mandatory
side = "BOTH" # Side this dependency is applied on - 'BOTH', 'CLIENT' or 'SERVER'
[[dependencies.${mod_id}]]
modId = "minecraft"
type="required" #mandatory (Can be one of "required", "optional", "incompatible" or "discouraged")
versionRange = "${minecraft_version_range}"
ordering = "NONE"
side = "BOTH"
# Features are specific properties of the game environment, that you may want to declare you require. This example declares
# that your mod requires GL version 3.2 or higher. Other features will be added. They are side aware so declaring this won't
# stop your mod loading on the server for example.
#[features.${mod_id}]
#openGLVersion="[3.2,)"

View File

@ -0,0 +1 @@
com.example.examplemod.platform.NeoForgePlatformHelper

View File

@ -0,0 +1,14 @@
{
"required": true,
"minVersion": "0.8",
"package": "com.example.examplemod.mixin",
"compatibilityLevel": "JAVA_21",
"mixins": [],
"client": [
"MixinTitleScreen"
],
"server": [],
"injectors": {
"defaultRequire": 1
}
}

472
node_modules/.package-lock.json generated vendored
View File

@ -31,14 +31,14 @@
}
},
"node_modules/@commitlint/config-validator": {
"version": "20.4.3",
"resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-20.4.3.tgz",
"integrity": "sha512-jCZpZFkcSL3ZEdL5zgUzFRdytv3xPo8iukTe9VA+QGus/BGhpp1xXSVu2B006GLLb2gYUAEGEqv64kTlpZNgmA==",
"version": "20.5.0",
"resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-20.5.0.tgz",
"integrity": "sha512-T/Uh6iJUzyx7j35GmHWdIiGRQB+ouZDk0pwAaYq4SXgB54KZhFdJ0vYmxiW6AMYICTIWuyMxDBl1jK74oFp/Gw==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"@commitlint/types": "^20.4.3",
"@commitlint/types": "^20.5.0",
"ajv": "^8.11.0"
},
"engines": {
@ -57,40 +57,117 @@
}
},
"node_modules/@commitlint/load": {
"version": "20.4.3",
"resolved": "https://registry.npmjs.org/@commitlint/load/-/load-20.4.3.tgz",
"integrity": "sha512-3cdJOUVP+VcgHa7bhJoWS+Z8mBNXB5aLWMBu7Q7uX8PSeWDzdbrBlR33J1MGGf7r1PZDp+mPPiFktk031PgdRw==",
"version": "20.5.3",
"resolved": "https://registry.npmjs.org/@commitlint/load/-/load-20.5.3.tgz",
"integrity": "sha512-1FDZWuKyu98Myb8i7Tp31jPU2rZpOwAdYRyJcy2KoGg7Xk2A+bgHN8smhMaaNSNkmE8fwt53BokywZq8Gv/5XQ==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"@commitlint/config-validator": "^20.4.3",
"@commitlint/config-validator": "^20.5.0",
"@commitlint/execute-rule": "^20.0.0",
"@commitlint/resolve-extends": "^20.4.3",
"@commitlint/types": "^20.4.3",
"@commitlint/resolve-extends": "^20.5.3",
"@commitlint/types": "^20.5.0",
"cosmiconfig": "^9.0.1",
"cosmiconfig-typescript-loader": "^6.1.0",
"es-toolkit": "^1.46.0",
"is-plain-obj": "^4.1.0",
"lodash.mergewith": "^4.6.2",
"picocolors": "^1.1.1"
},
"engines": {
"node": ">=v18"
}
},
"node_modules/@commitlint/resolve-extends": {
"version": "20.4.3",
"resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-20.4.3.tgz",
"integrity": "sha512-QucxcOy+00FhS9s4Uy0OyS5HeUV+hbC6OLqkTSIm6fwMdKva+OEavaCDuLtgd9akZZlsUo//XzSmPP3sLKBPog==",
"node_modules/@commitlint/load/node_modules/cosmiconfig": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.1.tgz",
"integrity": "sha512-hr4ihw+DBqcvrsEDioRO31Z17x71pUYoNe/4h6Z0wB72p7MU7/9gH8Q3s12NFhHPfYBBOV3qyfUxmr/Yn3shnQ==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"@commitlint/config-validator": "^20.4.3",
"@commitlint/types": "^20.4.3",
"global-directory": "^4.0.1",
"env-paths": "^2.2.1",
"import-fresh": "^3.3.0",
"js-yaml": "^4.1.0",
"parse-json": "^5.2.0"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/d-fischer"
},
"peerDependencies": {
"typescript": ">=4.9.5"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
},
"node_modules/@commitlint/load/node_modules/cosmiconfig-typescript-loader": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-6.3.0.tgz",
"integrity": "sha512-Akr82WH1Wfqatyiqpj8HDkO2o2KmJRu1FhKfSNJP3K4IdXwHfEyL7MOb62i1AGQVLtIQM+iCE9CGOtrfhR+mmA==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"jiti": "2.6.1"
},
"engines": {
"node": ">=v18"
},
"peerDependencies": {
"@types/node": "*",
"cosmiconfig": ">=9",
"typescript": ">=5"
}
},
"node_modules/@commitlint/load/node_modules/js-yaml": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"argparse": "^2.0.1"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
}
},
"node_modules/@commitlint/load/node_modules/typescript": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz",
"integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==",
"dev": true,
"license": "Apache-2.0",
"optional": true,
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/@commitlint/resolve-extends": {
"version": "20.5.3",
"resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-20.5.3.tgz",
"integrity": "sha512-+ogW9v/u9JqpvAgTrLra/YTFo0KkjU6iNblF89pPsj4NebNc+DAWctsludwezI8YnsjBmfHpApSwcXprN/f/ew==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"@commitlint/config-validator": "^20.5.0",
"@commitlint/types": "^20.5.0",
"es-toolkit": "^1.46.0",
"global-directory": "^5.0.0",
"import-meta-resolve": "^4.0.0",
"lodash.mergewith": "^4.6.2",
"resolve-from": "^5.0.0"
},
"engines": {
@ -98,9 +175,9 @@
}
},
"node_modules/@commitlint/types": {
"version": "20.4.3",
"resolved": "https://registry.npmjs.org/@commitlint/types/-/types-20.4.3.tgz",
"integrity": "sha512-51OWa1Gi6ODOasPmfJPq6js4pZoomima4XLZZCrkldaH2V5Nb3bVhNXPeT6XV0gubbainSpTw4zi68NqAeCNCg==",
"version": "20.5.0",
"resolved": "https://registry.npmjs.org/@commitlint/types/-/types-20.5.0.tgz",
"integrity": "sha512-ZJoS8oSq2CAZEpc/YI9SulLrdiIyXeHb/OGqGrkUP6Q7YV+0ouNAa7GjqRdXeQPncHQIDz/jbCTlHScvYvO/gA==",
"dev": true,
"license": "MIT",
"optional": true,
@ -127,21 +204,21 @@
}
},
"node_modules/@types/node": {
"version": "25.3.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.3.5.tgz",
"integrity": "sha512-oX8xrhvpiyRCQkG1MFchB09f+cXftgIXb3a7UUa4Y3wpmZPw5tyZGTLWhlESOLq1Rq6oDlc8npVU2/9xiCuXMA==",
"version": "25.6.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.6.0.tgz",
"integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
"undici-types": "~7.18.0"
"undici-types": "~7.19.0"
}
},
"node_modules/ajv": {
"version": "8.18.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz",
"integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==",
"version": "8.20.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
"integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
"dev": true,
"license": "MIT",
"optional": true,
@ -254,9 +331,9 @@
}
},
"node_modules/brace-expansion": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
"version": "1.1.14",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz",
"integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -381,16 +458,6 @@
"node": ">= 10"
}
},
"node_modules/clone": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
"integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.8"
}
},
"node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
@ -408,7 +475,74 @@
"dev": true,
"license": "MIT"
},
"node_modules/commitizen": {
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
"dev": true,
"license": "MIT"
},
"node_modules/conventional-commit-types": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-3.0.0.tgz",
"integrity": "sha512-SmmCYnOniSsAa9GqWOeLqc179lfr5TRu5b4QFDkbsrJ5TZjPJx85wtOr3zn+1dbeNiXDKGPbZ72IKbPhLXh/Lg==",
"dev": true,
"license": "ISC"
},
"node_modules/conventional-commits-parser": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-6.4.0.tgz",
"integrity": "sha512-tvRg7FIBNlyPzjdG8wWRlPHQJJHI7DylhtRGeU9Lq+JuoPh5BKpPRX83ZdLrvXuOSu5Eo/e7SzOQhU4Hd2Miuw==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"@simple-libs/stream-utils": "^1.2.0",
"meow": "^13.0.0"
},
"bin": {
"conventional-commits-parser": "dist/cli/index.js"
},
"engines": {
"node": ">=18"
}
},
"node_modules/conventional-commits-parser/node_modules/meow": {
"version": "13.2.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-13.2.0.tgz",
"integrity": "sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==",
"dev": true,
"license": "MIT",
"optional": true,
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/cz-conventional-changelog": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-3.3.0.tgz",
"integrity": "sha512-U466fIzU5U22eES5lTNiNbZ+d8dfcHcssH4o7QsdWaCcRs/feIPCxKYSWkYBNs5mny7MvEfwpTLWjvbm94hecw==",
"dev": true,
"license": "MIT",
"dependencies": {
"chalk": "^2.4.1",
"commitizen": "^4.0.3",
"conventional-commit-types": "^3.0.0",
"lodash.map": "^4.5.1",
"longest": "^2.0.1",
"word-wrap": "^1.0.3"
},
"engines": {
"node": ">= 10"
},
"optionalDependencies": {
"@commitlint/load": ">6.1.1"
}
},
"node_modules/cz-conventional-changelog/node_modules/commitizen": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/commitizen/-/commitizen-4.3.1.tgz",
"integrity": "sha512-gwAPAVTy/j5YcOOebcCRIijn+mSjWJC+IYKivTu6aG8Ei/scoXgfsMRnuAk6b0GRste2J4NGxVdMN3ZpfNaVaw==",
@ -439,106 +573,6 @@
"node": ">= 12"
}
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
"dev": true,
"license": "MIT"
},
"node_modules/conventional-commit-types": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-3.0.0.tgz",
"integrity": "sha512-SmmCYnOniSsAa9GqWOeLqc179lfr5TRu5b4QFDkbsrJ5TZjPJx85wtOr3zn+1dbeNiXDKGPbZ72IKbPhLXh/Lg==",
"dev": true,
"license": "ISC"
},
"node_modules/conventional-commits-parser": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-6.3.0.tgz",
"integrity": "sha512-RfOq/Cqy9xV9bOA8N+ZH6DlrDR+5S3Mi0B5kACEjESpE+AviIpAptx9a9cFpWCCvgRtWT+0BbUw+e1BZfts9jg==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"@simple-libs/stream-utils": "^1.2.0",
"meow": "^13.0.0"
},
"bin": {
"conventional-commits-parser": "dist/cli/index.js"
},
"engines": {
"node": ">=18"
}
},
"node_modules/cosmiconfig": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.1.tgz",
"integrity": "sha512-hr4ihw+DBqcvrsEDioRO31Z17x71pUYoNe/4h6Z0wB72p7MU7/9gH8Q3s12NFhHPfYBBOV3qyfUxmr/Yn3shnQ==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"env-paths": "^2.2.1",
"import-fresh": "^3.3.0",
"js-yaml": "^4.1.0",
"parse-json": "^5.2.0"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/d-fischer"
},
"peerDependencies": {
"typescript": ">=4.9.5"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
},
"node_modules/cosmiconfig-typescript-loader": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-6.2.0.tgz",
"integrity": "sha512-GEN39v7TgdxgIoNcdkRE3uiAzQt3UXLyHbRHD6YoL048XAeOomyxaP+Hh/+2C6C2wYjxJ2onhJcsQp+L4YEkVQ==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"jiti": "^2.6.1"
},
"engines": {
"node": ">=v18"
},
"peerDependencies": {
"@types/node": "*",
"cosmiconfig": ">=9",
"typescript": ">=5"
}
},
"node_modules/cz-conventional-changelog": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-3.3.0.tgz",
"integrity": "sha512-U466fIzU5U22eES5lTNiNbZ+d8dfcHcssH4o7QsdWaCcRs/feIPCxKYSWkYBNs5mny7MvEfwpTLWjvbm94hecw==",
"dev": true,
"license": "MIT",
"dependencies": {
"chalk": "^2.4.1",
"commitizen": "^4.0.3",
"conventional-commit-types": "^3.0.0",
"lodash.map": "^4.5.1",
"longest": "^2.0.1",
"word-wrap": "^1.0.3"
},
"engines": {
"node": ">= 10"
},
"optionalDependencies": {
"@commitlint/load": ">6.1.1"
}
},
"node_modules/dedent": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz",
@ -559,6 +593,16 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/defaults/node_modules/clone": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
"integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.8"
}
},
"node_modules/detect-file": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz",
@ -608,6 +652,18 @@
"is-arrayish": "^0.2.1"
}
},
"node_modules/es-toolkit": {
"version": "1.46.1",
"resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.46.1.tgz",
"integrity": "sha512-5eNtXOs3tbfxXOj04tjjseeWkRWaoCjdEI+96DgwzZoe6c9juL49pXlzAFTI72aWC9Y8p7168g6XIKjh7k6pyQ==",
"dev": true,
"license": "MIT",
"optional": true,
"workspaces": [
"docs",
"benchmarks"
]
},
"node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
@ -781,17 +837,17 @@
}
},
"node_modules/global-directory": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz",
"integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/global-directory/-/global-directory-5.0.0.tgz",
"integrity": "sha512-1pgFdhK3J2LeM+dVf2Pd424yHx2ou338lC0ErNP2hPx4j8eW1Sp0XqSjNxtk6Tc4Kr5wlWtSvz8cn2yb7/SG/w==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"ini": "4.1.1"
"ini": "6.0.0"
},
"engines": {
"node": ">=18"
"node": ">=20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@ -836,6 +892,19 @@
"dev": true,
"license": "ISC"
},
"node_modules/global-prefix/node_modules/which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dev": true,
"license": "ISC",
"dependencies": {
"isexe": "^2.0.0"
},
"bin": {
"which": "bin/which"
}
},
"node_modules/graceful-fs": {
"version": "4.2.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
@ -961,14 +1030,14 @@
"license": "ISC"
},
"node_modules/ini": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz",
"integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==",
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/ini/-/ini-6.0.0.tgz",
"integrity": "sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ==",
"dev": true,
"license": "ISC",
"optional": true,
"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/inquirer": {
@ -1205,20 +1274,6 @@
"license": "MIT",
"optional": true
},
"node_modules/js-yaml": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"argparse": "^2.0.1"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
}
},
"node_modules/json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
@ -1236,9 +1291,9 @@
"optional": true
},
"node_modules/jsonfile": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz",
"integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz",
"integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -1248,14 +1303,6 @@
"graceful-fs": "^4.1.6"
}
},
"node_modules/lines-and-columns": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
"dev": true,
"license": "MIT",
"optional": true
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
@ -1270,14 +1317,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/lodash.mergewith": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz",
"integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==",
"dev": true,
"license": "MIT",
"optional": true
},
"node_modules/log-symbols": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",
@ -1381,20 +1420,6 @@
"node": ">=0.10.0"
}
},
"node_modules/meow": {
"version": "13.2.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-13.2.0.tgz",
"integrity": "sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==",
"dev": true,
"license": "MIT",
"optional": true,
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/merge": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/merge/-/merge-2.1.1.tgz",
@ -1626,6 +1651,14 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/parse-json/node_modules/lines-and-columns": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
"dev": true,
"license": "MIT",
"optional": true
},
"node_modules/parse-passwd": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz",
@ -1655,9 +1688,9 @@
"optional": true
},
"node_modules/picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
"dev": true,
"license": "MIT",
"engines": {
@ -1914,26 +1947,10 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0",
"optional": true,
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/undici-types": {
"version": "7.18.2",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",
"integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==",
"version": "7.19.2",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz",
"integrity": "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==",
"dev": true,
"license": "MIT",
"optional": true,
@ -1966,19 +1983,6 @@
"defaults": "^1.0.3"
}
},
"node_modules/which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dev": true,
"license": "ISC",
"dependencies": {
"isexe": "^2.0.0"
},
"bin": {
"which": "bin/which"
}
},
"node_modules/word-wrap": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",

View File

@ -1,7 +1,7 @@
{
"name": "@commitlint/config-validator",
"type": "module",
"version": "20.4.3",
"version": "20.5.0",
"description": "config validator for commitlint.config.js",
"main": "lib/validate.js",
"types": "lib/validate.d.ts",
@ -39,8 +39,8 @@
"@commitlint/utils": "^20.0.0"
},
"dependencies": {
"@commitlint/types": "^20.4.3",
"@commitlint/types": "^20.5.0",
"ajv": "^8.11.0"
},
"gitHead": "a7469817974796a6e89f55911bb66b7bffa44099"
"gitHead": "a7918e9cf70f822505cb4422c03150a86f802627"
}

View File

@ -1 +1 @@
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAIA,OAAuB,EACtB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EAEnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,WAAW,EAEX,eAAe,EAEf,UAAU,EACV,MAAM,mBAAmB,CAAC;AAmB3B,wBAA8B,IAAI,CACjC,IAAI,GAAE,UAAe,EACrB,OAAO,GAAE,WAAgB,GACvB,OAAO,CAAC,eAAe,CAAC,CAkG1B;AAED,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC"}
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAIA,OAAuB,EACtB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EAEnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,WAAW,EAEX,eAAe,EAEf,UAAU,EACV,MAAM,mBAAmB,CAAC;AAmB3B,wBAA8B,IAAI,CACjC,IAAI,GAAE,UAAe,EACrB,OAAO,GAAE,WAAgB,GACvB,OAAO,CAAC,eAAe,CAAC,CAsG1B;AAED,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC"}

View File

@ -3,7 +3,7 @@ import { validateConfig } from "@commitlint/config-validator";
import executeRule from "@commitlint/execute-rule";
import resolveExtends, { resolveFrom, resolveFromSilent, resolveGlobalSilent, loadParserPreset, } from "@commitlint/resolve-extends";
import isPlainObject from "is-plain-obj";
import mergeWith from "lodash.mergewith";
import { merge } from "es-toolkit/compat";
import { loadConfig } from "./utils/load-config.js";
import { loadParserOpts } from "./utils/load-parser-opts.js";
import loadPlugin from "./utils/load-plugin.js";
@ -25,11 +25,14 @@ export default async function load(seed = {}, options = {}) {
const configFilePath = loaded?.filepath;
let config = {};
if (loaded) {
validateConfig(loaded.filepath || "", loaded.config);
config = loaded.config;
const resolvedConfig = typeof loaded.config === "function"
? await loaded.config()
: await loaded.config;
validateConfig(loaded.filepath || "", resolvedConfig);
config = resolvedConfig;
}
// Merge passed config with file based options
config = mergeWith({
config = merge({
extends: [],
plugins: [],
rules: {},

View File

@ -1 +1 @@
{"version":3,"file":"load.js","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,cAAc,EAAE,EACtB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,GAChB,MAAM,6BAA6B,CAAC;AAQrC,OAAO,aAAa,MAAM,cAAc,CAAC;AACzC,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD;;GAEG;AACH,MAAM,gBAAgB,GAAG,CAAC,SAAiB,EAAE,MAAe,EAAU,EAAE;IACvE,IAAI,CAAC;QACJ,OAAO,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,CACjC,OAAmB,EAAE,EACrB,UAAuB,EAAE;IAEzB,MAAM,GAAG,GAAG,OAAO,OAAO,CAAC,GAAG,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC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S,EAAE,gBAAgB,CAAC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;QAC/D,kCAAkC;QAClC,YAAY,EAAE,MAAM,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;QACzD,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,cAAc,EAAE,QAAQ,CAAC,cAAc;QACvC,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,OAAO;QAChB,MAAM;KACN,CAAC;AACH,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC"}

View File

@ -1 +1 @@
{"version":3,"file":"load-parser-opts.d.ts","sourceRoot":"","sources":["../../src/utils/load-parser-opts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAgBvC,wBAAsB,cAAc,CACnC,aAAa,EACV,MAAM,GACN,SAAS,CAAC,YAAY,CAAC,GACvB,CAAC,MAAM,SAAS,CAAC,YAAY,CAAC,CAAC,GAC/B,SAAS,GACV,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CA0DnC"}
{"version":3,"file":"load-parser-opts.d.ts","sourceRoot":"","sources":["../../src/utils/load-parser-opts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAgBvC,wBAAsB,cAAc,CACnC,aAAa,EACV,MAAM,GACN,SAAS,CAAC,YAAY,CAAC,GACvB,CAAC,MAAM,SAAS,CAAC,YAAY,CAAC,CAAC,GAC/B,SAAS,GACV,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAiEnC"}

View File

@ -23,7 +23,11 @@ export async function loadParserOpts(pendingParser) {
parser.parserOpts = await parser.parserOpts;
if (isObjectLike(parser.parserOpts) &&
isObjectLike(parser.parserOpts.parserOpts)) {
parser.parserOpts = parser.parserOpts.parserOpts;
// Preserve any user-provided properties (e.g. issuePrefixes) that
// were merged at the outer parserOpts level during config resolution,
// while unwrapping the inner module-provided parserOpts (#4640).
const { parserOpts: inner, ...rest } = parser.parserOpts;
parser.parserOpts = { ...inner, ...rest };
}
return parser;
}

View File

@ -1 +1 @@
{"version":3,"file":"load-parser-opts.js","sourceRoot":"","sources":["../../src/utils/load-parser-opts.ts"],"names":[],"mappings":"AAIA,SAAS,YAAY,CAAC,GAAY;IACjC,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,2BAA2B;AAC5E,CAAC;AAED,SAAS,oBAAoB,CAC5B,GAAM;IAMN,OAAO,OAAO,GAAG,CAAC,UAAU,KAAK,UAAU,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CACnC,aAIY;IAEZ,IAAI,OAAO,aAAa,KAAK,UAAU,EAAE,CAAC;QACzC,OAAO,cAAc,CAAC,aAAa,EAAE,CAAC,CAAC;IACxC,CAAC;IAED,IAAI,CAAC,aAAa,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;QACzD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,4CAA4C;IAC5C,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC;IAEnC,iCAAiC;IACjC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACxB,OAAO,MAAM,CAAC;IACf,CAAC;IAED,mFAAmF;IACnF,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;QAC3C,kCAAkC;QAClC,MAAM,CAAC,UAAU,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC;QAC5C,IACC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC;YAC/B,YAAY,CAAC,MAA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AU,CAAC,CAAC,CAAQ,EAAE,IAAI,EAAE,EAAE;gBACnD,OAAO,CAAC;oBACP,GAAG,MAAM;oBACT,UAAU,EAAE,IAAI,EAAE,UAAU;iBAC5B,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,2EAA2E;YAC3E,0GAA0G;YAC1G,IAAI,MAAM,EAAE,CAAC;gBACZ,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;oBACrC,OAAO,CAAC;wBACP,GAAG,MAAM;wBACT,UAAU,EAAE,IAAI,EAAE,UAAU,IAAI,IAAI,EAAE,MAAM;qBAC5C,CAAC,CAAC;gBACJ,CAAC,CAAC,CAAC;YACJ,CAAC;YACD,OAAO;QACR,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"}

View File

@ -1,6 +1,6 @@
{
"name": "cosmiconfig-typescript-loader",
"version": "6.2.0",
"version": "6.3.0",
"description": "TypeScript loader for cosmiconfig",
"author": "Alex Miller <codex.nz@gmail.com>",
"license": "MIT",
@ -52,27 +52,27 @@
"typescript": ">=5"
},
"dependencies": {
"jiti": "^2.6.1"
"jiti": "2.6.1"
},
"devDependencies": {
"@eslint/js": "^9.37.0",
"@swc/core": "^1.13.5",
"@swc/jest": "^0.2.39",
"@types/jest": "^30.0.0",
"@typescript-eslint/eslint-plugin": "^8.46.0",
"auto-changelog": "^2.5.0",
"chalk": "^5.6.2",
"cosmiconfig": "^9.0.0",
"esbuild": "^0.25.10",
"eslint": "^9.37.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import-x": "^4.16.1",
"jest": "^30.2.0",
"prettier": "^3.6.2",
"release-it": "^19.0.5",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.0"
"@eslint/js": "10.0.1",
"@swc/core": "1.15.24",
"@swc/jest": "0.2.39",
"@types/jest": "30.0.0",
"@typescript-eslint/eslint-plugin": "8.58.0",
"auto-changelog": "2.5.0",
"chalk": "5.6.2",
"cosmiconfig": "9.0.1",
"esbuild": "0.28.0",
"eslint": "10.2.0",
"eslint-config-prettier": "10.1.8",
"eslint-import-resolver-typescript": "4.4.4",
"eslint-plugin-import-x": "4.16.2",
"jest": "30.3.0",
"prettier": "3.8.1",
"release-it": "20.0.0-1",
"typescript": "5.9.3",
"typescript-eslint": "8.58.0"
},
"keywords": [
"cosmiconfig",

Some files were not shown because too many files have changed in this diff Show More