Skip to content

Commit

Permalink
adjust mcmod.info and crash message
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Apr 7, 2022
1 parent 606b134 commit c97d840
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 24 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
7 changes: 3 additions & 4 deletions src/main/kotlin/cc/woverflow/crashpatch/CrashPatch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -88,5 +88,4 @@ object CrashPatch {
}
}
}
val logger = LogManager.getLogger(CrashPatch)
val parser = JsonParser()
val logger = LogManager.getLogger(CrashPatch)
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()
Expand Down
23 changes: 20 additions & 3 deletions src/main/kotlin/cc/woverflow/crashpatch/gui/GuiCrashMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 0 additions & 8 deletions src/main/kotlin/cc/woverflow/crashpatch/utils/utils.kt

This file was deleted.

8 changes: 4 additions & 4 deletions src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
}
Expand Down

0 comments on commit c97d840

Please sign in to comment.