Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minecraft 1.7.10 cannot start #208

Closed
lycc193 opened this issue Nov 16, 2022 · 21 comments
Closed

minecraft 1.7.10 cannot start #208

lycc193 opened this issue Nov 16, 2022 · 21 comments

Comments

@lycc193
Copy link

lycc193 commented Nov 16, 2022

ikvm version : IKVM-8.3.0-image-netcoreapp3.1-win7-x64

mc version 1.7.10 official support for java 1.6 , up to java 1.8
however, neither launcher (official, unofficial e.g. mmc) can lanucher this version.

launch client

Exception in thread "main" java.lang.NullPointerException
	at IKVM.Internal.DynamicTypeWrapper.GetMethodBaseToken(DynamicTypeWrapper.cs:6913)
	at IKVM.Internal.DynamicTypeWrapper.GetSourceLineNumber(DynamicTypeWrapper.cs:6928)
	at IKVM.Internal.ExceptionHelper.GetLineNumber(ExceptionHelper.cs:373)
	at IKVM.Internal.ExceptionHelper+ExceptionInfoHelper.Append(ExceptionHelper.cs:221)
	at IKVM.Internal.ExceptionHelper+ExceptionInfoHelper.get_StackTrace(ExceptionHelper.cs:128)
	at java.lang.reflect.Method.invoke(Method.java:486)
	at IKVM.Runtime.Launcher.Run(Launcher.cs:495)
	at IKVM.Java.Externs.ikvm.runtime.Launcher.run(Launcher.cs:43)
	at ikvm.runtime.Launcher.run(Native Method)
	at cli.ikvm.tools.java.Program.Main(Program.cs:10)

server

\IKVM\bin\java -jar server.jar
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Reflection.Emit.MethodBuilder.GetParameters()
   at IKVM.Internal.DynamicTypeWrapper.GetMethodBaseToken(MethodBase mb) in D:\a\ikvm\ikvm\src\IKVM.Runtime\DynamicTypeWrapper.cs:line 6913
   at IKVM.Internal.DynamicTypeWrapper.GetSourceLineNumber(MethodBase mb, Int32 ilOffset) in D:\a\ikvm\ikvm\src\IKVM.Runtime\DynamicTypeWrapper.cs:line 6928
   at IKVM.Internal.ExceptionHelper.GetLineNumber(StackFrame frame) in D:\a\ikvm\ikvm\src\IKVM.Runtime\ExceptionHelper.cs:line 373
   at IKVM.Internal.ExceptionHelper.ExceptionInfoHelper.Append(List`1 stackTrace, StackTrace st, Int32 skip, Boolean isLast) in D:\a\ikvm\ikvm\src\IKVM.Runtime\ExceptionHelper.cs:line 221
   at IKVM.Internal.ExceptionHelper.ExceptionInfoHelper.get_StackTrace(Exception t) in D:\a\ikvm\ikvm\src\IKVM.Runtime\ExceptionHelper.cs:line 128
   at IKVM.Internal.ExceptionHelper.MapTypeInitializeException(TypeInitializationException t, Type handler) in D:\a\ikvm\ikvm\src\IKVM.Runtime\ExceptionHelper.cs:line 829
   at IKVM.Internal.ExceptionHelper.MapException[T](Exception x, Boolean remap, Boolean unused) in D:\a\ikvm\ikvm\src\IKVM.Runtime\ExceptionHelper.cs:line 862
   at IKVM.Internal.ExceptionHelper.MapTypeInitializeException(TypeInitializationException t, Type handler) in D:\a\ikvm\ikvm\src\IKVM.Runtime\ExceptionHelper.cs:line 805
   at IKVM.Internal.ExceptionHelper.MapException[T](Exception x, Boolean remap, Boolean unused) in D:\a\ikvm\ikvm\src\IKVM.Runtime\ExceptionHelper.cs:line 862
   at IKVM.Java.Externs.ikvm.runtime.Util.mapException(Exception x) in D:\a\ikvm\ikvm\src\IKVM.Runtime\Java\Externs\ikvm\runtime\Util.cs:line 179
   at ikvm.runtime.Util.mapException(Exception x)
   at IKVM.Runtime.Launcher.Run(String main, Boolean jar, String[] args, String rarg, IDictionary`2 properties) in D:\a\ikvm\ikvm\src\IKVM.Runtime\Launcher.cs:line 506
   at IKVM.Java.Externs.ikvm.runtime.Launcher.run(Type main, String[] args, String jvmArgPrefix, Properties properties) in D:\a\ikvm\ikvm\src\IKVM.Runtime\Java\Externs\ikvm\runtime\Launcher.cs:line 43
   at ikvm.runtime.Launcher.run(Type main, String[] args, String jvmArgPrefix, Properties properties)
   at ikvm.tools.java.Program.Main(String[] args) in D:\a\ikvm\ikvm\src\java\Program.cs:line 10
@wasabii
Copy link
Contributor

wasabii commented Nov 25, 2022

Any interest in giving this a go on the latest develop branch?

@Beyley
Copy link
Contributor

Beyley commented Nov 26, 2022

Any interest in giving this a go on the latest develop branch?

as someone who has spent the past 6 hours of my time trying to run minecraft on here, there may be a lot more to it, as at least the version im tring to run (b1.7.3) requires AWT, and crashes on startup, which to my knowledge isnt supported, given the comments on #144. my first hacky solution was to attempt to decompile the compiled C# version of the client, and hack in another windowing system, but that has failed every attempt ive done (ive tried many decompilers, on multiple OSes, over the past 7 straight hours), mostly due to the __<clinit> and __<ref> methods, which are impossible to call from C# directly, as they are invalid, and you cant do __\u003Cclinit\u00CE() either (rider says its fine but the compiler complains), not a direct issue with ikvm, but makes decompilation very tedious
After that failed ive been trying to get develop branch IKVM building locally to be able to stub out and hack in some basic AWT implementation so lwjgl works, but i have been running into multiple issues getting it to compile, on both linux and windows, heres most of the code relating to the AWT usages
image (decompiled C# from deobfuscated jar from https://github.com/calmilamsy/BIN-Mappings run through IKVM)
the usages are very minimal, meaning it wouldnt be too hard to stub out the unnessesary ones and hack in something like Eto.Forms to support the usecase of minecraft specifically, and stub out everything else for someone to build on later down the line

The exception when trying to run the client is

java.awt.HeadlessException
   at java.awt.GraphicsEnvironment.checkHeadless()
   at java.awt.Window..ctor()
   at java.awt.Frame..ctor(String title)
   at net.minecraft.client.Minecraft.start(String str1, String str2, String str3)
   at net.minecraft.client.Minecraft.start(String str1, String str2)
   at net.minecraft.client.Minecraft.main(String[] strarr)
   at Program.Main(String[] args) in /home/beyley/Projects/PROGRAMMING/C#/b1.7.3ikvm/b1.7.3ikvm/Program.cs:line 6

If you would like i can push my csproj and everything i use to launch the game up to github (im not using the CLI IKVM java app as i would like to use reflection and such to mod the game, so right now i have a function which just calls the java main)

@wasabii
Copy link
Contributor

wasabii commented Nov 26, 2022

Oh. Yeah, the client ain't going to work. I was more interested in the server, as that at least stands a chance.

AWT isn't going to work at all.

@Beyley
Copy link
Contributor

Beyley commented Nov 26, 2022

Oh. Yeah, the client ain't going to work. I was more interested in the server, as that at least stands a chance.

AWT isn't going to work at all.

I'll test the b1.7.3 server, since its much older it likely has a better chance of running

@Beyley
Copy link
Contributor

Beyley commented Nov 26, 2022

that fully started, although i could not connect due to this, im going to try to find a deobfuscated server

2022-11-25 23:43:24 [INFO] Disconnecting /127.0.0.1:58902: Took too long to log in
java.net.SocketException: Unrecognized Windows Sockets error: 110: recv failed
        at java.net.net_util_md.NET_ThrowNew(net_util_md.java:169)
        at java.net.net_util_md.NET_ThrowCurrent(net_util_md.java:180)
        at IKVM.Java.Externs.java.net.SocketInputStream.socketRead0(Unknown Source)
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
        at java.net.SocketInputStream.read(SocketInputStream.java:170)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at java.net.SocketInputStream.read(SocketInputStream.java:223)
        at java.io.FilterInputStream.read(FilterInputStream.java:83)
        at gt.a(SourceFile:131)
        at jl.g(SourceFile:197)
        at jl.c(SourceFile:17)
        at oy.run(SourceFile:84)

@wasabii
Copy link
Contributor

wasabii commented Nov 26, 2022

net_util_md in the stack, out of java.net.*, indicates you don't yet have the socket redesign code in #89. It's on 8.4, which is develop. Give that a go.

@Beyley
Copy link
Contributor

Beyley commented Nov 26, 2022

net_util_md in the stack, out of java.net.*, indicates you don't yet have the socket redesign code in #89. It's on 8.4, which is develop. Give that a go.

is there a separate nuget feed for develop? im unable to build IKVM locally so id need prebuild libs

nvm found the github action that uploads them

@wasabii
Copy link
Contributor

wasabii commented Nov 26, 2022

@Beyley
Copy link
Contributor

Beyley commented Nov 26, 2022

after updating to the develop, i get this error

2022-11-26 00:03:48 [INFO] Disconnecting ::ffff:127.0.0.1/127.0.0.1:37016: Took too long to log in
java.net.SocketTimeoutException: Connection timed out
        at IKVM.Java.Externs.java.net.SocketExceptionExtensions.ToIOException(Unknown Source)
        at IKVM.Java.Externs.java.net.SocketImplUtil.InvokeFunc(Unknown Source)
        at IKVM.Java.Externs.java.net.SocketImplUtil.InvokeFunc(Unknown Source)
        at IKVM.Java.Externs.java.net.SocketInputStream.socketRead0(Unknown Source)
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
        at java.net.SocketInputStream.read(SocketInputStream.java:170)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at java.net.SocketInputStream.read(SocketInputStream.java:223)
        at java.io.FilterInputStream.read(FilterInputStream.java:83)
        at gt.a(SourceFile:131)
        at jl.g(SourceFile:197)
        at jl.c(SourceFile:17)
        at oy.run(SourceFile:84)

@wasabii
Copy link
Contributor

wasabii commented Nov 26, 2022

Well, that seems.... like a reasonable exception. Something tried to read a socket. No data arrived. It timed out. I don't know if anything is wrong because I don't know what Minecraft is doing.

@Beyley
Copy link
Contributor

Beyley commented Nov 26, 2022

okay this is interesting: i cant connect with a bog standard JVM either 🤔

@Beyley
Copy link
Contributor

Beyley commented Nov 26, 2022

SUCCESS!
i had to disable the server's authenitication, putting it into 'offline mode', it likely breaks due to the old auth servers being long long dead for b1.7.3
image
So at least the b1.7.3 server can run under IKVM, which means thats 95% of the way to the client working, i just need to figure out how to stub out or replace the AWT calls (client and server are basically the same jar file, just with a different entry point and a bool flag set internally)

@wasabii
Copy link
Contributor

wasabii commented Nov 26, 2022

"Stubbing out AWT" is ... not something that makes much sense. AWT is the windowing toolkit. It's how windows are created, fonts are found, graphics are allocated. Not something you can just do nothing for.

@Beyley
Copy link
Contributor

Beyley commented Nov 26, 2022

"Stubbing out AWT" is ... not something that makes much sense. AWT is the windowing toolkit. It's how windows are created, fonts are found, graphics are allocated. Not something you can just do nothing for.

By stubbing out i mean stubbing out everything that isnt 'create window, GL context, and send required events to launch', generally most events arent needed for the game to launch and the basic loop to start (like focus events arent required, closing events, etc.)

@wasabii
Copy link
Contributor

wasabii commented Nov 26, 2022

Hmm. Maybe if that's all Minecraft needs.

I actually think it would be easier to get the native bits building.

@TheLastRar
Copy link
Contributor

I recently tried Minecraft 1.7.10 with 8.5.0-develop.690, I don't get the error in the OP
Instead I get this error

[20:23:23] [Client thread/INFO]: LWJGL Version: 2.9.4
[20:23:24] [Client thread/ERROR]: Couldn't set pixel format
org.lwjgl.LWJGLException: Failed to create window
	at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:241) ~[lwjgl-2.9.4-nightly-20150209.jar:?]
	at org.lwjgl.opengl.Display.createWindow(Display.java:307) ~[lwjgl-2.9.4-nightly-20150209.jar:?]
	at org.lwjgl.opengl.Display.create(Display.java:848) ~[lwjgl-2.9.4-nightly-20150209.jar:?]
	at org.lwjgl.opengl.Display.create(Display.java:756) ~[lwjgl-2.9.4-nightly-20150209.jar:?]
	at bao.ag(SourceFile:327) [minecraft-1.7.10-client.jar:?]
	at bao.f(SourceFile:713) [minecraft-1.7.10-client.jar:?]
	at org.prismlauncher.EntryPoint.listen(EntryPoint.java:128) [NewLaunch.jar:?]
	at org.prismlauncher.EntryPoint.main(EntryPoint.java:71) [NewLaunch.jar:?]
	at java.lang.reflect.Method.invoke(Method.java:486) ~[?:?]
	at IKVM.Java.Externs.ikvm.runtime.Launcher.run(Unknown Source) ~[?:?]
---- Minecraft Crash Report ----

The server launches, but doesn't work correctly, this gets logged when I try to join using the client on JVM

[21:39:27] [Server thread/INFO]: com.mojang.authlib.GameProfile@c0897e[id=<null>,name=TheLastRar,properties={},legacy=false] (/127.0.0.1:56547) lost connection: Internal Exception: java.lang.InternalError: cli.System.ArgumentException: FieldInfo must be a runtime FieldInfo object.
Parameter name: field

@TheLastRar
Copy link
Contributor

TheLastRar commented May 25, 2023

The server launches, but doesn't work correctly, this gets logged when I try to join using the client on JVM

[21:39:27] [Server thread/INFO]: com.mojang.authlib.GameProfile@c0897e[id=<null>,name=TheLastRar,properties={},legacy=false] (/127.0.0.1:56547) lost connection: Internal Exception: java.lang.InternalError: cli.System.ArgumentException: FieldInfo must be a runtime FieldInfo object.
Parameter name: field

This error looked similar to #331, so I decided to retest the 1.7.10 server with the mentioned commit 8cd5f0b cherry picked onto the develop branch.

Doing so allows the Minecraft client (on JVM) to successfully connect to the server.

Sidenote, I've tested a couple other versions of the minecraft client and some do fail with different stack traces to 1.7.10, would we want such test reports for other versions in this issue or do we want separate posts for other versions?

@wasabii
Copy link
Contributor

wasabii commented May 25, 2023

I would like a separate post for each individual issue with IKVM. So however we get there.

@TheLastRar
Copy link
Contributor

Tested 477225b, Minecraft 1.7.10 now gets ingame and can start a singleplayer game.

However, some entities do not render (such as horses) due to needing headerless awt, giving the same stack trace as #298

@wasabii
Copy link
Contributor

wasabii commented Jun 7, 2023

Wow.

@wasabii
Copy link
Contributor

wasabii commented Oct 20, 2023

I think... this is fixed? Whatever the specific issue was with 1.17.10.... TheLastRar got it running. So, closing this. Open new issues for any other issues.

@wasabii wasabii closed this as completed Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants