diff --git a/common/src/main/java/common/entity/projectile/EntityBullet.java b/common/src/main/java/common/entity/projectile/EntityBullet.java index 816e343..1a6205d 100755 --- a/common/src/main/java/common/entity/projectile/EntityBullet.java +++ b/common/src/main/java/common/entity/projectile/EntityBullet.java @@ -69,8 +69,7 @@ public class EntityBullet extends Entity implements IProjectile, IObjectData double d4 = d0 / d3; double d5 = d2 / d3; this.setLocationAndAngles(shooter.posX + d4, this.posY, shooter.posZ + d5, f, f1); -// float f2 = (float)(d3 * 0.20000000298023224D); - this.setThrowableHeading(d0, d1 /* + (double)f2 */ , d2, velocity, innacuracy); + this.setThrowableHeading(d0, d1, d2, velocity, innacuracy); } } @@ -96,9 +95,6 @@ public class EntityBullet extends Entity implements IProjectile, IObjectData { } - /** - * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. - */ public void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy) { float f = ExtMath.sqrtd(x * x + y * y + z * z); @@ -125,9 +121,6 @@ public class EntityBullet extends Entity implements IProjectile, IObjectData this.setRotation(yaw, pitch); } - /** - * Sets the velocity to the args. Args: x, y, z - */ public void setVelocity(double x, double y, double z) { this.motionX = x; @@ -145,9 +138,6 @@ public class EntityBullet extends Entity implements IProjectile, IObjectData } } - /** - * Called to update the entity's position/logic. - */ public void onUpdate() { super.onUpdate(); @@ -207,16 +197,6 @@ public class EntityBullet extends Entity implements IProjectile, IObjectData movingobjectposition = new HitPosition(entity); } -// if (movingobjectposition != null && movingobjectposition.entity != null && movingobjectposition.entity.isPlayer()) -// { -// EntityNPC entityplayer = (EntityNPC)movingobjectposition.entity; -// -// if (entityplayer.creative || this.shootingEntity.isPlayer() && !((EntityNPC)this.shootingEntity).canAttackPlayer(entityplayer)) -// { -// movingobjectposition = null; -// } -// } - if (movingobjectposition != null) { if (movingobjectposition.entity != null) @@ -241,49 +221,16 @@ public class EntityBullet extends Entity implements IProjectile, IObjectData { EntityLiving entitylivingbase = (EntityLiving)movingobjectposition.entity; -// if (!this.worldObj.client) -// { -// entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1); -// } - -// if (this.knockbackStrength > 0) -// { -// float f7 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); -// -// if (f7 > 0.0F) -// { -// movingobjectposition.entityHit.addKnockback(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)f7, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)f7); -// } -// } - if (this.shootingEntity instanceof EntityLiving) { EnchantmentHelper.applyThornEnchantments(entitylivingbase, this.shootingEntity); EnchantmentHelper.applyArthropodEnchantments((EntityLiving)this.shootingEntity, entitylivingbase); } - -// if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit.isPlayer() && this.shootingEntity.isPlayer()) -// { -// ((EntityNPCMP)this.shootingEntity).netHandler.sendPacket(new S29PacketSoundEffect( -// "random.successful_hit", shootingEntity.posX, -// shootingEntity.posY + (double)shootingEntity.getEyeHeight(), shootingEntity.posZ, 0.18F, 0.45F)); -// } } this.playSound(SoundEvent.METALHIT, 0.2F); - -// this.setDead(); } -// else -// { this.setDead(); -// this.motionX *= -0.10000000149011612D; -// this.motionY *= -0.10000000149011612D; -// this.motionZ *= -0.10000000149011612D; -// this.rotYaw += 180.0F; -// this.prevYaw += 180.0F; -// this.ticksInAir = 0; -// } } else if(!this.worldObj.client) { @@ -323,31 +270,7 @@ public class EntityBullet extends Entity implements IProjectile, IObjectData this.rotPitch = this.prevPitch + (this.rotPitch - this.prevPitch) * 0.2F; this.rotYaw = this.prevYaw + (this.rotYaw - this.prevYaw) * 0.2F; -// float f4 = 0.99F; -// float f6 = 0.001F; - -// if (this.isInLiquid()) -// { -// for (int i1 = 0; i1 < 4; ++i1) -// { -// float f8 = 0.25F; -// this.worldObj.spawnParticle(ParticleType.WATER_BUBBLE, this.posX - this.motionX * (double)f8, this.posY - this.motionY * (double)f8, this.posZ - this.motionZ * (double)f8, this.motionX, this.motionY, this.motionZ); -// } -// -// f4 = 0.85F; -// } - -// if (this.isWet()) -// { -// this.extinguish(); -// } - -// this.motionX *= (double)f4; -// this.motionY *= (double)f4; -// this.motionZ *= (double)f4; -// this.motionY -= (double)f6; this.setPosition(this.posX, this.posY, this.posZ); -// this.doBlockCollisions(); } public void writeEntity(TagObject tagCompound)