diff --git a/src/main/java/com/legacy/aether/AetherEventHandler.java b/src/main/java/com/legacy/aether/AetherEventHandler.java index e65ab04..0537e33 100644 --- a/src/main/java/com/legacy/aether/AetherEventHandler.java +++ b/src/main/java/com/legacy/aether/AetherEventHandler.java @@ -1,6 +1,7 @@ package com.legacy.aether; import com.legacy.aether.entities.passive.mountable.EntityAerbunny; +import com.legacy.aether.entities.projectile.darts.EntityDartBase; import com.legacy.aether.network.AetherNetwork; import com.legacy.aether.network.packets.PacketSendEternalDay; import com.legacy.aether.network.packets.PacketSendShouldCycle; diff --git a/src/main/java/com/legacy/aether/entities/projectile/darts/EntityDartBase.java b/src/main/java/com/legacy/aether/entities/projectile/darts/EntityDartBase.java index 01f9437..a4c512d 100644 --- a/src/main/java/com/legacy/aether/entities/projectile/darts/EntityDartBase.java +++ b/src/main/java/com/legacy/aether/entities/projectile/darts/EntityDartBase.java @@ -39,6 +39,7 @@ public abstract class EntityDartBase extends EntityArrow implements IProjectile, private int ticksInGround; private int ticksInAir; private double damage = 2.0D; + private float gravityVelocity; public EntityDartBase(World world) { super(world); @@ -308,6 +309,11 @@ public abstract class EntityDartBase extends EntityArrow implements IProjectile, this.setPosition(this.posX, this.posY, this.posZ); this.func_145775_I(); } + + if (this.ticksInAir == 500) + { + this.setDead(); + } } public void onDartHit(MovingObjectPosition movingobjectposition) { @@ -386,10 +392,25 @@ public abstract class EntityDartBase extends EntityArrow implements IProjectile, this.inTile.onEntityCollidedWithBlock(this.worldObj, this.tileX, this.tileY, this.tileZ, this); } } + + if (movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && movingobjectposition.entityHit != this.shootingEntity.riddenByEntity) + { + this.setDead(); + } + else + { + this.setGravityVelocity(0.03F); + } } - protected float getGravityVelocity() { - return 0.99F; + protected float getGravityVelocity() + { + return this.gravityVelocity; + } + + public void setGravityVelocity(float gravityVelocity) + { + this.gravityVelocity = gravityVelocity; } @Override diff --git a/src/main/java/com/legacy/aether/items/weapons/projectile/ItemDartShooter.java b/src/main/java/com/legacy/aether/items/weapons/projectile/ItemDartShooter.java index f9fccf7..28b65db 100644 --- a/src/main/java/com/legacy/aether/items/weapons/projectile/ItemDartShooter.java +++ b/src/main/java/com/legacy/aether/items/weapons/projectile/ItemDartShooter.java @@ -150,6 +150,10 @@ public class ItemDartShooter extends Item { if (!world.isRemote) { world.spawnEntityInWorld(dart); + if (dart != null) + { + dart.setGravityVelocity(0.99F); + } if (!(entityplayer.capabilities.isCreativeMode)) { dart.canBePickedUp = 1;