55
66package meteordevelopment .meteorclient .systems .modules .movement ;
77
8+ import meteordevelopment .meteorclient .events .game .GameJoinedEvent ;
9+ import meteordevelopment .meteorclient .events .game .GameLeftEvent ;
810import meteordevelopment .meteorclient .events .packets .PacketEvent ;
911import meteordevelopment .meteorclient .events .world .TickEvent ;
1012import meteordevelopment .meteorclient .settings .*;
@@ -61,10 +63,14 @@ public class Blink extends Module {
6163
6264 public Blink () {
6365 super (Categories .Movement , "blink" , "Allows you to essentially teleport while suspending motion updates." );
66+
67+ runInMainMenu = true ;
6468 }
6569
6670 @ Override
6771 public void onActivate () {
72+ if (!Utils .canUpdate ()) return ;
73+
6874 if (renderOriginal .get ()) {
6975 model = new FakePlayerEntity (mc .player , mc .player .getGameProfile ().name (), 20 , true );
7076 model .doNotPush = true ;
@@ -78,6 +84,8 @@ public void onActivate() {
7884
7985 @ Override
8086 public void onDeactivate () {
87+ if (!Utils .canUpdate ()) return ;
88+
8189 dumpPackets (!cancelled );
8290
8391 if (cancelled ) {
@@ -90,6 +98,8 @@ public void onDeactivate() {
9098
9199 @ EventHandler
92100 private void onTick (TickEvent .Post event ) {
101+ if (!Utils .canUpdate ()) return ;
102+
93103 timer ++;
94104
95105 if (delay .get () != 0 && delay .get () <= timer ) {
@@ -100,6 +110,8 @@ private void onTick(TickEvent.Post event) {
100110
101111 @ EventHandler
102112 private void onSendPacket (PacketEvent .Send event ) {
113+ if (!Utils .canUpdate ()) return ;
114+
103115 if (sending ) return ;
104116 if (!(event .packet instanceof PlayerMoveC2SPacket p )) return ;
105117 event .cancel ();
@@ -120,6 +132,16 @@ private void onSendPacket(PacketEvent.Send event) {
120132 }
121133 }
122134
135+ @ EventHandler
136+ private void onJoinGame (GameJoinedEvent event ) {
137+ warning ("Blink is currently enabled; you won't be able to interact with anything properly until you disable it!" );
138+ }
139+
140+ @ EventHandler
141+ private void onLeaveGame (GameLeftEvent event ) {
142+ onDeactivate ();
143+ }
144+
123145 @ Override
124146 public String getInfoString () {
125147 return String .format ("%.1f" , timer / 20f );
0 commit comments