From 67a78a550c9d87715b834b4615662cc2d9e65bed Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Wed, 10 Aug 2022 13:33:52 +0200 Subject: hud profile fix (#90) * hud fix * api --- src/main/java/cc/polyfrost/oneconfig/hud/Hud.java | 7 +++++++ src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java | 1 + 2 files changed, 8 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/Hud.java b/src/main/java/cc/polyfrost/oneconfig/hud/Hud.java index 12fd5bb..2440bfc 100644 --- a/src/main/java/cc/polyfrost/oneconfig/hud/Hud.java +++ b/src/main/java/cc/polyfrost/oneconfig/hud/Hud.java @@ -166,6 +166,13 @@ public abstract class Hud { this.config = config; } + /** + * @return The config of this HUD + */ + public Config getConfig() { + return this.config; + } + /** * @return The scale of the Hud */ diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java b/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java index d78df55..f557c8d 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java @@ -56,6 +56,7 @@ public class HudCore { field.getKey().setAccessible(true); Hud oldHud = huds.get(field); Hud newHud = (Hud) field.getKey().get(field.getValue()); + newHud.setConfig(oldHud.getConfig()); for (BasicOption option : hudOptions) { if (option.getParent().equals(oldHud)) { option.setParent(newHud); -- cgit