From 970761374a56b85b97bd7c9d1a6c132f58e64608 Mon Sep 17 00:00:00 2001 From: Gravita Date: Sun, 4 Sep 2022 16:18:33 +0700 Subject: [PATCH] [FEATURE] ArchTrigger --- .../profiles/optional/triggers/ArchTrigger.java | 12 ++++++++++++ .../profiles/optional/triggers/OptionalTrigger.java | 1 + 2 files changed, 13 insertions(+) create mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/ArchTrigger.java diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/ArchTrigger.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/ArchTrigger.java new file mode 100644 index 00000000..1222af88 --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/ArchTrigger.java @@ -0,0 +1,12 @@ +package pro.gravit.launcher.profiles.optional.triggers; + +import pro.gravit.launcher.profiles.optional.OptionalFile; +import pro.gravit.utils.helper.JVMHelper; + +public class ArchTrigger extends OptionalTrigger { + public JVMHelper.ARCH arch; + @Override + protected boolean isTriggered(OptionalFile optional, OptionalTriggerContext context) { + return context.getJavaVersion().arch == arch; + } +} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/OptionalTrigger.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/OptionalTrigger.java index f47d334d..8ba54011 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/OptionalTrigger.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/OptionalTrigger.java @@ -13,6 +13,7 @@ public static void registerProviders() { if (!isRegisteredProviders) { providers.register("java", JavaTrigger.class); providers.register("os", OSTrigger.class); + providers.register("arch", ArchTrigger.class); isRegisteredProviders = true; } }