MCPHackers / LaunchWrapper

Launch wrapper for legacy Minecraft
MIT License
21 stars 3 forks source link

BTA (BetterThanAdventure) support #4

Closed PerrysProjects closed 1 month ago

PerrysProjects commented 1 year ago

I'm not really sure, but it seems like it's not compatible with the BetterThanAdventure Mod/Version for Minecraft, or I made a mistake in writing the startup command. Well, maybe you can help me.

java -Xms256m -Xmx256m -cp "C:\Users\munoz\Desktop\libraries\LaunchWrapper.jar;C:\Users\munoz\Desktop\instances\Tost\minecraft.jar;C:\Users\munoz\Desktop\libraries\jinput.jar;C:\Users\munoz\Desktop\libraries\lwjgl.jar;C:\Users\munoz\Desktop\libraries\lwjgl_util.jar" -Djava.library.path=C:\Users\munoz\Desktop\instances\Tost\bin\natives org.mcphackers.launchwrapper.Launch Perry6226 --gameDir C:\Users\munoz\Desktop\instances\Tost

Exception in thread "main" java.lang.IllegalStateException: Unexpected constructor: (Lnet/minecraft/client/render/window/GameWindow;)V at org.mcphackers.launchwrapper.tweak.LegacyTweak.getNewMinecraftImpl(LegacyTweak.java:1446) at org.mcphackers.launchwrapper.tweak.LegacyTweak.patchAppletInit(LegacyTweak.java:1300) at org.mcphackers.launchwrapper.tweak.LegacyTweak.getMain(LegacyTweak.java:1161) at org.mcphackers.launchwrapper.tweak.LegacyTweak.transform(LegacyTweak.java:113) at org.mcphackers.launchwrapper.Launch.launch(Launch.java:42) at org.mcphackers.launchwrapper.Launch.main(Launch.java:33)

Lassebq commented 1 year ago

There were a lot of changes regarding game window in BTA afaik. It stopped using AWT and shouldn't need a patch. One of the tweak probably messes up a constuctor when being used with it

PerrysProjects commented 1 year ago

Could you try to fix the issues and make it compatibility with the newer BTA versions? This would be great as I am working on a launcher for BTA and require the -gameDir and other game arguments.

Lassebq commented 1 year ago

Will do.

Lassebq commented 1 year ago

Also, would be really helpful if you could get a complete list of features which are triggered by launchwrapper as seen here Run the testing framework on a latest BTA jar.

Lassebq commented 1 year ago

You can use another test class as an example, and simply replace url, and change getTests to return an empty new TestFeatureBuilder()

PerrysProjects commented 12 months ago

Thank you. Because of the tests, I'm quite busy this week. Depends on if I have time, I'll try it

PerrysProjects commented 12 months ago

When you fix the errors, could you also upload the JAR file on GitHub? This way, I can download it automatically with the client instead of the source code and having to build.

Lassebq commented 11 months ago

Oh ok, I see the problem now There were some safety checks for LWJGL frame patch which would throw exceptions. Should be easily fixable if it's ignored.

PerrysProjects commented 11 months ago

Perfect, can you tell me when it's fixed?

PerrysProjects commented 10 months ago

Hey, any progress?

Lassebq commented 10 months ago

Not sure, but should be fixed with latest commit

PerrysProjects commented 10 months ago

New error, but at least it starts bta this time.

java -Xms1024m -Xmx1024m -cp C:/Users/munoz/Desktop/test/instances/Latest_BTA_version/minecraft.jar;C:/Users/munoz/Desktop/test/libraries/net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar;C:/Users/munoz/Desktop/test/libraries/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar;C:/Users/munoz/Desktop/test/libraries/babric/org/lwjgl/lwjgl/lwjgl/2.9.4-babric.1/lwjgl-2.9.4-babric.1.jar;C:/Users/munoz/Desktop/test/libraries/babric/org/lwjgl/lwjgl/lwjgl_util/2.9.4-babric.1/lwjgl_util-2.9.4-babric.1.jar;C:/Users/munoz/Desktop/test/libraries/net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-windows.jar;C:/Users/munoz/Desktop/test/libraries/maven2/org/lwjgl/lwjgl-platform/3.0.0/lwjgl-platform-3.0.0-natives-windows.jar;C:/Users/munoz/Downloads/LaunchWrapper.jar; -Djava.library.path=C:/Users/munoz/Desktop/test/libraries/natives org.mcphackers.launchwrapper.Launch Perry6226 SESSION_ID --gameDir C:/Users/munoz/Desktop/test/instances/Latest_BTA_version --assetsDir C:/Users/munoz/Desktop/test/instances/Latest_BTA_version --version bta_1.7.7.0_02

[22:07:09] [main] 24 Achievements
[22:07:09] [main] 394 recipes
[22:07:09] [Minecraft main thread] Resolution: 854 x 480
[22:07:09] [Minecraft main thread] Java Version: 18.0.2.1
[22:07:09] [Minecraft main thread] java.lang.NullPointerException: Cannot invoke "java.awt.Graphics.setColor(java.awt.Color)" because "g" is null
[22:07:09] [Minecraft main thread]      at net.minecraft.client.render.window.GameWindowApplet.init(GameWindowApplet.java:31)
[22:07:09] [Minecraft main thread]      at net.minecraft.client.Minecraft.startGame(Minecraft.java:282)
[22:07:09] [Minecraft main thread]      at net.minecraft.client.Minecraft.run(Minecraft.java:646)
[22:07:09] [Minecraft main thread]      at java.base/java.lang.Thread.run(Thread.java:833)
PerrysProjects commented 10 months ago

I also get this error with Beta 1.7.3 (No BTA):

java.lang.IllegalArgumentException: input == null!
        at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1358)
        at org.mcphackers.launchwrapper.inject.Inject.getIcon(Inject.java:170)
        at org.mcphackers.launchwrapper.inject.Inject.loadIcon(Inject.java:174)
        at org.mcphackers.launchwrapper.inject.Inject.loadIcon(Inject.java:118)
        at net.minecraft.client.Minecraft.a(SourceFile:237)
        at net.minecraft.client.Minecraft.run(SourceFile:716)
        at java.base/java.lang.Thread.run(Thread.java:833)
Lassebq commented 1 month ago

Added proper BTA tweak in 8616af1. Tested against 7.2_01 Make sure to run with --tweakClass org.mcphackers.launchwrapper.tweak.BTATweak And regarding java.lang.IllegalArgumentException: input == null!, apparently you're supposed to merge bta's jar contents onto vanilla b1.7.3. Screenshot from 2024-08-15 12-46-42

Sorry for taking so long on fixing this issue.