Merge branch 'master' of https://github.com/WayofTime/BloodMagic
This commit is contained in:
commit
3bb1021944
|
@ -571,6 +571,14 @@ public class AlchemicalWizardryEventHooks
|
||||||
double delY = projectile.posY - entity.posY;
|
double delY = projectile.posY - entity.posY;
|
||||||
double delZ = projectile.posZ - entity.posZ;
|
double delZ = projectile.posZ - entity.posZ;
|
||||||
|
|
||||||
|
double angle = (delX*projectile.motionX + delY*projectile.motionY + delZ*projectile.motionZ)/
|
||||||
|
(Math.sqrt(delX * delX + delY * delY + delZ * delZ)*Math.sqrt(projectile.motionX*projectile.motionX + projectile.motionY* projectile.motionY + projectile.motionZ*projectile.motionZ));
|
||||||
|
angle = Math.acos(angle);
|
||||||
|
if (angle < 3*(Math.PI/4)) {
|
||||||
|
//angle is < 135 degrees
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (throwingEntity != null)
|
if (throwingEntity != null)
|
||||||
{
|
{
|
||||||
delX = -projectile.posX + throwingEntity.posX;
|
delX = -projectile.posX + throwingEntity.posX;
|
||||||
|
|
Loading…
Reference in a new issue