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 08a99f183a
commit f44524249f

View file

@ -13,8 +13,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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