-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Upgrade to 1.18.2 #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this review is a little bit of commentary for the changes I made so far
@@ -1,46 +1,53 @@ | |||
import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was recreated by copying the base forge build.gradle
and reintroducing function calls until things worked again. I assume I missed some important steps
@@ -1,78 +1,129 @@ | |||
#!/usr/bin/env sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gradle itself needed to be updated
@@ -0,0 +1,13 @@ | |||
package com.yunus1903.chatembeds.client; | |||
|
|||
public class ChatScrollPos { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class will probably need to go.
I don't know how to access a private
field in a Minecraft class, so this is used to get around chatScrollbarPos
being private in ChatComponent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can transform private
fields to be more permissive using Access Transformers.
{ | ||
if (lastScrollPos != mc.ingameGUI.getChatGUI().scrollPos) | ||
if (lastScrollPos != getScrollPos()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same hack mentioned above, chatScrollbarPos
is private
{ | ||
index = 0; | ||
} | ||
|
||
@Inject(method = "resetChatScroll", at = @At("RETURN")) | ||
public void resetChatScroll(CallbackInfo ci) { | ||
setScrollPos(chatScrollbarPos); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same hack mentioned above to expose chatScrollbarPos
minecraft.getTextureManager().bindTexture(embed.getFrames().get(currentFrame).getResourceLocation()); | ||
AbstractGui.blit(matrixStack, (width - scaledImageWidth) / 2, | ||
RenderSystem.setShaderTexture(0, embed.getFrames().get(currentFrame).getResourceLocation()); | ||
RenderSystem.enableBlend(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be honest I'm not even sure how this worked before. It really seems like this should have been required the whole time unless you were taking advantage of some temporal coupling.
Hi, Cool to see you're interested and devoted to update the mod. I will try to review, cleanup and work on it as well in the next few days. Since I won't be having much time this weekend, most of it might happen next week. |
closing to get this out of my pull requests tab (I assume this will not get looked at again) |
resolves #4
Hello @Yunus1903 !
This branch successfully builds and has been tested on Minecraft 1.18.2.
I created this PR more as a proof of concept, as I have never written a Minecraft mod and really don't understand the ecosystem at all. There's a little bit of jank in here.
Please adjust the base branch when you create a 1.18 one