@@ -23,7 +23,7 @@ public class AimlessClient implements ClientModInitializer {
2323 private static KeyMapping aimKeyBind ;
2424
2525 private static final double MAX_RANGE = 3.0 ;
26- static int reactionTicks = 6 ;
26+ private static final AimlessConfig CONFIG = AimlessConfig . load () ;
2727 private int tickCounter = 0 ;
2828 private boolean aiming = false ;
2929
@@ -40,13 +40,14 @@ public void onInitializeClient() {
4040 dispatcher .register (ClientCommands .literal ("aimless" )
4141 .then (ClientCommands .argument ("ticks" , IntegerArgumentType .integer (1 , 100 ))
4242 .executes (ctx -> {
43- reactionTicks = IntegerArgumentType .getInteger (ctx , "ticks" );
44- ctx .getSource ().sendFeedback (Component .literal ("§aReaction ticks set to " + reactionTicks ));
43+ int value = IntegerArgumentType .getInteger (ctx , "ticks" );
44+ CONFIG .setReactionTicks (value );
45+ ctx .getSource ().sendFeedback (Component .literal ("§aReaction ticks set to " + value ));
4546 return 1 ;
4647 })
4748 )
4849 .executes (ctx -> {
49- ctx .getSource ().sendFeedback (Component .literal ("§eReaction ticks: " + reactionTicks ));
50+ ctx .getSource ().sendFeedback (Component .literal ("§eReaction ticks: " + CONFIG . getReactionTicks () ));
5051 return 1 ;
5152 })
5253 )
@@ -60,7 +61,7 @@ public void onInitializeClient() {
6061
6162 if (aimKeyBind .consumeClick ()) {
6263 aiming = !aiming ;
63- player .sendOverlayMessage (Component .literal (aiming ? "Aimless §aEnabled §7(rt: " + reactionTicks + ")" : "Aimless §cDisabled" ));
64+ player .sendOverlayMessage (Component .literal (aiming ? "Aimless §aEnabled §7(rt: " + CONFIG . getReactionTicks () + ")" : "Aimless §cDisabled" ));
6465 }
6566
6667 if (!aiming ) {
@@ -69,7 +70,7 @@ public void onInitializeClient() {
6970 }
7071
7172 tickCounter ++;
72- if (tickCounter < reactionTicks ) return ;
73+ if (tickCounter < CONFIG . getReactionTicks () ) return ;
7374 tickCounter = 0 ;
7475
7576 Player closestTarget = findClosestPlayer (player , level );
0 commit comments