Skip to content

Commit

Permalink
Fix created projectile offset
Browse files Browse the repository at this point in the history
  • Loading branch information
skyboy committed Feb 19, 2015
1 parent 71cdfff commit 6992db1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/tconstruct/library/entity/ProjectileBase.java
Expand Up @@ -56,9 +56,6 @@ public ProjectileBase(World world, EntityPlayer player, float speed, float accur

// stuff from the arrow
this.setLocationAndAngles(player.posX, player.posY + (double)player.getEyeHeight(), player.posZ, player.rotationYaw, player.rotationPitch);
this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
this.posY -= 0.10000000149011612D;
this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
this.setPosition(this.posX, this.posY, this.posZ);
this.yOffset = 0.0F;
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);
Expand Down Expand Up @@ -629,5 +626,10 @@ public void readSpawnData(ByteBuf data) {
this.motionX = data.readDouble();
this.motionY = data.readDouble();
this.motionZ = data.readDouble();

// position offset so it doesn't shoot from the player's eyes
this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
this.posY -= 0.10000000149011612D;
this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
}
}

0 comments on commit 6992db1

Please sign in to comment.