From 388823599b0a634ef6eb6dc24bc87732663b090d Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Sat, 8 Nov 2014 14:15:20 +0100 Subject: [PATCH] Possible fix for the clientside arrow-movement desync --- .../java/tconstruct/library/entity/ProjectileBase.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/tconstruct/library/entity/ProjectileBase.java b/src/main/java/tconstruct/library/entity/ProjectileBase.java index cf9777e1..5cf95a55 100644 --- a/src/main/java/tconstruct/library/entity/ProjectileBase.java +++ b/src/main/java/tconstruct/library/entity/ProjectileBase.java @@ -567,6 +567,11 @@ public abstract class ProjectileBase extends EntityArrow implements IEntityAddit // shooting entity int id = shootingEntity == null ? this.getEntityId() : shootingEntity.getEntityId(); data.writeInt(id); + + // motion stuff. This has to be sent separately since MC seems to do hardcoded stuff to arrows with this + data.writeDouble(this.motionX); + data.writeDouble(this.motionY); + data.writeDouble(this.motionZ); } @Override @@ -574,5 +579,9 @@ public abstract class ProjectileBase extends EntityArrow implements IEntityAddit returnStack = ByteBufUtils.readItemStack(data); rotationYaw = data.readFloat(); shootingEntity = worldObj.getEntityByID(data.readInt()); + + this.motionX = data.readDouble(); + this.motionY = data.readDouble(); + this.motionZ = data.readDouble(); } }