From 75fb318be6cb83176f318c1786dc4d1847d6c98b Mon Sep 17 00:00:00 2001 From: Colton Date: Sat, 21 Sep 2024 17:34:16 -0400 Subject: [PATCH] Implemented new settings builders in AntiKnockback --- .../module/modules/combat/AntiKnockback.java | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/aoba/module/modules/combat/AntiKnockback.java b/src/main/java/net/aoba/module/modules/combat/AntiKnockback.java index a9dcff2..8466b95 100644 --- a/src/main/java/net/aoba/module/modules/combat/AntiKnockback.java +++ b/src/main/java/net/aoba/module/modules/combat/AntiKnockback.java @@ -39,8 +39,25 @@ public class AntiKnockback extends Module implements ReceivePacketListener { - private FloatSetting horizontal; - private FloatSetting vertical; + private FloatSetting horizontal = FloatSetting.builder() + .id("antiknockback_horizontal") + .displayName("Horizontal") + .description("Horizontal Velocity") + .defaultValue(0f) + .minValue(0f) + .maxValue(1f) + .step(0.01f) + .build(); + + private FloatSetting vertical= FloatSetting.builder() + .id("antiknockback_vertical") + .displayName("Vertical") + .description("Vertical Velocity") + .defaultValue(0f) + .minValue(0f) + .maxValue(1f) + .step(0.01f) + .build(); public AntiKnockback() { super(KeybindSetting.builder().id("key.antiknockback").displayName("AntiKnockback Key").defaultValue(InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0)).build()); @@ -49,9 +66,6 @@ public AntiKnockback() { this.setCategory(Category.of("Combat")); this.setDescription("Prevents knockback."); - horizontal = new FloatSetting("killaura_horizontal", "Horizontal", "Horizontal Velocity", 0f, 0f, 1f, 0.01f); - vertical = new FloatSetting("killaura_vertical", "Vertical", "Vertical Velocity", 0f, 0f, 1f, 0.01f); - this.addSetting(horizontal); this.addSetting(vertical); }