Skip to content

Commit

Permalink
Log data versions when incompatible
Browse files Browse the repository at this point in the history
  • Loading branch information
Moulberry committed Oct 10, 2023
1 parent 6de6ff0 commit d7523cb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ public void onPluginMessageReceived(@NotNull String channel, @NotNull Player pla
int dataVersion = friendlyByteBuf.readVarInt();
friendlyByteBuf.readNbt(); // Discard

if (dataVersion != SharedConstants.getCurrentVersion().getDataVersion().getVersion()) {
player.kick(Component.text("Axiom: Incompatible data version detected, are you using ViaVersion?"));
int serverDataVersion = SharedConstants.getCurrentVersion().getDataVersion().getVersion();
if (dataVersion != serverDataVersion) {
player.kick(Component.text("Axiom: Incompatible data version detected (client " + dataVersion +
", server " + serverDataVersion + "), are you using ViaVersion?"));
return;
}

Expand Down

0 comments on commit d7523cb

Please sign in to comment.