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

Backend: Add multi version preprocessor #2283

Merged
merged 16 commits into from
Aug 11, 2024

Conversation

nea89o
Copy link
Contributor

@nea89o nea89o commented Jul 31, 2024

PR Reviews

When your PR is marked as ready for review, some of our maintainers will look through your code to make sure everything is good to go. In order to do this, they may request some changes you will need to do, or fix smaller stuff (like merge conflicts) for you. If a maintainer has reviewed your PR, make sure to pull any of their changes into your local project before doing more work on your code. Having maintainers fix small stuff for you helps us speed up the process of merging your PR, so if some of your systems warrant further care, be sure to let us know (preferably with a code comment).

Make sure to only mark your PR as "Ready to review" when it is. If you still want to do major changes, you can keep a draft PR open until then.

What

This PR adds a preprocessor to automatically remap all skyhanni code to 1.21. This does not work, of course. The remapped sources are full of problems: Some methods have different names whose conversion gets lost between versions. Some methods simply get called with different arguments and need to manually handled. Some methods get fully removed and new workarounds need to be written.

The goal of this PR is to have a way for contributors to slowly make features they write work on 1.21 over time to ease the burden when making the final jump. It should run in the background and not halt normal development.

Check out the CONTRIBUTING.md changes for more info.

Changelog Technical Details

  • Added a preprocessor to prepare for 1.21. - !nea
    • This will require a minor adjustment in how the Minecraft client is launched.

@nea89o nea89o marked this pull request as draft July 31, 2024 22:23
@nea89o nea89o marked this pull request as ready for review August 1, 2024 12:20
@hannibal002 hannibal002 added this to the Version 0.27 milestone Aug 1, 2024
Copy link

github-actions bot commented Aug 8, 2024

This pull request has conflicts with the base branch "beta". Please resolve those so we can test out your changes.

@github-actions github-actions bot added the Merge Conflicts There are open merge conflicts with the beta branch. label Aug 8, 2024
@nea89o
Copy link
Contributor Author

nea89o commented Aug 8, 2024

I am going to assume that the conflict here is the version number only and am not going to fix the conflict therefore. Unless you wanna make bigger changes you should probably just discard the changes and edit the version number directly in the new branch

@github-actions github-actions bot removed the Merge Conflicts There are open merge conflicts with the beta branch. label Aug 8, 2024
Copy link

github-actions bot commented Aug 8, 2024

Conflicts have been resolved! 🎉

@nea89o
Copy link
Contributor Author

nea89o commented Aug 8, 2024

i didnt mean for you to fix it i just meant that i didnt feel like fixing it for every version update lol

@hannibal002
Copy link
Owner

I intend to merge this pr before the next beta version

@btwonion
Copy link

btwonion commented Aug 9, 2024

Hi,
in the Contributing document you described the processing of the mappings very extensively.
But how do you plan to replace the forge libraries? The main problem here is the event system I suppose - are you planning to replace it completely for a standalone system?

@nea89o
Copy link
Contributor Author

nea89o commented Aug 9, 2024

For the event library there is already a replacement system existing that is planned to be used in 1.8.9 as well. For the other forge functions we'll need to write custom functions as well using preprocessor directives like for other missing minecraft functions.

@btwonion
Copy link

btwonion commented Aug 9, 2024

ah I see. great. I'm looking forward to the porting process.

@hannibal002
Copy link
Owner

this reminds me, we need to readdress the event bus system and finally move over to the new system globally (after fixed all remaining problems with it)

Copy link
Owner

@hannibal002 hannibal002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After running this in dev env, ive found two bugs:

They happened when running the 1.8.9 runClient script. I am not sure if this is related, though.
image

shaders are broken in custom scoreboard
SkyHanni 0.26.Beta.21: Caught an ExceptionInInitializerError in CustomScoreboard at GuiOverlayRenderEvent: null
 
Caused by java.lang.ExceptionInInitializerError: null
at SH.utils.RenderUtils.drawRoundRect(RenderUtils.kt:1785)
at SH.utils.RenderUtils.drawRoundRect$default(RenderUtils.kt:1778)
at SH.features.gui.customscoreboard.RenderBackground.renderBackground(RenderBackground.kt:60)
at SH.features.gui.customscoreboard.CustomScoreboard.onRenderOverlay(CustomScoreboard.kt:61)
at SH.data.RenderData.onRenderOverlay(RenderData.kt:31)
at FML.common.eventhandler.EventBus.post(EventBus.java:140)
Caused by java.io.FileNotFoundException: skyhanni:shaders/rounded_rect.vsh
at MC.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:68)
at SH.utils.shader.ShaderManager.loadShader(ShaderManager.kt:67)
at SH.utils.shader.Shader.recompile(Shader.kt:59)
at SH.utils.shader.Shader.<init>(Shader.kt:31)
at SH.features.misc.RoundedShader.<init>(RoundedShader.kt:7)
at SH.features.misc.RoundedRectangleShader.<init>(RoundedShader.kt:27)
at SH.features.misc.RoundedRectangleShader.<clinit>(RoundedShader.kt)
at SH.utils.RenderUtils.drawRoundRect(RenderUtils.kt:1785)
at SH.utils.RenderUtils.drawRoundRect$default(RenderUtils.kt:1778)
at SH.features.gui.customscoreboard.RenderBackground.renderBackground(RenderBackground.kt:60)
at SH.features.gui.customscoreboard.CustomScoreboard.onRenderOverlay(CustomScoreboard.kt:61)
at SH.data.RenderData.onRenderOverlay(RenderData.kt:31)
at FML.common.eventhandler.EventBus.post(EventBus.java:140)
Skull texture gets rendered weirdly wrong

image

@ItsEmpa
Copy link
Contributor

ItsEmpa commented Aug 10, 2024

the skull being rendered wrong is because of the same shaders bug

@nea89o
Copy link
Contributor Author

nea89o commented Aug 10, 2024

Looks like it's just forge not finding the resources because they are not in the kotlin classes directory. Forgot it is like that on 1.8.9. As for the runClient: the runClient gradle task should work but I'll also make it generate a regular intellij config again (Although it should be noted that the intellij task does not seem manual set up to work with the right java version, unlike the gradle task)

@nea89o nea89o requested a review from hannibal002 August 10, 2024 15:21
Copy link

@pauliesnug pauliesnug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks gay to me!!!!!! :3 /pos

gradle/wrapper/gradle-wrapper.properties Outdated Show resolved Hide resolved
settings.gradle.kts Outdated Show resolved Hide resolved
settings.gradle.kts Show resolved Hide resolved
sharedVariables/src/MinecraftVersion.kt Show resolved Hide resolved
@github-actions github-actions bot added the Merge Conflicts There are open merge conflicts with the beta branch. label Aug 11, 2024
Copy link

This pull request has conflicts with the base branch "beta". Please resolve those so we can test out your changes.

# Conflicts:
#	src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt
Copy link

Conflicts have been resolved! 🎉

@github-actions github-actions bot removed the Merge Conflicts There are open merge conflicts with the beta branch. label Aug 11, 2024
@hannibal002 hannibal002 merged commit 8903d9f into hannibal002:beta Aug 11, 2024
4 checks passed
@nea89o nea89o deleted the multiversion branch August 11, 2024 16:58
@hannibal002 hannibal002 changed the title Add multi version preprocessor Backend: Add multi version preprocessor Aug 23, 2024
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

Successfully merging this pull request may close these issues.

5 participants