when i play minecraft above 1.8.9 and use shader it's crach to me but if i play in 1.8.9 it's working pls i wanna help ): #404
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Minecraft crash | |
on: | |
issues: | |
types: [opened] | |
permissions: | |
issues: write | |
jobs: | |
check-minecraft-crash: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Minecraft crash | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
// Strings which indicate that Minecraft is modded | |
const moddedStrings = [ | |
'net.fabricmc.loader.launch.knot.KnotClient', | |
'net.fabricmc.loader.impl.launch.knot.KnotClient', // new class name | |
'--version fabric-loader-', | |
'--tweakClass optifine.OptiFineTweaker', | |
// Minecraft Forge | |
'--launchTarget forgeclient', | |
'--launchTarget fmlserver', | |
'--fml.forgeVersion', | |
] | |
async function httpGet(url) { | |
const response = await fetch(url) | |
const status = response.status | |
const data = await response.text() | |
if (status < 200 || status >= 300) { | |
throw new Error(`GET request to ${url} failed with ${status} '${response.statusText}': ${data}`) | |
} | |
return data | |
} | |
const issueNumber = context.issue.number | |
const owner = context.repo.owner | |
const repo = context.repo.repo | |
const issueData = (await github.rest.issues.get({ | |
owner: owner, | |
repo: repo, | |
issue_number: issueNumber, | |
})).data | |
const issueTitle = issueData.title | |
const issueBody = issueData.body | |
// Uses negative lookbehind and lookahead to match start and end of string as well | |
const minecraftRegex = /(?<![a-z])Minecraft(?![a-z])/i | |
let isMinecraftIssue = minecraftRegex.test(issueTitle) || minecraftRegex.test(issueBody) | |
const foundModdedStrings = moddedStrings.filter(s => issueBody.includes(s)) | |
if (foundModdedStrings.length === 0) { | |
core.info('Did not find modded string in issue body, searching attachments') | |
// Try searching in attachments | |
// There is currently no API so try to find URL then get attachment content, see https://github.community/t/get-files-attached-in-issue/117443 | |
const attachmentPattern = new RegExp(`https://github\\.com/${owner}/${repo}/files/\\d+/[a-zA-Z0-9_\\-.]+`, 'g') | |
const attachmentUrls = Array.from(issueBody.matchAll(attachmentPattern), m => m[0]) | |
core.info(`Found attachment URLs: ${attachmentUrls}`) | |
for (const url of attachmentUrls) { | |
let attachment = undefined | |
try { | |
attachment = await httpGet(url) | |
} catch (e) { | |
// Only log message because complete error is rather verbose | |
core.warning(`Failed getting attachment for ${url}: ${e.message}`) | |
continue | |
} | |
if (!isMinecraftIssue) { | |
isMinecraftIssue = minecraftRegex.test(attachment) | |
if (isMinecraftIssue) { | |
core.info('Found Minecraft string in attachment') | |
} | |
} | |
moddedStrings.forEach(s => { | |
if (attachment.includes(s)) { | |
foundModdedStrings.push(s) | |
} | |
}) | |
} | |
} | |
let isCrashFromModdedMinecraft = foundModdedStrings.length > 0 | |
if (isCrashFromModdedMinecraft) { | |
core.notice(`Found modded strings: ${foundModdedStrings}`) | |
} else { | |
core.info('Did not find modded strings') | |
} | |
isMinecraftIssue = isMinecraftIssue || isCrashFromModdedMinecraft | |
if (isMinecraftIssue) { | |
core.notice('Detected issue to be about Minecraft') | |
let commentBody | |
if (isCrashFromModdedMinecraft) { | |
// Don't tell user to report modded crashes on Mojang's bug tracker; they will most likely be considered Invalid | |
commentBody = ( | |
'Thank you for the report!' | |
+ '\nIt looks like you are using a modified version of Minecraft. The following was detected in your crash report:' | |
+ '\n```' | |
+ '\n' + foundModdedStrings.join('\n') | |
+ '\n```' | |
+ '\nPlease try the following:' | |
+ '\n- Update your graphics drivers, see [this Minecraft Help Center article](https://help.minecraft.net/hc/en-us/articles/4409137348877-Minecraft-Java-Edition-Game-Crashes-and-Performance-Issues-FAQ), section "Update your Video Card Drivers";' | |
+ '\n often Minecraft crashes are caused by outdated graphics drivers' | |
+ '\n- Try disabling the mods you have installed one by one until you find the mod causing the crash, then report the crash to the mod author' | |
+ '\n- If you are using a third-party launcher, try the [official launcher](https://www.minecraft.net/download) instead' | |
+ '\n\nIf none of the above helped, and you are still experiencing the crash with the official launcher and without any mods installed, please submit this issue over at the [Mojang bug tracker](https://bugs.mojang.com/projects/MC/summary).' | |
+ ' Please search for existing reports first; in case you do not find any, create a new report and let us know about the issue number here (e.g. `MC-123456`).' | |
+ '\nThe Mojang team will take the first look. If an OpenJDK bug is identified, the Mojang team will contact the Microsoft Build of OpenJDK team to address the issue.' | |
) | |
} else { | |
commentBody = ( | |
'Thank you for the report!' | |
+ '\nIt looks like you are reporting that the game Minecraft crashed for you. Please try the following:' | |
+ '\n- Update your graphics drivers, see [this Minecraft Help Center article](https://help.minecraft.net/hc/en-us/articles/4409137348877-Minecraft-Java-Edition-Game-Crashes-and-Performance-Issues-FAQ), section "Update your Video Card Drivers";' | |
+ '\n often Minecraft crashes are caused by outdated graphics drivers' | |
+ '\n- In case you are using mods, try disabling them one by one until you find the mod causing the crash, then report the crash to the mod author' | |
+ '\n- If you are using a third-party launcher, try the [official launcher](https://www.minecraft.net/download) instead' | |
+ '\n\nIf none of the above helped, and you are still experiencing the crash with the official launcher and without any mods installed, please submit this issue over at the [Mojang bug tracker](https://bugs.mojang.com/projects/MC/summary).' | |
+ ' Please search for existing reports first; in case you do not find any, create a new report and let us know about the issue number here (e.g. `MC-123456`).' | |
+ '\nThe Mojang team will take the first look. If an OpenJDK bug is identified, the Mojang team will contact the Microsoft Build of OpenJDK team to address the issue.' | |
) | |
} | |
github.rest.issues.createComment({ | |
owner: owner, | |
repo: repo, | |
issue_number: issueNumber, | |
body: commentBody | |
}) | |
// Add Minecraft label | |
github.rest.issues.addLabels({ | |
owner: owner, | |
repo: repo, | |
issue_number: issueNumber, | |
labels: ['Minecraft'] | |
}) | |
// We will close any Minecraft-related issue automatically | |
github.rest.issues.update({ | |
owner: owner, | |
repo: repo, | |
issue_number: issueNumber, | |
state: 'closed' | |
}) | |
} |