Skip to content

Commit

Permalink
ViaVersion for pre-1.20.5 exits the configuration stage too fast, so …
Browse files Browse the repository at this point in the history
…skip it as necessary
  • Loading branch information
PureGero committed May 2, 2024
1 parent f576276 commit fb03aa8
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/main/java/com/github/puregero/minecraftstresstest/Bot.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,22 @@ private void loggedIn(ChannelHandlerContext ctx, FriendlyByteBuf byteBuf) {
//System.out.println("changing to config mode");

CompletableFuture.delayedExecutor(1000, TimeUnit.MILLISECONDS).execute(() -> {
sendPacket(ctx, PacketIds.Serverbound.Configuration.CLIENT_INFORMATION, buffer -> {
buffer.writeUtf("en_GB");
buffer.writeByte(VIEW_DISTANCE);
buffer.writeVarInt(0);
buffer.writeBoolean(true);
buffer.writeByte(0);
buffer.writeVarInt(0);
buffer.writeBoolean(false);
buffer.writeBoolean(true);
});
if (configState) {
sendPacket(ctx, PacketIds.Serverbound.Configuration.CLIENT_INFORMATION, buffer -> {
buffer.writeUtf("en_GB");
buffer.writeByte(VIEW_DISTANCE);
buffer.writeVarInt(0);
buffer.writeBoolean(true);
buffer.writeByte(0);
buffer.writeVarInt(0);
buffer.writeBoolean(false);
buffer.writeBoolean(true);
});

sendPacket(ctx, PacketIds.Serverbound.Configuration.KNOWN_PACKS, buffer -> {
buffer.writeVarInt(0);
});
sendPacket(ctx, PacketIds.Serverbound.Configuration.KNOWN_PACKS, buffer -> {
buffer.writeVarInt(0);
});
}

CompletableFuture.delayedExecutor(1000, TimeUnit.MILLISECONDS).execute(() -> tick(ctx));
});
Expand Down

0 comments on commit fb03aa8

Please sign in to comment.