Don't inform player about too old version when we can't detect his version

This commit is contained in:
FlorianMichael 2024-04-03 13:20:38 +02:00
parent 3cc472e4ae
commit e690fca663
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
1 changed files with 4 additions and 3 deletions

View File

@ -57,9 +57,10 @@ public class VersionInformer implements Listener {
}
protected void inform(final Player player) {
int version = Via.getAPI().getPlayerVersion(player);
if (version > maxVersion) return;
final int version = Via.getAPI().getPlayerVersion(player);
if (version == -1 || version > maxVersion) {
return;
}
player.sendMessage(this.versionMessage);
}