3arthqu4ke / mc-runtime-test

Test the Minecraft client inside your CI
MIT License
17 stars 0 forks source link

Forge support #19

Open Faboslav opened 3 weeks ago

Faboslav commented 3 weeks ago

Would it be possible to use forge instead of lexforge (or both of it)? Nowhere in any of the projects anyone uses lexforge, so to use this action somehow automatically for example with architectury, remap from forge to lexforge is needed.

3arthqu4ke commented 3 weeks ago

Sorry for the confusion, but lexforge is forge. It is the version of Minecraftforge developed by Lex Manos. I admit, naming it lexforge instead of its official name forge is somewhat arbitrary, but it helps with simple (regex)matching, since the string "neoforge" also contains "forge".

Faboslav commented 3 weeks ago

Okay, also what would be the best way to add specific mod dependency?

Also i wanted to mention that this action is amazing, i just need to figure out how to use it properly for all of the mod loaders :). Fabric runs okay, but forge https://github.com/Faboslav/friends-and-foes/actions/runs/10888252532/job/30212391243 seems really weird, am i doing something wrong?

Faboslav commented 3 weeks ago

Forge stays on [18:04:42] [Render thread/INFO] [minecraft/Minecraft]: Waiting for player to load... for infinity, but i am not sure why :/

Faboslav commented 3 weeks ago

So i found out that if i dont copy my mod over, it finishes normally https://github.com/Faboslav/friends-and-foes/actions/runs/10897140359/job/30238096132#step:5:34849, but with a copy, its just infinite Waiting for player to load..., i am very sure that the mod works on the forge, i am not sure how to debug this any further

3arthqu4ke commented 3 weeks ago

Okay, also what would be the best way to add specific mod dependency?

Not sure if you mean that, but I currently do not have a proper maven, so the mod is not really available as a dependency rn. You can use Mixin to hook into the api class.

So i found out that if i dont copy my mod over, it finishes normally https://github.com/Faboslav/friends-and-foes/actions/runs/10897140359/job/30238096132#step:5:34849, but with a copy, its just infinite Waiting for player to load..., i am very sure that the mod works on the forge, i am not sure how to debug this any further

Sorry, I am on vacation rn, and I cant make promises when I can look into this. Definitely in two weeks.

What could help with diagnosing would be to print out the currently displayed minecraft screen each tick. I think my if-statement logic is a bit messed up here:

https://github.com/3arthqu4ke/mc-runtime-test/blob/e72f8fe1134aabf6fc749a2a8c09bb56dd7d283e/1_21/src/main/java/me/earth/mc_runtime_test/mixin/MixinMinecraft.java#L121

It does not necessarily mean that the player is loading, I should print what screen Minecraft is displaying here. Maybe your mod is displaying a screen? Mc-Runtime-Test kinda clicks through the world creation screen, so if theres an additional one not sure what happens.

Faboslav commented 3 weeks ago

Hmm, in this case there could be the "experimental screen" appearing as i do add worldgen related things?

As for the dependencies, more like if my mods depends on for example yungs api, i need to download it first somehow and put it into the mods dir right, just as my mod.

3arthqu4ke commented 3 weeks ago

Yeah I think so, I just downloaded the entire log archive from your run and from the logging it looks a bit like Mc-Runtime-Test is never able to open the Worldcreation screen here.

I want to follow the way a player would open a world as closely as possible, thats why I require the screens to open the way I do. From my side I could try to introduce a more lenient mode loads a world without the WorldCreationScreen.

You could Inject a @Pseudo Mixin into my tick hook here, and check if your experimental screen is displayed, and if it is, click the button to get to the normal screen or something similar? That way, with the Pseudo Mixin the code would only run if mc-runtime-test is present.

3arthqu4ke commented 3 weeks ago

As for the dependencies, more like if my mods depends on for example yungs api, i need to download it first somehow and put it into the mods dir right, just as my mod.

Ah, I will need to look into that. I am not sure if providing mod dependencies can be done properly and automatically from the side of this github action. It would need to know where to get the dependencies from.

One option for you could be to use Forge and Fabrics JarInJar/JarJar tools to build a jar that includes the mods you depend on. This also has the benefit that users of your mod do not need to gather the dependencies of your mod. Also, there might be a chance that when you build your project with gradle and you have a gradle dependency on certain mod, that a usable mod file will be downloaded into the gradle cache? Not 100% sure, because it will have to be remapped for use at compile time.

Faboslav commented 3 weeks ago

I think that most simple solution to both of these things(getting rid of experimental screen and also getting the mod dependencies) would be to use some kind of maven to download these, i already have all of my gradle.properties available in the CI, so i can easily target specific version, i just need to figure out how to browse maven, probably the modrinth one (i am not that experienced with that) and then it should work, hopefully :D

Faboslav commented 3 weeks ago

So i got that working, i am sorry for the long issue thread, but on the forge side, there seems to be often some random issue: https://github.com/Faboslav/friends-and-foes/actions/runs/10920963623/job/30312051666

I tried to use --retries 3, but i guess if its stuck for example on Screen not yet null: net.minecraft.client.gui.screens.worldselection.CreateWorldScreen, it can never retry, right?