From 2e57c5774e1a3eb6302d8e53cf581ddad9a2dc1a Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 17 Apr 2016 13:32:19 -0500 Subject: [PATCH] Don't check velocities on Projectiles Closes GH-217 --- Spigot-Server-Patches/0071-Add-velocity-warnings.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Spigot-Server-Patches/0071-Add-velocity-warnings.patch b/Spigot-Server-Patches/0071-Add-velocity-warnings.patch index b885961cae..00885a3e5d 100644 --- a/Spigot-Server-Patches/0071-Add-velocity-warnings.patch +++ b/Spigot-Server-Patches/0071-Add-velocity-warnings.patch @@ -1,11 +1,11 @@ -From c7a94ca8f1a2da4eebdd69ccc8aa5112605e0d21 Mon Sep 17 00:00:00 2001 +From d6c51d8cff479bbb46e78b7dd5808e7a5c59d2b1 Mon Sep 17 00:00:00 2001 From: Joseph Hirschfeld Date: Thu, 3 Mar 2016 02:48:12 -0600 Subject: [PATCH] Add velocity warnings diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index f61f6cd..e8a5fdf 100644 +index f61f6cd..5934be1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -204,6 +204,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -13,8 +13,8 @@ index f61f6cd..e8a5fdf 100644 public void setVelocity(Vector vel) { + // Paper start - Warn server owners when plugins try to set super high velocities -+ if (vel.getX() > 4 || vel.getX() < -4 || vel.getY() > 4 || vel.getY() < -4 || vel.getZ() > 4 || vel.getZ() < -4) { -+ getServer().getLogger().warning("Excessive velocity set detected: tried to set velocity of entity #"+getEntityId()+" to ("+vel.getX()+","+vel.getY()+","+vel.getZ()+")."); ++ if (!(this instanceof org.bukkit.entity.Projectile) && (vel.getX() > 4 || vel.getX() < -4 || vel.getY() > 4 || vel.getY() < -4 || vel.getZ() > 4 || vel.getZ() < -4)) { ++ getServer().getLogger().warning("Excessive velocity set detected: tried to set velocity of entity #" + getEntityId() + " to (" + vel.getX() + "," + vel.getY() + "," + vel.getZ() + ")."); + Thread.dumpStack(); + } + // Paper end