Descriptive kick reasons instead of Nope!

This commit is contained in:
drXor 2019-01-05 16:21:07 +11:00 committed by md_5
parent b021230837
commit f2746a5eb2
2 changed files with 3 additions and 3 deletions

View File

@ -85,7 +85,7 @@
+ if (f == Float.POSITIVE_INFINITY || f == Float.NEGATIVE_INFINITY) {
+ if (this instanceof EntityPlayer) {
+ this.world.getServer().getLogger().warning(this.getName() + " was caught trying to crash the server with an invalid yaw");
+ ((CraftPlayer) this.getBukkitEntity()).kickPlayer("Nope");
+ ((CraftPlayer) this.getBukkitEntity()).kickPlayer("Infinite yaw (Hacking?)");
+ }
+ f = 0;
+ }
@ -98,7 +98,7 @@
+ if (f1 == Float.POSITIVE_INFINITY || f1 == Float.NEGATIVE_INFINITY) {
+ if (this instanceof EntityPlayer) {
+ this.world.getServer().getLogger().warning(this.getName() + " was caught trying to crash the server with an invalid pitch");
+ ((CraftPlayer) this.getBukkitEntity()).kickPlayer("Nope");
+ ((CraftPlayer) this.getBukkitEntity()).kickPlayer("Infinite pitch (Hacking?)");
+ }
+ f1 = 0;
+ }

View File

@ -824,7 +824,7 @@
this.player.resetIdleTimer();
} else {
PlayerConnection.LOGGER.warn("{} tried to set an invalid carried item", this.player.getDisplayName().getString());
+ this.disconnect("Nope!"); // CraftBukkit
+ this.disconnect("Invalid hotbar selection (Hacking?)"); // CraftBukkit
}
}