2016-01-08 22:20:31 -05:00
|
|
|
package WayofTime.bloodmagic.entity.projectile;
|
|
|
|
|
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.entity.projectile.EntityArrow;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
import net.minecraft.world.World;
|
2016-02-18 18:00:02 -05:00
|
|
|
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
2016-01-09 10:47:36 -05:00
|
|
|
import WayofTime.bloodmagic.api.soul.PlayerDemonWillHandler;
|
2016-01-08 22:20:31 -05:00
|
|
|
|
2016-01-09 10:47:36 -05:00
|
|
|
public class EntitySentientArrow extends EntityArrow
|
2016-01-08 22:20:31 -05:00
|
|
|
{
|
|
|
|
public double reimbursedAmountOnHit = 0;
|
|
|
|
|
2016-01-09 10:47:36 -05:00
|
|
|
public EntitySentientArrow(World worldIn)
|
2016-01-08 22:20:31 -05:00
|
|
|
{
|
|
|
|
super(worldIn);
|
|
|
|
}
|
|
|
|
|
2016-01-09 10:47:36 -05:00
|
|
|
public EntitySentientArrow(World worldIn, double x, double y, double z)
|
2016-01-08 22:20:31 -05:00
|
|
|
{
|
|
|
|
super(worldIn, x, y, z);
|
|
|
|
}
|
|
|
|
|
2016-01-09 10:47:36 -05:00
|
|
|
public EntitySentientArrow(World worldIn, EntityLivingBase shooter, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_)
|
2016-01-08 22:20:31 -05:00
|
|
|
{
|
|
|
|
super(worldIn, shooter, p_i1755_3_, p_i1755_4_, p_i1755_5_);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-01-09 10:47:36 -05:00
|
|
|
public EntitySentientArrow(World worldIn, EntityLivingBase shooter, float velocity, double reimbursement)
|
2016-01-08 22:20:31 -05:00
|
|
|
{
|
|
|
|
super(worldIn, shooter, velocity);
|
|
|
|
this.reimbursedAmountOnHit = reimbursement;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void reimbursePlayer()
|
|
|
|
{
|
|
|
|
if (this.shootingEntity instanceof EntityPlayer)
|
|
|
|
{
|
2016-02-18 18:00:02 -05:00
|
|
|
PlayerDemonWillHandler.addDemonWill(EnumDemonWillType.DEFAULT, (EntityPlayer) this.shootingEntity, reimbursedAmountOnHit);
|
2016-01-08 22:20:31 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void writeEntityToNBT(NBTTagCompound tag)
|
|
|
|
{
|
|
|
|
super.writeEntityToNBT(tag);
|
|
|
|
|
|
|
|
tag.setDouble("reimbursement", reimbursedAmountOnHit);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void readEntityFromNBT(NBTTagCompound tag)
|
|
|
|
{
|
|
|
|
super.readEntityFromNBT(tag);
|
|
|
|
|
|
|
|
reimbursedAmountOnHit = tag.getDouble("reimbursement");
|
|
|
|
}
|
|
|
|
}
|