Improved Phoenix Arrow behavior.
This commit is contained in:
parent
47bc85f1bf
commit
020c5fc94b
|
@ -4,6 +4,7 @@ import net.minecraft.enchantment.Enchantment;
|
|||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
@ -21,8 +22,6 @@ public class EntityPhoenixArrow extends EntityArrow implements IThrowableEntity
|
|||
|
||||
private boolean hitGround;
|
||||
|
||||
public boolean isEnchanted = false;
|
||||
|
||||
public EntityPhoenixArrow(World worldIn) {
|
||||
super(worldIn);
|
||||
}
|
||||
|
@ -50,8 +49,6 @@ public class EntityPhoenixArrow extends EntityArrow implements IThrowableEntity
|
|||
}
|
||||
}
|
||||
|
||||
super.onUpdate();
|
||||
|
||||
Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||
Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false);
|
||||
|
@ -108,13 +105,15 @@ public class EntityPhoenixArrow extends EntityArrow implements IThrowableEntity
|
|||
}
|
||||
|
||||
if (movingobjectposition != null) {
|
||||
if (movingobjectposition.entityHit != null) {
|
||||
if (this.isEnchanted) {
|
||||
if (movingobjectposition.entityHit != null && !(movingobjectposition.entityHit instanceof EntityEnderman)) {
|
||||
movingobjectposition.entityHit.setFire(5);
|
||||
if (this.isBurning()) {
|
||||
movingobjectposition.entityHit.setFire(10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -149,7 +149,7 @@ public class ItemPhoenixBow extends ItemBow {
|
|||
|
||||
if (l > 0)
|
||||
{
|
||||
entityarrow.isEnchanted = true;
|
||||
entityarrow.setFire(1200);
|
||||
}
|
||||
|
||||
stack.damageItem(1, entityplayer);
|
||||
|
@ -177,7 +177,6 @@ public class ItemPhoenixBow extends ItemBow {
|
|||
|
||||
public EntityPhoenixArrow createArrow(World worldIn, float distance, ItemStack stack, EntityLivingBase shooter) {
|
||||
EntityPhoenixArrow entityPhoenixArrow = new EntityPhoenixArrow(worldIn, shooter, distance);
|
||||
entityPhoenixArrow.setFire(1200);
|
||||
|
||||
return entityPhoenixArrow;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue