-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
refactor: Gson creation #5587
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.
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() |
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.
does this making sense?
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.
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() |
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.
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)) |
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.
👍
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!" } |
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.
👍
No description provided.