diff --git a/build.gradle b/build.gradle index d7fcfd9..9bc9eb7 100644 --- a/build.gradle +++ b/build.gradle @@ -3,13 +3,13 @@ import dev.architectury.pack200.java.Pack200Adapter plugins { id "java" - id "cc.woverflow.loom" version "0.10.2" + id "cc.woverflow.loom" version "0.10.6" id "dev.architectury.architectury-pack200" version "0.1.3" id 'org.jetbrains.kotlin.jvm' version '1.6.10' id "net.kyori.blossom" version "1.3.0" } -version = "1.3.5" +version = "1.3.7" group = "cc.woverflow" archivesBaseName = "CrashPatch" diff --git a/src/main/kotlin/cc/woverflow/crashpatch/CrashPatch.kt b/src/main/kotlin/cc/woverflow/crashpatch/CrashPatch.kt index 610e167..4dc4875 100644 --- a/src/main/kotlin/cc/woverflow/crashpatch/CrashPatch.kt +++ b/src/main/kotlin/cc/woverflow/crashpatch/CrashPatch.kt @@ -3,8 +3,8 @@ package cc.woverflow.crashpatch import cc.woverflow.crashpatch.crashes.CrashHelper import cc.woverflow.crashpatch.crashes.DeobfuscatingRewritePolicy import cc.woverflow.onecore.utils.Updater +import cc.woverflow.onecore.utils.asJsonElement import cc.woverflow.onecore.utils.command -import com.google.gson.JsonParser import com.google.gson.stream.MalformedJsonException import gg.essential.api.EssentialAPI import gg.essential.api.utils.Multithreading @@ -35,7 +35,7 @@ object CrashPatch { val availableBytes = ByteArray(inputStream.available()) inputStream.read(availableBytes, 0, inputStream.available()) val modInfo = - parser.parse(String(availableBytes)).asJsonArray[0].asJsonObject + String(availableBytes).asJsonElement().asJsonArray[0].asJsonObject if (!modInfo.has("modid")) { return@forEach } @@ -88,5 +88,4 @@ object CrashPatch { } } } -val logger = LogManager.getLogger(CrashPatch) -val parser = JsonParser() \ No newline at end of file +val logger = LogManager.getLogger(CrashPatch) \ No newline at end of file diff --git a/src/main/kotlin/cc/woverflow/crashpatch/crashes/CrashHelper.kt b/src/main/kotlin/cc/woverflow/crashpatch/crashes/CrashHelper.kt index e12bbf6..0c33292 100644 --- a/src/main/kotlin/cc/woverflow/crashpatch/crashes/CrashHelper.kt +++ b/src/main/kotlin/cc/woverflow/crashpatch/crashes/CrashHelper.kt @@ -1,6 +1,6 @@ package cc.woverflow.crashpatch.crashes -import cc.woverflow.crashpatch.utils.asJsonObject +import cc.woverflow.onecore.utils.fetchJsonElement import com.google.gson.JsonObject import gg.essential.api.utils.WebUtil import gg.essential.universal.wrappers.message.UTextComponent @@ -22,7 +22,7 @@ object CrashHelper { @JvmStatic fun loadJson(): Boolean { return try { - skyclientJson = WebUtil.fetchString("https://raw.githubusercontent.com/SkyblockClient/CrashData/main/crashes.json")?.asJsonObject() + skyclientJson = WebUtil.fetchJsonElement("https://raw.githubusercontent.com/SkyblockClient/CrashData/main/crashes.json").asJsonObject true } catch (e: Exception) { e.printStackTrace() diff --git a/src/main/kotlin/cc/woverflow/crashpatch/gui/GuiCrashMenu.kt b/src/main/kotlin/cc/woverflow/crashpatch/gui/GuiCrashMenu.kt index 7a2ff9e..1ae4e05 100644 --- a/src/main/kotlin/cc/woverflow/crashpatch/gui/GuiCrashMenu.kt +++ b/src/main/kotlin/cc/woverflow/crashpatch/gui/GuiCrashMenu.kt @@ -76,16 +76,33 @@ class GuiCrashMenu @JvmOverloads constructor(val report: CrashReport, private va width = 96.percent() } childOf content - private val susMods by UIWrappedText("${ChatColor.YELLOW}${(report as CrashReportHook).suspectedCrashPatchMods}", centered = true) constrain { + /** + * HOLY SHIT DID YOU JUST SAY THE WORD SUS???😳1?/1😱//1😳/1111!!!! + * Wait, you don't know what it is from?😳😳😳 + * Let πŸ‘†give you a brief r/history. πŸ“šπŸ“šπŸ“šπŸ‘¨β€πŸš€ + * If you didn't r/knowyourshit, the r/term sus(suspicious) is a saying from the r/popular r/game r/AmongUs. + * Among us is so funπŸ˜” πŸ‘‰πŸ‘ˆ, don't insult it, every youtuber and streamer says so!!!!!!!11 + * Corpses voice is so deep am i right or am i right😳😳????? + * I mean Mr beast and Dream play and pull big 🧠 1000000000000 iq moves in their videos..... + * YOU WERE THE IMPOSTER.... ࢞ ࢞ ࢞ + * Get it because you don't know what sus means? r/stupidquestions r/youranidot r/stupidcuck. + * I CAnT BELEeVE YOUU dont KNoW WHT SUS MeaNS?/??!??!?!!πŸ–•πŸ–•πŸ–•πŸ–•πŸ–• + * Man why do i have to r/explain this to a r/idiotπŸ€ͺπŸ€ͺπŸ€ͺπŸ“šπŸ“šπŸ“š... + * Sus is a GREAT WORD from a GREAT VIDEO GAME. in class, YOU CAN PLAY IT ON YOUR PHONE😜😜😜😜😜😜**??!?!?** + * such a masterpiece... FOR THE GREAT PRICE OF FREE!!!11!πŸ’°πŸ’°πŸ€‘πŸ€‘πŸ€‘πŸ€‘πŸ˜œπŸ˜œπŸ˜œπŸ’°πŸ’° + */ + private val ࢞ by UIWrappedText("${ChatColor.YELLOW}${(report as CrashReportHook).suspectedCrashPatchMods}", centered = true) constrain { x = 2.percent() y = SiblingConstraint(9f) width = 96.percent() textScale = (1.5).pixels() } childOf content + private val second by UIWrappedText(""" This may not be 100% accurate. - ${if (!CrashPatch.isSkyclient) "You're encouraged to send this crash report to the mod's developers to help fix the issue." else "${ChatColor.BLUE}Please go to https://discord.gg/eh7tNFezct for support should the solution below not work or there is none."}${if (init) "" else "\n${ChatColor.YELLOW}Since CrashPatch is installed, you can most likely keep on playing despite the crash."} - ${if (crashScan != null) "You may also have a look at the suggestions below to fix the issue.\n" else ""} + ${if (crashScan != null) "${ChatColor.BLUE}Please have a look at the suggestions below to fix the issue." else ""} + ${if (!CrashPatch.isSkyclient) "You're encouraged to send this crash report to the mod's developers to help fix the issue." else "${ChatColor.RED}Please go to https://discord.gg/eh7tNFezct for support${if (crashScan == null || crashScan!!.solutions.isEmpty()) "" else " if the solution below not work"}.".run { if (init || crashScan == null || crashScan!!.solutions.isEmpty()) uppercase() else this }}${if (init) "" else "\n${ChatColor.YELLOW}Since CrashPatch is installed, you can most likely keep on playing despite the crash."} + """.trimIndent(), centered = true) constrain { x = 2.percent() y = SiblingConstraint(9f) diff --git a/src/main/kotlin/cc/woverflow/crashpatch/gui/GuiServerDisconnectMenu.kt b/src/main/kotlin/cc/woverflow/crashpatch/gui/GuiServerDisconnectMenu.kt index 0853c42..499724d 100644 --- a/src/main/kotlin/cc/woverflow/crashpatch/gui/GuiServerDisconnectMenu.kt +++ b/src/main/kotlin/cc/woverflow/crashpatch/gui/GuiServerDisconnectMenu.kt @@ -65,7 +65,7 @@ class GuiServerDisconnectMenu(private val component: IChatComponent, reason: Str private val second by UIWrappedText(""" ${component.formattedText} - ${if (CrashPatch.isSkyclient) "${ChatColor.BLUE}Please go to https://discord.gg/eh7tNFezct for support should the solution below not work or there is none." else ""}${"\nYou may also have a look at the suggestions below to fix the issue.\n"} + ${if (CrashPatch.isSkyclient) "${ChatColor.BLUE}Please go to https://discord.gg/eh7tNFezct for support should the solution below not work or there is none." else ""}${"\n${ChatColor.BLUE}Please have a look at the suggestions below to fix the issue.\n"} """.trimIndent(), centered = true) constrain { x = 2.percent() y = SiblingConstraint(9f) diff --git a/src/main/kotlin/cc/woverflow/crashpatch/utils/utils.kt b/src/main/kotlin/cc/woverflow/crashpatch/utils/utils.kt deleted file mode 100644 index e97cfb6..0000000 --- a/src/main/kotlin/cc/woverflow/crashpatch/utils/utils.kt +++ /dev/null @@ -1,8 +0,0 @@ -package cc.woverflow.crashpatch.utils - -import com.google.gson.JsonObject -import com.google.gson.JsonParser - -private val parser = JsonParser() - -fun String.asJsonObject(): JsonObject = parser.parse(this).asJsonObject \ No newline at end of file diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 58c4472..69fee8d 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -2,15 +2,15 @@ { "modid": "crashpatch", "name": "CrashPatch", - "description": "", + "description": "Stop crashes from closing your game!", "version": "${version}", "mcversion": "1.8.9", - "url": "", - "updateUrl": "", + "url": "https://github.com/W-OVERFLOW/CrashPatch", + "updateUrl": "https://github.com/W-OVERFLOW/CrashPatch/releases/latest", "authorList": [ "W-OVERFLOW" ], - "credits": "", + "credits": "vfyjxf for the 1.7.10 port of VanillaFix (BetterCrashes), Runemoro for VanillaFix, the SkyClient team for maintaining the crash solution list.", "screenshots": [], "dependencies": [] }