PaperSpigot-Parent/CraftBukkit-Patches/0108-Descriptive-kick-reasons-instead-of-Nope.patch
Zach Brown 7b0c576798 Restructure PaperSpigot as a new set of modules
Allows us much greater control over the Spigot portion of the code
and makes us more "proper"
Credit to @Dmck2b for originally passing the idea along a while back
2014-07-21 15:46:54 -05:00

54 lines
2.9 KiB
Diff

From 5f56948ccf057ab3c7883d6d6259923b168c9f65 Mon Sep 17 00:00:00 2001
From: drXor <mcyoungsota@gmail.com>
Date: Sat, 15 Mar 2014 01:30:05 -0400
Subject: [PATCH] Descriptive kick reasons instead of Nope!
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index b258f15..56b5980 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -219,7 +219,7 @@ public abstract class Entity {
if ((f == Float.POSITIVE_INFINITY) || (f == Float.NEGATIVE_INFINITY)) {
if (this instanceof EntityPlayer) {
this.world.getServer().getLogger().warning(((CraftPlayer) this.getBukkitEntity()).getName() + " was caught trying to crash the server with an invalid yaw");
- ((CraftPlayer) this.getBukkitEntity()).kickPlayer("Nope");
+ ((CraftPlayer) this.getBukkitEntity()).kickPlayer("Infinite yaw (Hacking?)"); //Spigot "Nope" -> Descriptive reason
}
f = 0;
}
@@ -232,7 +232,7 @@ public abstract class Entity {
if ((f1 == Float.POSITIVE_INFINITY) || (f1 == Float.NEGATIVE_INFINITY)) {
if (this instanceof EntityPlayer) {
this.world.getServer().getLogger().warning(((CraftPlayer) this.getBukkitEntity()).getName() + " was caught trying to crash the server with an invalid pitch");
- ((CraftPlayer) this.getBukkitEntity()).kickPlayer("Nope");
+ ((CraftPlayer) this.getBukkitEntity()).kickPlayer("Infinite pitch (Hacking?)"); //Spigot "Nope" -> Descriptive reason
}
f1 = 0;
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 20fe15e..b04969a 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -185,7 +185,7 @@ public class PlayerConnection implements PacketPlayInListener {
// CraftBukkit start - Check for NaN
if (Double.isNaN(packetplayinflying.x) || Double.isNaN(packetplayinflying.y) || Double.isNaN(packetplayinflying.z) || Double.isNaN(packetplayinflying.stance)) {
c.warn(player.getName() + " was caught trying to crash the server with an invalid position.");
- getPlayer().kickPlayer("Nope!");
+ getPlayer().kickPlayer("NaN in position (Hacking?)"); //Spigot "Nope" -> Descriptive reason
return;
}
// CraftBukkit end
@@ -779,7 +779,7 @@ public class PlayerConnection implements PacketPlayInListener {
this.player.v();
} else {
c.warn(this.player.getName() + " tried to set an invalid carried item");
- this.disconnect("Nope!"); // CraftBukkit
+ this.disconnect("Invalid hotbar selection (Hacking?)"); // CraftBukkit //Spigot "Nope" -> Descriptive reason
}
}
--
1.9.1