From b8ca4daadf37bcbe9eb70e5eb25179968eb2f8b3 Mon Sep 17 00:00:00 2001 From: Gravita Date: Thu, 28 Jan 2021 19:08:44 +0700 Subject: [PATCH] [FEATURE] ClientProfile Properties API (issue #433) --- .../launcher/profiles/ClientProfile.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java index 1c0f8e99..03187dd9 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java @@ -71,6 +71,8 @@ public final class ClientProfile implements Comparable { // Client launcher @LauncherNetworkAPI private String mainClass; + @LauncherNetworkAPI + private final Map properties = new HashMap<>(); public static class ServerProfile { public String name; @@ -396,6 +398,26 @@ public void verify() { } } + public String getProperty(String name) { + return properties.get(name); + } + + public void putProperty(String name, String value) { + properties.put(name, value); + } + + public boolean containsProperty(String name) { + return properties.containsKey(name); + } + + public void clearProperties() { + properties.clear(); + } + + public Map getProperties() { + return Collections.unmodifiableMap(properties); + } + public enum Version { MC125("1.2.5", 29), MC147("1.4.7", 51),