2016-02-23 04:31:24 +01:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Joseph Hirschfeld <joe@ibj.io>
2016-03-01 00:09:49 +01:00
Date: Thu, 3 Mar 2016 02:48:12 -0600
2016-02-23 04:31:24 +01:00
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
public void setVelocity(Vector vel) {
2016-03-01 00:09:49 +01:00
+ // 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()+").");
+ Thread.dumpStack();
2016-02-23 04:31:24 +01:00
+ }
+ // Paper end
entity.motX = vel.getX();
entity.motY = vel.getY();
entity.motZ = vel.getZ();
--