Skip to content

Commit 37335e6

Browse files
feat: update instructions for essential mod update
1 parent 8deb400 commit 37335e6

File tree

1 file changed

+34
-5
lines changed

1 file changed

+34
-5
lines changed

src/main/java/gg/skytils/skytilsmod/tweaker/SkytilsLoadingPlugin.java

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222
import kotlin.text.StringsKt;
2323
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
2424

25+
import javax.swing.*;
26+
import java.awt.*;
27+
import java.awt.event.MouseAdapter;
28+
import java.awt.event.MouseEvent;
2529
import java.io.File;
30+
import java.net.URI;
2631
import java.net.URISyntaxException;
2732
import java.util.Map;
2833

@@ -46,11 +51,10 @@ public class SkytilsLoadingPlugin implements IFMLLoadingPlugin {
4651
public static final String kotlinErrorMessage =
4752
"<html><p>" +
4853
"Skytils has detected a mod with an older version of Kotlin.<br>" +
49-
"The most common culprit is the ChatTriggers mod.<br>" +
50-
"If you do have ChatTriggers, you can update to 1.3.2<br>" +
51-
"or later to fix the issue. https://www.chattriggers.com/<br>" +
5254
"In order to resolve this conflict you must<br>" +
5355
"delete the outdated mods.<br>" +
56+
"You can also try to rename Skytils to be above other mods alphabetically<br>" +
57+
"by changing Skytils.jar to !Skytils.jar<br>" +
5458
"If you have already done this and are still getting this error,<br>" +
5559
"or need assistance, ask for support in the Discord.";
5660

@@ -122,8 +126,33 @@ public SkytilsLoadingPlugin() throws URISyntaxException {
122126
String name = realFile.getName().contains(".jar") ? realFile.getName() : StringsKt.substringAfterLast(StringsKt.substringBeforeLast(file.getAbsolutePath(), ".jar", "unknown"), "/", "Unknown");
123127

124128
if (name.endsWith("!")) name = name.substring(0, name.length() - 1);
125-
126-
showMessage(kotlinErrorMessage + "<br>The culprit seems to be " + name + "<br>It bundles version " + KotlinVersion.CURRENT + "</p></html>");
129+
JButton openModFolder = new JButton("Open Mod Folder");
130+
openModFolder.addMouseListener(new MouseAdapter() {
131+
@Override
132+
public void mouseClicked(MouseEvent e) {
133+
try {
134+
Desktop.getDesktop().open(new File("./mods"));
135+
} catch (Exception ex) {
136+
ex.printStackTrace();
137+
}
138+
}
139+
});
140+
if (realFile.getParentFile().getName().equals("essential") && name.contains("Essential")) {
141+
showMessage(kotlinErrorMessage + "<br>The culprit seems to be " + name + "<br>It bundles version " + KotlinVersion.CURRENT + "</p></html>", openModFolder);
142+
} else {
143+
JButton watchVideo = new JButton("Open Tutorial Video");
144+
watchVideo.addMouseListener(new MouseAdapter() {
145+
@Override
146+
public void mouseClicked(MouseEvent e) {
147+
try {
148+
Desktop.getDesktop().browse(URI.create("https://l.skytils.gg/update-essential-video"));
149+
} catch (Exception ex) {
150+
ex.printStackTrace();
151+
}
152+
}
153+
});
154+
showMessage(kotlinErrorMessage + "<br>The culprit seems to be " + name + "<br>It bundles version " + KotlinVersion.CURRENT + "</p></html>", openModFolder, watchVideo);
155+
}
127156
exit();
128157
}
129158
if (checkForClass("com.sky.voidchat.EDFMLLoadingPlugin")) {

0 commit comments

Comments
 (0)