summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authorVictorD <victor.danell@gmail.com>2011-03-01 20:54:53 +0100
committerVictorD <victor.danell@gmail.com>2011-03-01 20:54:53 +0100
commit13fb0e07ce5c8220c83757aa4db7e9c2d70d4206 (patch)
tree526d9e2e09a745c1409ec5e5741b13bc194b30ec /src/main/java/net
parent3dd60c168b7c5ca7c876a342a7a734a7053f3058 (diff)
downloadcraftbukkit-13fb0e07ce5c8220c83757aa4db7e9c2d70d4206.tar
craftbukkit-13fb0e07ce5c8220c83757aa4db7e9c2d70d4206.tar.gz
craftbukkit-13fb0e07ce5c8220c83757aa4db7e9c2d70d4206.tar.lz
craftbukkit-13fb0e07ce5c8220c83757aa4db7e9c2d70d4206.tar.xz
craftbukkit-13fb0e07ce5c8220c83757aa4db7e9c2d70d4206.zip
Ignore entity movement packets if distance == 0
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/EntityTrackerEntry.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index 31784724..e38f5b01 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -70,6 +70,11 @@ public class EntityTrackerEntry {
Object object = null;
boolean flag = Math.abs(i) >= 8 || Math.abs(j) >= 8 || Math.abs(k) >= 8;
boolean flag1 = Math.abs(l - this.g) >= 8 || Math.abs(i1 - this.h) >= 8;
+
+ //CraftBukkit - Create relative movement packet only if distance is greater than zero.
+ int distanceSquared = j1*j1+k1*k1+l1*l1;
+ flag = (distanceSquared > 0) && flag;
+ //CraftBukkit stop
if (j1 >= -128 && j1 < 128 && k1 >= -128 && k1 < 128 && l1 >= -128 && l1 < 128) {
if (flag && flag1) {