ThreadQuickExitException
-
im trying to delay velocity packet
code:
"Delay" -> { event.cancelEvent() Timer("Delay", true).schedule(delayValue.get().toLong()) { packet.processPacket(mc.netHandler) } }
error:
Exception in thread "Delay" [23:45:26] [Delay/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]: net.minecraft.network.ThreadQuickExitException
-
@here you need to re-send a packet, but if you send a packet it will loop. so copy the method "Send Packet" in net.minecraft.network.NetworkManager, rename it to sendPacketNoEvent and remove all of the event related stuff, now you can go to your disgusting kotlin code and have a variable with a timer in it. so it will be something like:
Timer download = new Timer("Velocity Delay"); // not sure what "true" means ... case "Delay": e.cancelEvent(); download.schedule(new TimerTask() { @Override public void run(){ if(mc.thePlayer != null && mc.thePlayer.ticksExisted != 0){ mc.getNetHandler().getNetworkManager().sendPacketNoEvent(e.getPacket()); mc.shutdown(); } } }, delayValue.get()); break;
(btw this is in java if you didn't know lmao)
and sendPacketNoEvent should be like this:public void sendPacketNoEvent(Packet packetIn) { if (this.isChannelOpen()) { this.flushOutboundQueue(); this.dispatchPacket(packetIn, null); } else { this.field_181680_j.writeLock().lock(); try { this.outboundPacketsQueue.add(new NetworkManager.InboundHandlerTuplePacketListener(packetIn, (GenericFutureListener[]) null)); } finally { this.field_181680_j.writeLock().unlock(); } } }
-
that's on kotlin
"Delay" -> { e.cancelEvent(); Timer().schedule(TimerTask() { override fun run() { packet.processPacket(mc.netHandler) } }, delayValue.get()); }
-
ik and i forgot that this is client side, instead of sendPacket try channelread0