Don't check velocities on Projectiles

Closes GH-217
This commit is contained in:
Zach Brown 2016-04-17 13:32:19 -05:00
parent 4ffbec9f02
commit 2e57c5774e
No known key found for this signature in database
GPG Key ID: CC9DA35FC5450B76
1 changed files with 4 additions and 4 deletions

View File

@ -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 <joe@ibj.io> From: Joseph Hirschfeld <joe@ibj.io>
Date: Thu, 3 Mar 2016 02:48:12 -0600 Date: Thu, 3 Mar 2016 02:48:12 -0600
Subject: [PATCH] Add velocity warnings 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 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 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/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 { @@ -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) { public void setVelocity(Vector vel) {
+ // Paper start - Warn server owners when plugins try to set super high velocities + // 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) { + 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()+")."); + getServer().getLogger().warning("Excessive velocity set detected: tried to set velocity of entity #" + getEntityId() + " to (" + vel.getX() + "," + vel.getY() + "," + vel.getZ() + ").");
+ Thread.dumpStack(); + Thread.dumpStack();
+ } + }
+ // Paper end + // Paper end