diff --git a/src/main/java/me/ionar/salhack/managers/HudManager.java b/src/main/java/me/ionar/salhack/managers/HudManager.java index 04fff6cd..01b4641b 100644 --- a/src/main/java/me/ionar/salhack/managers/HudManager.java +++ b/src/main/java/me/ionar/salhack/managers/HudManager.java @@ -20,6 +20,7 @@ import me.ionar.salhack.main.SalHack; import me.ionar.salhack.main.Wrapper; import me.ionar.salhack.module.Value; +import me.ionar.salhack.module.ValueListeners; import net.minecraft.client.gui.GuiScreen; public class HudManager @@ -27,7 +28,7 @@ public class HudManager public HudManager() { } - + public void Init() { Add(new WatermarkComponent()); @@ -86,7 +87,19 @@ public void Add(HudComponentItem p_Item) { field.setAccessible(true); } + final Value val = (Value) field.get(p_Item); + + ValueListeners listener = new ValueListeners() + { + @Override + public void OnValueChange(Value p_Val) + { + ScheduleSave(p_Item); + } + }; + + val.Listener = listener; p_Item.ValueList.add(val); } }