From 091ce4c72c123f43f317c097818ace15f3a085fa Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Wed, 10 Aug 2022 10:15:01 +0200 Subject: Profile command (#88) * e * omg finish profile shit * api and fix 1.12.2 preprocess * fix class names --- .../java/cc/polyfrost/oneconfig/hud/HUDUtils.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/main/java/cc/polyfrost/oneconfig/hud') diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/HUDUtils.java b/src/main/java/cc/polyfrost/oneconfig/hud/HUDUtils.java index 526464e..2bc99bd 100644 --- a/src/main/java/cc/polyfrost/oneconfig/hud/HUDUtils.java +++ b/src/main/java/cc/polyfrost/oneconfig/hud/HUDUtils.java @@ -40,6 +40,7 @@ import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.Map; public class HUDUtils { public static void addHudOptions(OptionPage page, Field field, Object instance, Config config) { @@ -48,7 +49,22 @@ public class HUDUtils { Hud hud = (Hud) ConfigUtils.getField(field, instance); if (hud == null) return; hud.setConfig(config); - HudCore.huds.add(hud); + HudCore.huds.put(new Map.Entry() { + @Override + public Field getKey() { + return field; + } + + @Override + public Object getValue() { + return instance; + } + + @Override + public Object setValue(Object value) { + return null; + } + }, hud); String category = hudAnnotation.category(); String subcategory = hudAnnotation.subcategory(); ArrayList options = new ArrayList<>(); @@ -78,6 +94,7 @@ public class HUDUtils { } } catch (Exception ignored) { } + HudCore.hudOptions.addAll(options); ConfigUtils.getSubCategory(page, hudAnnotation.category(), hudAnnotation.subcategory()).options.addAll(options); } } -- cgit