BlueMap crashes server on Forge MDK
fk4dbad opened this issue ยท 12 comments
Just like discussed on discord it seems that BlueMap is not functional in the Forge MDK, which is setting up a mapped/deobfuscated development environment. The server always crashes with a NoSuchMethodError referencing an unmapped/obfuscated method making running BlueMap in the standard development environment for Forge impossible.
This makes the development of a 3rd party extension for BlueMap on Forge very difficult. I probably wont bother with it anymore. Just leaving the issue here for visibility.
What i did / Steps to reproduce
- Download latest Forge MDK for MC 1.16
- Import in IntelliJ as Gradle project
- run "gradle genIntellijRuns"
- Download latest Forge 1.16 build of BlueMap (currently
BlueMap-1.5.2-forge-1.16.4.jar
) - Move downloaded JAR file into the IntelliJ project in
run/mods
- Set
eula=true
inrun/eula.txt
- Launch
runServer
Expected result
Server starts, accepts connections from MC and also from a web browser accessing localhost:8100.
Actual result
Server crashes and stops with a Stacktrace in console and run/logs/latest.log
:
java.lang.NoSuchMethodError: net.minecraft.server.MinecraftServer.func_195571_aL()Lnet/minecraft/command/Commands;
at de.bluecolored.bluemap.forge.ForgeMod.onServerStarting(ForgeMod.java:103) ~[bluemap:?] {re:classloading}
at net.minecraftforge.eventbus.ASMEventHandler_135_ForgeMod_onServerStarting_FMLServerStartingEvent.invoke(.dynamic) ~[?:?] {}
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}
at net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerStarting(ServerLifecycleHooks.java:102) ~[forge:?] {re:classloading}
at net.minecraft.server.integrated.IntegratedServer.init(IntegratedServer.java:65) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:643) ~[forge:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233) ~[forge:?] {re:classloading,pl:accesstransformer:B}
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292] {}
Context
Minecraft:
1.16.5
Forge:
36.1.25
BlueMap Version:
1.5.2-forge-1.16.4
I'll close this for now, since to me this seems to be more an issue/limitation with forges build-setup and i have no idea what i can do on BlueMap's end to make this work properly.
Something same on fabric. (I wanted to make addon for 1.19)
java.lang.RuntimeException: Could not execute entrypoint stage 'main' due to errors, provided by 'bluemap'!
at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.lambda$invoke0$0(EntrypointUtils.java:51) ~[fabric-loader-0.14.8.jar:?]
at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33) ~[fabric-loader-0.14.8.jar:?]
at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:49) ~[fabric-loader-0.14.8.jar:?]
at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke(EntrypointUtils.java:35) ~[fabric-loader-0.14.8.jar:?]
at net.fabricmc.loader.impl.game.minecraft.Hooks.startServer(Hooks.java:62) ~[fabric-loader-0.14.8.jar:?]
at net.minecraft.server.Main.main(Main.java:101) [minecraft-project-@-merged-named.jar:?]
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461) [fabric-loader-0.14.8.jar:?]
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.14.8.jar:?]
at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) [fabric-loader-0.14.8.jar:?]
at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) [dev-launch-injector-0.2.1+build.8.jar:?]
Caused by: java.lang.NoClassDefFoundError: net/fabricmc/fabric/api/command/v1/CommandRegistrationCallback
at de.bluecolored.bluemap.fabric.FabricMod.onInitialize(FabricMod.java:96) ~[BlueMap-1.7.3-fabric-1.18.jar:?]
at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:47) ~[fabric-loader-0.14.8.jar:?]
... 7 more
Caused by: java.lang.ClassNotFoundException: net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback
at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:226) ~[fabric-loader-0.14.8.jar:?]
at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:145) ~[fabric-loader-0.14.8.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
at de.bluecolored.bluemap.fabric.FabricMod.onInitialize(FabricMod.java:96) ~[BlueMap-1.7.3-fabric-1.18.jar:?]
at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:47) ~[fabric-loader-0.14.8.jar:?]
... 7 more
Process finished with exit code 0
@syorito-hatsuki BlueMap depends on FabricAPI which is not included in fabric itself. Make sure that's loaded in your dev-environment as well
Soo... FabricAPI 1.19 contains fabric-command-api-v2
. And mod trying to find Caused by: java.lang.ClassNotFoundException: net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
So maybe good updated libs in fabric build from V1 to V2
@fk4dbad Did that workflow work for any other mod you depended on?
Is it sure this is an issue with bluemap specifically, or does this happen with other mod as well and thus, is it an issue with Forge?
I ask this because i think this is not an issue with bluemap, but more a problem with: "How to setup the debug/run process correctly when depending on another mod" :)
I can set up curseforge mod dependencies without a hitch, like:
implementation fg.deobf('curse.maven:create-328085:3278516')
I didn't check any other non-curseforge dependency so far.
Well okay then something like
compileOnly 'com.github.BlueMap-Minecraft:BlueMapAPI:v1.5.0'
runtimeOnly fg.deobf('<some way to add normal BlueMap>')
should work.. right?
There is no maven repo for the main BlueMap tho, so we'd need to figure out way to add the .jar file there
Sure, but the maven coordinates for BlueMap are the critical part. I thought, I found that here:
https://jitpack.io/#bluemap-minecraft/bluemap
But silly me, that is just the main project, not the forge target.
From my understanding, using a flat-dir repo like this:
repositories {
flatDir {
dirs 'libs'
}
}
(putting the BlueMap-1.4.2-forge-1.16.4.jar
in the ./libs
folder)
and using
dependencies {
compileOnly 'com.github.BlueMap-Minecraft:BlueMapAPI:v1.5.0'
runtimeOnly fg.deobf(name: 'BlueMap-1.4.2-forge-1.16.4')
}
should work, but that gives me some error trying to resolve the file..
(Could not find :BlueMap-1.4.2-forge-1.16.4:null_mapped_official_1.16.5.
)
If someone knows how to fix this, help would be appreciated.
I tried including the downloaded JAR as a local file, which seems to work for the build:
dependencies {
minecraft 'net.minecraftforge:forge:1.16.5-36.1.25'
compileOnly 'com.github.BlueMap-Minecraft:BlueMapAPI:v1.5.0'
runtimeOnly fg.deobf(files('libs/BlueMap-1.5.2-forge-1.16.4.jar'))
//alternative:
//runtimeOnly fg.deobf(fileTree(dir: "libs", include: ['*.jar']))
}
But now I run into the original NoSuchMethodError again when starting the server...
@fk4dbad Yes, using fg.deobf(
with files(
will not deobfuscate the .jar, there is a warning about this in the build log ^^