diff --git a/CHANGELOG.md b/CHANGELOG.md index 195e936a..655af63d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ This changelog only contains the changes that are unreleased. For changes for in ## 3.4.31.3 ### New Features + +- New open resources button to visit minecraft.jar for modding purposes - Servers will now be started using kitty, allacritty or gnome-terminal, if x-terminal-emulator or exo-open aren't present - Support NeoForge loader for Modrinth and MultiMC import @@ -13,4 +15,4 @@ This changelog only contains the changes that are unreleased. For changes for in ### Misc - Organize ViewModels -- Rename "Vanilla Packs" to "Create Pack" \ No newline at end of file +- Rename "Vanilla Packs" to "Create Pack" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbf..033e24c4 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a3638774..62f495df 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,5 +2,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68d..fcb6fca1 100755 --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +130,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/src/main/java/com/atlauncher/gui/card/InstanceCard.java b/src/main/java/com/atlauncher/gui/card/InstanceCard.java index 520bbaae..b224b9f0 100644 --- a/src/main/java/com/atlauncher/gui/card/InstanceCard.java +++ b/src/main/java/com/atlauncher/gui/card/InstanceCard.java @@ -85,9 +85,18 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList private final JButton editButton = new JButton(GetText.tr("Edit Mods")); private final JButton serversButton = new JButton(GetText.tr("Servers")); private final JButton openWebsite = new JButton(GetText.tr("Open Website")); - private final JButton openButton = new JButton(GetText.tr("Open Folder")); private final JButton settingsButton = new JButton(GetText.tr("Settings")); + private final JPopupMenu openPopupMenu = new JPopupMenu(); + private final JMenuItem openResourceMenuItem = new JMenuItem(GetText.tr("Open Resources")); + private final DropDownButton openButton = new DropDownButton(GetText.tr("Open Folder"), openPopupMenu, true, + new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + OS.openFileExplorer(instance.getRoot()); + } + }); + private final JPopupMenu playPopupMenu = new JPopupMenu(); private final JMenuItem playOnlinePlayMenuItem = new JMenuItem(GetText.tr("Play Online")); private final JMenuItem playOfflinePlayMenuItem = new JMenuItem(GetText.tr("Play Offline")); @@ -203,6 +212,7 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList bottom.add(this.getHelpButton); setupPlayPopupMenus(); + setupOpenPopupMenus(); setupButtonPopupMenus(); // check it can be exported @@ -270,6 +280,16 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList playPopupMenu.add(playOfflinePlayMenuItem); } + private void setupOpenPopupMenus() { + openResourceMenuItem.addActionListener(e -> { + DialogManager.okDialog().setTitle(GetText.tr("Reminder")) + .setContent(GetText.tr("You may not distribute ANY resources.")) + .setType(DialogManager.WARNING).show(); + OS.openFileExplorer(instance.getMinecraftJarLibraryPath()); + }); + openPopupMenu.add(openResourceMenuItem); + } + private void setupButtonPopupMenus() { if (instance.showGetHelpButton()) { if (instance.getDiscordInviteUrl() != null) { @@ -501,7 +521,6 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList String.format("%s/%s?utm_source=launcher&utm_medium=button&utm_campaign=instance_v2_button", Constants.SERVERS_LIST_PACK, instance.getSafePackName()))); this.openWebsite.addActionListener(e -> OS.openWebBrowser(instance.getWebsiteUrl())); - this.openButton.addActionListener(e -> OS.openFileExplorer(instance.getRoot())); this.settingsButton.addActionListener(e -> { Analytics.trackEvent(AnalyticsEvent.forInstanceEvent("instance_settings", instance)); new InstanceSettingsDialog(instance); @@ -716,6 +735,7 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList this.serversButton.setText(GetText.tr("Servers")); this.openWebsite.setText(GetText.tr("Open Website")); this.openButton.setText(GetText.tr("Open Folder")); + this.openResourceMenuItem.setText(GetText.tr("Open Resources")); this.settingsButton.setText(GetText.tr("Settings")); this.normalBackupMenuItem.setText(GetText.tr("Normal Backup"));