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

refactor: Gson creation #5587

Merged
merged 1 commit into from
Feb 12, 2025
Merged

refactor: Gson creation #5587

merged 1 commit into from
Feb 12, 2025

Conversation

MukjepScarlet
Copy link
Contributor

No description provided.

Copy link
Contributor

@sqlerrorthing sqlerrorthing left a comment

Choose a reason for hiding this comment

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

i think these changes should be accepted

@@ -108,7 +108,7 @@ val publicGson: Gson = GsonBuilder()
/**
* This GSON instance is used for interop communication.
*/
internal val interopGson = GsonBuilder()
internal val interopGson: Gson = GsonBuilder()
Copy link
Contributor

Choose a reason for hiding this comment

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

does this making sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because other instances have that

@@ -118,7 +118,7 @@ internal val interopGson = GsonBuilder()
* This GSON instance is used for serializing objects as accessible JSON which means it is READ-ONLY (!)
* and often comes with an easier syntax to use in other programming languages like JavaScript.
*/
internal val accessibleInteropGson = GsonBuilder()
internal val accessibleInteropGson: Gson = GsonBuilder()
Copy link
Contributor

Choose a reason for hiding this comment

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

does this making sense?

@@ -68,7 +66,7 @@ object ModuleDebugRecorder : ClientModule("DebugRecorder", Category.MISC) {
file = folder.resolve("${baseName}_${idx++}.json")
}

Files.write(file.toPath(), Gson().toJson(this.packets).toByteArray(Charset.forName("UTF-8")))
file.writeText(publicGson.toJson(this.packets))
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Comment on lines +14 to +16
ModuleMurderMystery.javaClass.getResourceAsStream("/resources/liquidbounce/data/$FILE_NAME")

check(stream != null) { "Unable to find hypixel_mm_letters.json!" }
checkNotNull(stream) { "Unable to find $FILE_NAME!" }
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@1zun4 1zun4 added this to the 0.27.0 milestone Feb 12, 2025
@1zun4 1zun4 merged commit df355a7 into CCBlueX:nextgen Feb 12, 2025
3 checks passed
@MukjepScarlet MukjepScarlet deleted the refactor/gson branch February 12, 2025 14:46
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.

3 participants