Closed drkhodakarami closed 8 months ago
Here's my logs too
```
# Teamy @ Teamy-Desktop in D:\Repos\Minecraft\Forge\MDK on git:main [13:06:46]
$ ls
Directory: D:\Repos\Minecraft\Forge\MDK
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2023-08-14 1:26 AM .gradle
d---- 2023-08-14 1:26 AM build
d---- 2023-08-14 1:25 AM gradle
d---- 2023-08-14 1:26 AM run
d---- 2023-08-14 1:26 AM src
-a--- 2023-08-14 1:25 AM 261 .gitattributes
-a--- 2023-08-14 1:25 AM 174 .gitignore
-a--- 2023-08-14 1:25 AM 10083 build.gradle
-a--- 2023-08-14 1:25 AM 3571 gradle.properties
-a--- 2023-08-14 1:25 AM 8741 gradlew
-a--- 2023-08-14 1:25 AM 2868 gradlew.bat
-a--- 2023-08-14 1:25 AM 2059 README.md
-a--- 2023-08-14 1:25 AM 287 settings.gradle
-a--- 2023-08-14 1:25 AM 1183 TEMPLATE_LICENSE.txt
# Teamy @ Teamy-Desktop in D:\Repos\Minecraft\Forge\MDK on git:main [13:06:47]
$ git pull
Already up to date.
# Teamy @ Teamy-Desktop in D:\Repos\Minecraft\Forge\MDK on git:main [13:06:51]
$ .\gradlew runData
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/8.1.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
> Configure project :
MixinGradle did not locate the diffplug APT plugin, skipping eclipse task configuration
Java: 17.0.6, JVM: 17.0.6+7-b469.82 (JetBrains s.r.o.), Arch: amd64
> Task :runData
[13:07:14.804] [main/INFO] [Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgedatauserdev, --assetIndex, 5, --assetsDir, C:\Users\TeamD\.gradle\caches\forge_gradle\assets, --gameDir, ., --fml.forgeVersion, 47.1.65, --fml.fmlVersion, 47.1.47, --fml.mcVersion, 1.20.1, --fml.mcpVersion, 20230612.114412, --mod, examplemod, --all, --output, D:\Repos\Minecraft\Forge\MDK\src\generated\resources, --existing, D:\Repos\Minecraft\Forge\MDK\src\main\resources]
[13:07:14.807] [main/INFO] [Launcher/MODLAUNCHER]: ModLauncher 10.0.10+10.0.10+main.22f00f84 starting: java version 17.0.6 by JetBrains s.r.o.; OS Windows 10 arch amd64 version 10.0
[13:07:14.911] [main/INFO] [loading.ImmediateWindowHandler/]: ImmediateWindowProvider not loading because launch target is forgedatauserdev
[13:07:14.957] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/TeamD/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8.5/9d1c0c3a304ae6697ecd477218fa61b850bf57fc/mixin-0.8.5.jar%23128!/ Service=ModLauncher Env=CLIENT
[13:07:15.219] [main/WARN] [loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\TeamD\.gradle\caches\modules-2\files-2.1\net.neoforged.fancymodloader\language-java\47.1.47\9f5f057de5fea5106fca0df2b0faea12a85bc283\language-java-47.1.47.jar is missing mods.toml file
[13:07:15.222] [main/WARN] [loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\TeamD\.gradle\caches\modules-2\files-2.1\net.neoforged.fancymodloader\language-lowcode\47.1.47\b9cb4bc84722dc99e902883f8ea5a952c0415d5c\language-lowcode-47.1.47.jar is missing mods.toml file
[13:07:15.224] [main/WARN] [loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\TeamD\.gradle\caches\modules-2\files-2.1\net.neoforged.fancymodloader\language-minecraft\47.1.47\70c137579710b203f0220b80a90eff3db19b32a2\language-minecraft-47.1.47.jar is missing mods.toml file
[13:07:15.227] [main/WARN] [loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\TeamD\.gradle\caches\modules-2\files-2.1\net.neoforged.fancymodloader\core\47.1.47\915a0dc36418f3c3bf74e56015d1cb79ef5430f0\core-47.1.47.jar is missing mods.toml file
[13:07:15.240] [main/INFO] [loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "language-java-47.1.47.jar" of type LANGPROVIDER with provider net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@610db97e
[13:07:15.240] [main/INFO] [loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "language-lowcode-47.1.47.jar" of type LANGPROVIDER with provider net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@610db97e
[13:07:15.240] [main/INFO] [loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "language-minecraft-47.1.47.jar" of type LANGPROVIDER with provider net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@610db97e
[13:07:15.240] [main/INFO] [loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "core-47.1.47.jar" of type LIBRARY with provider net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@610db97e
[13:07:15.240] [main/INFO] [loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "forge-1.20.1-47.1.65_mapped_official_1.20.1-recomp.jar" of type MOD with provider net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@610db97e
[13:07:15.241] [main/INFO] [loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "main" of type MOD with provider net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@610db97e
[13:07:15.241] [main/INFO] [loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "" of type MOD with provider net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@610db97e
[13:07:15.260] [main/INFO] [loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "events-47.1.47.jar" of type GAMELIBRARY with provider net.minecraftforge.fml.loading.moddiscovery.BuiltinGameLibraryLocator@23aae55
[13:07:15.294] [main/INFO] [loading.moddiscovery.JarInJarDependencyLocator/]: No dependencies to load found. Skipping!
[13:07:16.263] [main/INFO] [LaunchServiceHandler/MODLAUNCHER]: Launching target 'forgedatauserdev' with arguments [--gameDir, ., --assetsDir, C:\Users\TeamD\.gradle\caches\forge_gradle\assets, --assetIndex, 5, --mod, examplemod, --all, --output, D:\Repos\Minecraft\Forge\MDK\src\generated\resources, --existing, D:\Repos\Minecraft\Forge\MDK\src\main\resources]
2023-08-14 13:07:16,405 main WARN Advanced terminal features are not available in this environment
[13:07:16] [main/DEBUG] [io.ne.ut.in.lo.InternalLoggerFactory/]: Using SLF4J as the default logging framework
[13:07:16] [main/DEBUG] [io.ne.ut.ResourceLeakDetector/]: -Dio.netty.leakDetection.level: simple
[13:07:16] [main/DEBUG] [io.ne.ut.ResourceLeakDetector/]: -Dio.netty.leakDetection.targetRecords: 4
[13:07:16] [main/INFO] [ne.mi.da.lo.DatagenModLoader/]: Initializing Data Gatherer for mods [examplemod]
[13:07:16] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/entity/EntityTyp [13:07:17] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/level/block/LiquidBlock
[13:07:17] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/level/block/StairBlock
[13:07:17] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/level/block/FlowerPotBlock
[13:07:17] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/item/ItemStack
[13:07:18] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/entity/animal/frog/Tadpole
[13:07:18] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/item/BucketItem
[13:07:18] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/entity/monster/Spider
[13:07:18] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/entity/monster/Zombie
[13:07:18] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/entity/monster/ZombieVillager
[13:07:18] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/entity/monster/Evoker$EvokerSummonSpellGoal
[13:07:18] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/entity/animal/horse/SkeletonTrapGoal
[13:07:18] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/entity/monster/Strider
[13:07:19] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/entity/npc/Villager
[13:07:19] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/effect/MobEffectInstance
[13:07:19] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/level/levelgen/structure/Structure
[13:07:19] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/level/levelgen/structure/structures/OceanRuinPieces$OceanRuinPiece
[13:07:19] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/level/levelgen/structure/structures/SwampHutPiece
[13:07:19] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/level/levelgen/structure/structures/OceanMonumentPieces$OceanMonumentPiece
[13:07:19] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/level/levelgen/structure/structures/WoodlandMansionPieces$WoodlandMansionPiece
[13:07:19] [main/DEBUG] [ne.mi.co.tr.CoreModBaseTransformer/COREMOD]: Transforming net/minecraft/world/level/biome/Biom [13:07:19] [main/DEBUG] [ne.mi.re.GameData/REGISTRIES]: Creating vanilla freeze snapshot
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:block Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:fluid Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:item Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:mob_effect Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:sound_event Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:potion Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:enchantment Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:entity_type Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:block_entity_type Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:particle_type Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:menu Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:painting_variant Sync: VANILLA -> ACTIVE[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:recipe_type Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:recipe_serializer Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:attribute Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:stat_type Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:command_argument_type Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:villager_profession Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:point_of_interest_type Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:memory_module_type Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:sensor_type Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:schedule Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:activity Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:worldgen/carver Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:worldgen/feature Sync: VANILLA -> ACTIVE[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:chunk_status Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:worldgen/block_state_provider_type Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:worldgen/foliage_placer_type Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:worldgen/tree_decorator_type Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry minecraft:worldgen/biome Sync: VANILLA -> ACTIVE
[13:07:19] [main/DEBUG] [ne.mi.re.GameData/REGISTRIES]: Vanilla freeze snapshot created
[13:07:19] [main/DEBUG] [ne.mi.fm.ModWorkManager/LOADING]: Using 12 threads for parallel mod-loading
[13:07:19] [main/DEBUG] [ne.mi.fm.ja.FMLJavaModLanguageProvider/LOADING]: Loading FMLModContainer from classloader cpw.mods.modlauncher.TransformingClassLoader@5b275811 - got cpw.mods.cl.ModuleClassLoader@5328a9c1
[13:07:19] [main/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Creating FMLModContainer instance for net.minecraftforge.common.ForgeMod
[13:07:19] [main/DEBUG] [ne.mi.fm.ja.FMLJavaModLanguageProvider/LOADING]: Loading FMLModContainer from classloader cpw.mods.modlauncher.TransformingClassLoader@5b275811 - got cpw.mods.cl.ModuleClassLoader@5328a9c1
[13:07:19] [main/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Creating FMLModContainer instance for com.example.examplemod.ExampleMod
[13:07:19] [modloading-worker-0/DEBUG] [ne.mi.ve.fo.ForgeVersion/CORE]: NeoForge Version package package net.minecraftforge.versions.forge, Forge, version 47.1 from cpw.mods.modlauncher.TransformingClassLoader@5b275811
[13:07:19] [modloading-worker-0/DEBUG] [ne.mi.ve.fo.ForgeVersion/CORE]: Found NeoForge version 47.1.65
[13:07:19] [modloading-worker-0/DEBUG] [ne.mi.ve.fo.ForgeVersion/CORE]: Found NeoForge spec 47.1
[13:07:19] [modloading-worker-0/DEBUG] [ne.mi.ve.fo.ForgeVersion/CORE]: Found NeoForge group net.neoforged
[13:07:19] [modloading-worker-0/DEBUG] [ne.mi.ve.mc.MCPVersion/CORE]: MCP Version package package net.minecraftforge.versions.mcp, Minecraft, version 1.20.1 from cpw.mods.modlauncher.TransformingClassLoader@5b275811
[13:07:19] [modloading-worker-0/DEBUG] [ne.mi.ve.mc.MCPVersion/CORE]: Found MC version information 1.20.1
[13:07:19] [modloading-worker-0/DEBUG] [ne.mi.ve.mc.MCPVersion/CORE]: Found MCP version information 20230612.114412
[13:07:19] [modloading-worker-0/INFO] [ne.mi.co.ForgeMod/FORGEMOD]: NeoForge mod loading, version 47.1.65, for MC 1.20.1 with MCP 20230612.114412
[13:07:19] [modloading-worker-0/INFO] [ne.mi.co.MinecraftForge/FORGE]: NeoForge v47.1.65 Initialized
[13:07:20] [modloading-worker-0/DEBUG] [ne.mi.fm.co.ConfigTracker/CONFIG]: Config file examplemod-common.toml for examplemod tracking
[13:07:20] [modloading-worker-0/DEBUG] [ne.mi.fm.ja.AutomaticEventSubscriber/LOADING]: Attempting to inject @EventBusSubscriber classes into the eventbus for examplemod
[13:07:20] [modloading-worker-0/DEBUG] [ne.mi.fm.ja.AutomaticEventSubscriber/LOADING]: Auto-subscribing com.example.examplemod.Config to MOD
[13:07:20] [modloading-worker-0/DEBUG] [ne.mi.fm.ja.AutomaticEventSubscriber/LOADING]: Auto-subscribing com.example.examplemod.ExampleMod$ClientModEvents to MOD
[13:07:20] [modloading-worker-0/DEBUG] [io.ne.ut.in.PlatformDependent0/]: -Dio.netty.noUnsafe: false
[13:07:20] [modloading-worker-0/DEBUG] [io.ne.ut.in.PlatformDependent0/]: Java version: 17
[13:07:20] [modloading-worker-0/DEBUG] [io.ne.ut.in.PlatformDependent0/]: sun.misc.Unsafe.theUnsafe: available
[13:07:20] [modloading-worker-0/DEBUG] [io.ne.ut.in.PlatformDependent0/]: sun.misc.Unsafe.copyMemory: available
[13:07:20] [modloading-worker-0/DEBUG] [io.ne.ut.in.PlatformDependent0/]: sun.misc.Unsafe.storeFence: available
[13:07:20] [modloading-worker-0/DEBUG] [io.ne.ut.in.PlatformDependent0/]: java.nio.Buffer.address: available
[13:07:20] [modloading-worker-0/DEBUG] [io.ne.ut.in.PlatformDependent0/]: direct buffer constructor: unavailable
java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31) ~[netty-common-4.1.82.Final.jar%23151!/:4.1.82.Final] {}
at io.netty.util.internal.PlatformDependent0$5.run(PlatformDependent0.java:288) ~[netty-common-4.1.82.Final.jar%23151!/:4.1.82.Final] {}
at java.security.AccessController.doPrivileged(AccessController.java:318) ~[?:?] {}
at io.netty.util.internal.PlatformDependent0.
Running clean
task does not fix the problem.
I started a mod from the template:
https://github.com/TeamDman/extant-void/blob/f0f257576a57aa78477ffc336afba00b240256b5/build.gradle
Switched to a structure used in one of my other mods
https://github.com/TeamDman/extant-void/commit/a55518b7f9a5a429378432933e1cd5211b6202ff
and now my datagen is running properly, hitting my breakpoints.
Specifically, I used this block for runs
runs {
client {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', mod_id
// Ensure mixin dependencies play nice
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
// https://github.com/ChiefArug/ThermalSysteams/blob/main/build.gradle#L27
// https://discord.com/channels/313125603924639766/983834532904042537/1089449308048343090
jvmArgs '-XX:+AllowEnhancedClassRedefinition', '-XX:+IgnoreUnrecognizedVMOptions', '-XX:+AllowRedefinitionToAddDeleteMethods'
mods {
"${mod_id}" {
source sourceSets.main
source sourceSets.gametest
}
}
}
server {
workingDirectory project.file('runServer')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', mod_id
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
jvmArgs '-XX:+AllowEnhancedClassRedefinition', '-XX:+IgnoreUnrecognizedVMOptions', '-XX:+AllowRedefinitionToAddDeleteMethods'
mods {
"${mod_id}" {
source sourceSets.main
source sourceSets.gametest
}
}
}
// This run config launches GameTestServer and runs all registered gametests, then exits.
// By default, the server will crash when no gametests are provided.
// The gametest system is also enabled by default for other run configs under the /test command.
gameTestServer {
workingDirectory project.file('runGameTest')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', mod_id
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
jvmArgs '-XX:+AllowEnhancedClassRedefinition', '-XX:+IgnoreUnrecognizedVMOptions', '-XX:+AllowRedefinitionToAddDeleteMethods'
mods {
"${mod_id}" {
source sourceSets.main
source sourceSets.gametest
}
}
}
data {
workingDirectory project.file('runData')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
jvmArgs '-XX:+AllowEnhancedClassRedefinition', '-XX:+IgnoreUnrecognizedVMOptions', '-XX:+AllowRedefinitionToAddDeleteMethods'
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
ideaModule "${project.name}.datagen"
mods {
"${mod_id}" {
source sourceSets.main
source sourceSets.datagen
}
}
}
}
and another block to configure some sources
sourceSets {
main {
resources {
srcDirs += "src/generated/resources"
}
}
test {
compileClasspath += main.output
}
datagen {
compileClasspath += main.output
}
generated
gametest {
java {
srcDir "src/gametest/java"
}
compileClasspath += main.output
resources {
srcDirs += "src/gametest/resources"
}
}
}
configurations {
extendConfigurations(implementation, gametestImplementation, testImplementation, datagenImplementation)
extendConfigurations(compileOnly, gametestCompileOnly, testCompileOnly, datagenCompileOnly)
extendConfigurations(runtimeOnly, gametestRuntimeOnly, testRuntimeOnly, datagenRuntimeOnly)
// testImplementation.extendsFrom(minecraft)
// gametestImplementation.extendsFrom(minecraft)
// datagenImplementation.extendsFrom(minecraft)
}
static void extendConfigurations(Configuration base, Configuration... configurations) {
for (def configuration : configurations) {
configuration.extendsFrom(base)
}
}
Here's the provided MDK one for reference
runs {
// applies to all the run configs below
configureEach {
workingDirectory project.file("run/${it.name}")
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'
mods {
"${mod_id}" {
source sourceSets.main
}
}
}
client {
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', mod_id
}
server {
property 'forge.enabledGameTestNamespaces', mod_id
args '--nogui'
}
// This run config launches GameTestServer and runs all registered gametests, then exits.
// By default, the server will crash when no gametests are provided.
// The gametest system is also enabled by default for other run configs under the /test command.
gameTestServer {
property 'forge.enabledGameTestNamespaces', mod_id
}
data {
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
// workingDirectory project.file('run-data')
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
}
}
I prefer the approach I'm copying from my existing mod... because it's working lol and because it keeps the datagen and gametest sources separate from the main mod code, which I believe helps reduce jar size since it informs the build process on what sources aren't necessary in the final build
Unzipping a built jar shows that the gametest and datagen code is not included :D
### Me can you explain how the config determines what classes are loaded when running the runClient run configuration vs running the `build` task that produces a jar file? ### ChatGPT The behavior you're asking about is determined by a combination of Gradle's `sourceSets` configuration, `minecraft` plugin's `runs` configuration, and the tasks defined by these configurations. Let's break down each part: 1. **`sourceSets` Configuration**: - This is a fundamental concept in Gradle Java projects, determining how your project's sources are organized. - For instance, by default, Java projects in Gradle have two source sets: `main` and `test`. `main` typically contains the production code, and `test` contains the unit tests. - In your configuration, you've defined additional source sets like `datagen`, `gametest`, and `generated`. - The `sourceSets` configuration not only determines how sources are organized but also influences tasks like `compileJava` (which by default compiles the `main` source set). 2. **`runs` Configuration** (from the `minecraft` plugin): - This configuration is specific to Minecraft modding with Forge. It defines how different configurations of the game (e.g., client, server) should be run during development. - Each configuration inside `runs` (e.g., `client`, `server`, `data`, `gameTestServer`) defines a run configuration. - The `mods` block inside each run configuration determines which source sets should be included when that run configuration is executed. For instance, in your `client` configuration, you have `sourceSets.main` and `sourceSets.gametest` included. This means that when you run the client, it will include classes from both these source sets. 3. **Jar Building vs. Run Configurations**: - When you run the `build` task, it triggers the `jar` task. The `jar` task, by default, packages the compiled classes of the `main` source set into a jar. - However, when you run a specific configuration like `runClient`, it's not about creating a jar but about launching an instance of the game with the specified settings and included source sets. - The source sets included in a run configuration don't affect the jar creation. Just because you include `sourceSets.gametest` in the `runClient` configuration doesn't mean it'll end up in the final jar. The jar's content is primarily determined by the `jar` task and its configuration. In your setup, you've separated the datagen and gametest sources from the main mod code, which is a great practice. It keeps things modular, organized, and ensures unnecessary code doesn't end up in the final jar. As you've noticed, even though you include `sourceSets.gametest` in `runClient`, it doesn't mean it's in the final jar. The `jar` task packages only the `main` source set unless otherwise configured. To summarize, the `sourceSets` configuration determines how your project's sources are organized. The `runs` configuration determines which of these sources are loaded when you run different configurations of the game. The `jar` task determines what gets packaged into the final jar, which, by default, is the `main` source set.
I would be in favour of making the MDK provide separated source sets by default. The configs I use also have jvm args that let the Jetbrains Runtime do more advanced hot reloading of classes which might also be something that could be included.
Feeling cute, might PR some changes later for how I'd personally want the MDK to set up defaults
The error is because of the use of a formatting placeholder in src/main/resources/pack.mcmeta
: https://github.com/neoforged/MDK/blob/a98165278684f0b17ba2f9d8e804ff93aa771671/src/main/resources/pack.mcmeta#L6
That isn't valid JSON syntax, so the pack metadata reader promptly errors out. Indeed, replacing the placeholder with an actual valid JSON value (15
) silences the error.
The placeholder should be replaced by the resource processing tasks (chiefly processResources
), but somehow something's preventing that from happening properly, so the placeholder remains unreplaced in the pack.mcmeta
which Minecraft tries to read from (and fails).
It looks like it is getting replaced when saved to build/resources, is that not where the runtime is reading it from?
$ cat .\build\resources\main\pack.mcmeta
{
"pack": {
"description": {
"text": "examplemod resources"
},
"pack_format": 15
}
}
$ cat .\src\main\resources\pack.mcmeta
{
"pack": {
"description": {
"text": "${mod_id} resources"
},
"pack_format": ${pack_format_number}
}
}
Hi, it's a really easy bug to reproduce, just the mdk without any tweaks with the addition of any datagen, execute the runData task, you will get this : https://gist.github.com/drkhodakarami/c19d20fea2c94b7bd89a400453f18bbd looks like the pack.mcmeta is not getting the second variable (it gets the mod_id though). As I said, the build.gradle is not tweaked at all, the mdk classes are almost as they are with the addition of a datagen to run the task. before you ask, yes we refresh the gradle and we execute the runIntellijRuns before hand.