Jump to content

Recommended Posts

Posted

If I try to run Minecraft client from the dev environment, after generating the runs with gradlew genVSCodeRuns, I keep getting the following error:

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: begin 0, end -4, length 0

However the mod runs without problems if I put the jar in a modpack.

My repo can be found here, I'm linking the whole repo because I don't know precisely what can be helpful to know for this error.

I will also put below the debug log.

[22ago2022 13:05:39.824] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgeclientuserdev, --version, MOD_DEV, --assetIndex, 1.18, --assetsDir, C:\Users\ricca\.gradle\caches\forge_gradle\assets, --gameDir, ., --fml.forgeVersion, 40.1.0, --fml.mcVersion, 1.18.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220404.173914, --mixin.config, soulfired.mixins.json]
[22ago2022 13:05:39.829] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 9.1.3+9.1.3+main.9b69c82a starting: java version 17.0.3 by Eclipse Adoptium
[22ago2022 13:05:39.850] [main/DEBUG] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Found launch services [fmlclientdev,forgeclient,minecraft,forgegametestserverdev,fmlserveruserdev,fmlclient,fmldatauserdev,forgeserverdev,forgeserveruserdev,forgeclientdev,forgeclientuserdev,forgeserver,forgedatadev,fmlserver,fmlclientuserdev,fmlserverdev,forgedatauserdev,testharness,forgegametestserveruserdev]
[22ago2022 13:05:39.867] [main/DEBUG] [cpw.mods.modlauncher.NameMappingServiceHandler/MODLAUNCHER]: Found naming services : [srgtomcp]
[22ago2022 13:05:39.877] [main/DEBUG] [cpw.mods.modlauncher.LaunchPluginHandler/MODLAUNCHER]: Found launch plugins: [mixin,eventbus,slf4jfixer,object_holder_definalize,runtime_enum_extender,capability_token_subclass,accesstransformer,runtimedistcleaner]
[22ago2022 13:05:39.886] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Discovering transformation services
[22ago2022 13:05:39.893] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Found additional transformation services from discovery services: java.util.stream.ReferencePipeline$3@591e58fa
[22ago2022 13:05:39.906] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Found transformer services : [mixin,fml]
[22ago2022 13:05:39.906] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Transformation services loading
[22ago2022 13:05:39.907] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Loading service mixin
[22ago2022 13:05:39.908] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Loaded service mixin
[22ago2022 13:05:39.909] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Loading service fml
[22ago2022 13:05:39.912] [main/DEBUG] [net.minecraftforge.fml.loading.LauncherVersion/CORE]: Found FMLLauncher version 1.0
[22ago2022 13:05:39.912] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: FML 1.0 loading
[22ago2022 13:05:39.913] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: FML found ModLauncher version : 9.1.3+9.1.3+main.9b69c82a
[22ago2022 13:05:39.914] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: FML found AccessTransformer version : 8.0.4+66+master.c09db6d7
[22ago2022 13:05:39.915] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: FML found EventBus version : 5.0.7+5.0.7+master.6d3407cc
[22ago2022 13:05:39.915] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: Found Runtime Dist Cleaner
[22ago2022 13:05:39.917] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: FML found CoreMod version : 5.0.2+5.0.2+master.303343f8
[22ago2022 13:05:39.918] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: Found ForgeSPI package implementation version 4.0.15-4.x+4.0.15-4.x+4.x.038e91c0
[22ago2022 13:05:39.919] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: Found ForgeSPI package specification 4
[22ago2022 13:05:39.921] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Loaded service fml
[22ago2022 13:05:39.923] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Configuring option handling for services
[22ago2022 13:05:39.929] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Transformation services initializing
[22ago2022 13:05:39.930] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Initializing transformation service mixin
[22ago2022 13:05:39.953] [main/DEBUG] [mixin/]: MixinService [ModLauncher] was successfully booted in cpw.mods.cl.ModuleClassLoader@7e07db1f
[22ago2022 13:05:39.970] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/ricca/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8.5/9d1c0c3a304ae6697ecd477218fa61b850bf57fc/mixin-0.8.5.jar%2322!/ Service=ModLauncher Env=CLIENT
[22ago2022 13:05:39.975] [main/DEBUG] [mixin/]: Initialising Mixin Platform Manager
[22ago2022 13:05:39.976] [main/DEBUG] [mixin/]: Adding mixin platform agents for container ModLauncher Root Container(ModLauncher:4f56a0a2)
[22ago2022 13:05:39.977] [main/DEBUG] [mixin/]: Instancing new MixinPlatformAgentMinecraftForge for ModLauncher Root Container(ModLauncher:4f56a0a2)
[22ago2022 13:05:39.978] [main/DEBUG] [mixin/]: MixinPlatformAgentMinecraftForge rejected container ModLauncher Root Container(ModLauncher:4f56a0a2)
[22ago2022 13:05:39.979] [main/DEBUG] [mixin/]: Instancing new MixinPlatformAgentDefault for ModLauncher Root Container(ModLauncher:4f56a0a2)
[22ago2022 13:05:39.979] [main/DEBUG] [mixin/]: MixinPlatformAgentDefault accepted container ModLauncher Root Container(ModLauncher:4f56a0a2)
[22ago2022 13:05:39.981] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Initialized transformation service mixin
[22ago2022 13:05:39.981] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Initializing transformation service fml
[22ago2022 13:05:39.982] [main/DEBUG] [net.minecraftforge.fml.loading.FMLServiceProvider/CORE]: Setting up basic FML game directories
[22ago2022 13:05:39.983] [main/DEBUG] [net.minecraftforge.fml.loading.FileUtils/CORE]: Found existing GAMEDIR directory : C:\Users\ricca\Desktop\mods\1.18\.2\soul-fire-d\forge\run
[22ago2022 13:05:39.984] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path GAMEDIR is C:\Users\ricca\Desktop\mods\1.18\.2\soul-fire-d\forge\run
[22ago2022 13:05:39.984] [main/DEBUG] [net.minecraftforge.fml.loading.FileUtils/CORE]: Found existing MODSDIR directory : C:\Users\ricca\Desktop\mods\1.18\.2\soul-fire-d\forge\run\mods
[22ago2022 13:05:39.984] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path MODSDIR is C:\Users\ricca\Desktop\mods\1.18\.2\soul-fire-d\forge\run\mods
[22ago2022 13:05:39.985] [main/DEBUG] [net.minecraftforge.fml.loading.FileUtils/CORE]: Found existing CONFIGDIR directory : C:\Users\ricca\Desktop\mods\1.18\.2\soul-fire-d\forge\run\config
[22ago2022 13:05:39.985] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path CONFIGDIR is C:\Users\ricca\Desktop\mods\1.18\.2\soul-fire-d\forge\run\config
[22ago2022 13:05:39.985] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path FMLCONFIG is C:\Users\ricca\Desktop\mods\1.18\.2\soul-fire-d\forge\run\config\fml.toml
[22ago2022 13:05:39.985] [main/DEBUG] [net.minecraftforge.fml.loading.FMLServiceProvider/CORE]: Loading configuration
[22ago2022 13:05:40.027] [main/DEBUG] [net.minecraftforge.fml.loading.FileUtils/CORE]: Found existing default config directory directory : C:\Users\ricca\Desktop\mods\1.18\.2\soul-fire-d\forge\run\defaultconfigs
[22ago2022 13:05:40.028] [main/DEBUG] [net.minecraftforge.fml.loading.FMLServiceProvider/CORE]: Preparing ModFile
[22ago2022 13:05:40.031] [main/DEBUG] [net.minecraftforge.fml.loading.FMLServiceProvider/CORE]: Preparing launch handler
[22ago2022 13:05:40.032] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: Using forgeclientuserdev as launch service
[22ago2022 13:05:40.052] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: Received command line version data  : VersionInfo[forgeVersion=40.1.0, mcVersion=1.18.2, mcpVersion=20220404.173914, forgeGroup=net.minecraftforge]
[22ago2022 13:05:40.054] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Initialized transformation service fml
[22ago2022 13:05:40.055] [main/DEBUG] [cpw.mods.modlauncher.NameMappingServiceHandler/MODLAUNCHER]: Current naming domain is 'mcp'
[22ago2022 13:05:40.057] [main/DEBUG] [cpw.mods.modlauncher.NameMappingServiceHandler/MODLAUNCHER]: Identified name mapping providers {srg=srgtomcp:1234}
[22ago2022 13:05:40.057] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Transformation services begin scanning
[22ago2022 13:05:40.059] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Beginning scan trigger - transformation service mixin
[22ago2022 13:05:40.059] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: End scan trigger - transformation service mixin
[22ago2022 13:05:40.060] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Beginning scan trigger - transformation service fml
[22ago2022 13:05:40.060] [main/DEBUG] [net.minecraftforge.fml.loading.FMLServiceProvider/CORE]: Initiating mod scan
[22ago2022 13:05:40.068] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModListHandler/CORE]: Found mod coordinates from lists: []
[22ago2022 13:05:40.070] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/CORE]: Found Mod Locators : (mods folder:null),(maven libs:null),(exploded directory:null),(minecraft:null),(userdev classpath:null)
[22ago2022 13:05:40.076] [main/DEBUG] [net.minecraftforge.fml.loading.targets.CommonLaunchHandler/CORE]: Got mod coordinates  from env
[22ago2022 13:05:40.078] [main/DEBUG] [net.minecraftforge.fml.loading.targets.CommonLaunchHandler/CORE]: Found supplied mod coordinates [{defaultmodid=[]}]

 

Posted
14 minutes ago, Luis_ST said:

There is no such error in the log you post, please post the log where you get this error.

I swear that is the log I got, I don't know why the error only appears in console and is not present in the debug log.

Anyway, I will put below also the stacktrace I copied from the console:

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: begin 0, end -4, length 0
        at java.base/java.lang.String.checkBoundsBeginEnd(Unknown Source)
        at java.base/java.lang.String.substring(Unknown Source)
        at cpw.mods.securejarhandler@1.0.3/cpw.mods.jarhandling.JarMetadata.fromFileName(JarMetadata.java:79)
        at cpw.mods.securejarhandler@1.0.3/cpw.mods.jarhandling.JarMetadata.from(JarMetadata.java:44)
        at MC-BOOTSTRAP/fmlloader@1.18.2-40.1.0/net.minecraftforge.fml.loading.moddiscovery.AbstractModLocator.lambda$createMod$0(AbstractModLocator.java:36)
        at cpw.mods.securejarhandler@1.0.3/cpw.mods.jarhandling.impl.Jar.<init>(Jar.java:134)
        at cpw.mods.securejarhandler@1.0.3/cpw.mods.jarhandling.SecureJar.from(SecureJar.java:58)
        at MC-BOOTSTRAP/fmlloader@1.18.2-40.1.0/net.minecraftforge.fml.loading.moddiscovery.AbstractModLocator.createMod(AbstractModLocator.java:34)
        at MC-BOOTSTRAP/fmlloader@1.18.2-40.1.0/net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator.lambda$scanMods$6(MinecraftLocator.java:39)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.toArray(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.toArray(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.toList(Unknown Source)
        at MC-BOOTSTRAP/fmlloader@1.18.2-40.1.0/net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator.scanMods(MinecraftLocator.java:41)
        at MC-BOOTSTRAP/fmlloader@1.18.2-40.1.0/net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer.discoverMods(ModDiscoverer.java:50)
        at MC-BOOTSTRAP/fmlloader@1.18.2-40.1.0/net.minecraftforge.fml.loading.FMLLoader.beginModScan(FMLLoader.java:166)
        at MC-BOOTSTRAP/fmlloader@1.18.2-40.1.0/net.minecraftforge.fml.loading.FMLServiceProvider.beginScanning(FMLServiceProvider.java:86)
        at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.TransformationServiceDecorator.runScan(TransformationServiceDecorator.java:112)
        at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.TransformationServicesHandler.lambda$runScanningTransformationServices$8(TransformationServicesHandler.java:100) 
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.toArray(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.toArray(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.toList(Unknown Source)
        at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.TransformationServicesHandler.runScanningTransformationServices(TransformationServicesHandler.java:102)
        at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:55)
        at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.Launcher.run(Launcher.java:87)
        at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.Launcher.main(Launcher.java:77)
        at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26)
        at MC-BOOTSTRAP/cpw.mods.modlauncher@9.1.3/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23)
        at cpw.mods.bootstraplauncher@1.0.0/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149)

 

Posted (edited)

I know what the problem is, but I don't know enough about ForgeGradle or vscode to tell you why it is happening.

 

Your launcher.json is getting generated with an empty MOD_CLASSES

      "env": {
        "MOD_CLASSES": "",
        "MCP_MAPPINGS": "official_1.18.2"
      }

When I generate the eclipse runs, I get the same problem

  <mapAttribute key="org.eclipse.debug.core.environmentVariables">
    <mapEntry key="MOD_CLASSES" value=""/>
    <mapEntry key="MCP_MAPPINGS" value="official_1.18.2"/>
  </mapAttribute>

However, the intellij runs work

    <envs>
      <env name="MOD_CLASSES" value="soulfired%%$PROJECT_DIR$\build\resources\main;soulfired%%$PROJECT_DIR$\build\classes\java\main"/>
      <env name="MCP_MAPPINGS" value="official_1.18.2"/>
    </envs>

 

I would suggest you report this a bug here: https://github.com/MinecraftForge/ForgeGradle/issues

 

When I fix that field manually to use the comparable setup as intellij, it works fine

"MOD_CLASSES": "${workspaceFolder}\\build\\resources\\main;${workspaceFolder}\\build\\classes\\java\\main",
        

 

Edited by warjort

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Posted

P.S. You need to fix your build so that others can build without that api properties file.

I had to comment out a large part of your build.gradle to be able to reproduce this problem.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Posted
22 minutes ago, warjort said:

P.S. You need to fix your build so that others can build without that api properties file.

I had to comment out a large part of your build.gradle to be able to reproduce this problem.

Yeah, that api properties file is where I store the api key for publishing on CurseForge and GitHub. I forgot to mention that either you have it or all the inherent part must be commented out (or create a mock file).

Posted
26 minutes ago, warjort said:

I know what the problem is, but I don't know enough about ForgeGradle or vscode to tell you why it is happening.

 

Your launcher.json is getting generated with an empty MOD_CLASSES

      "env": {
        "MOD_CLASSES": "",
        "MCP_MAPPINGS": "official_1.18.2"
      }

When I generate the eclipse runs, I get the same problem

  <mapAttribute key="org.eclipse.debug.core.environmentVariables">
    <mapEntry key="MOD_CLASSES" value=""/>
    <mapEntry key="MCP_MAPPINGS" value="official_1.18.2"/>
  </mapAttribute>

However, the intellij runs work

    <envs>
      <env name="MOD_CLASSES" value="soulfired%%$PROJECT_DIR$\build\resources\main;soulfired%%$PROJECT_DIR$\build\classes\java\main"/>
      <env name="MCP_MAPPINGS" value="official_1.18.2"/>
    </envs>

 

I would suggest you report this a bug here: https://github.com/MinecraftForge/ForgeGradle/issues

 

When I fix that field manually to use the comparable setup as intellij, it works fine

"MOD_CLASSES": "${workspaceFolder}\\build\\resources\\main;${workspaceFolder}\\build\\classes\\java\\main",
        

 

Okay, adding the string you wrote works for me too, although I'm getting an error that says it can't find a mixin, but I guess this is another problem ahah

Thanks!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.