diff options
| author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2022-12-14 07:13:22 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-13 21:13:22 +0100 |
| commit | 21fa3b25bd2956e5fec89c508bf8ed61fc5cdc06 (patch) | |
| tree | ca654a1dc2463f5ba907c85c579f8bbac323ae42 /src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java | |
| parent | dd91ed7db4a4323126a04ac88bd8a4c6d6c9c82d (diff) | |
| download | notenoughupdates-21fa3b25bd2956e5fec89c508bf8ed61fc5cdc06.tar.gz notenoughupdates-21fa3b25bd2956e5fec89c508bf8ed61fc5cdc06.tar.bz2 notenoughupdates-21fa3b25bd2956e5fec89c508bf8ed61fc5cdc06.zip | |
Fix open in skycrypt button not working on linux with some jdks (#490)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java index bc389ad4..bbabc172 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java @@ -29,11 +29,6 @@ import net.minecraft.event.ClickEvent; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; -import java.awt.*; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - public class FeaturesCommand extends ClientCommandBase { public FeaturesCommand() { super("neufeatures"); @@ -48,13 +43,11 @@ public class FeaturesCommand extends ClientCommandBase { } String url = Constants.MISC.get("featureslist").getAsString(); - Desktop desk = Desktop.getDesktop(); - try { - desk.browse(new URI(url)); - Utils.addChatMessage( EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "NEU" + EnumChatFormatting.RESET + - EnumChatFormatting.GOLD + "> Opening Feature List in browser."); - } catch (URISyntaxException | IOException ignored) { - + if (Utils.openUrl(url)) { + Utils.addChatMessage( + EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "NEU" + EnumChatFormatting.RESET + + EnumChatFormatting.GOLD + "> Opening Feature List in browser."); + } else { ChatComponentText clickTextFeatures = new ChatComponentText( EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "NEU" + EnumChatFormatting.RESET + EnumChatFormatting.GOLD + "> Click here to open the Feature List in your browser."); |
