Stop ghasts flying away

This commit is contained in:
Sam 2017-12-08 14:01:39 +00:00 committed by Alexander Meech
parent 6a2cfcc0bf
commit b8d2bb9167

View File

@ -203,6 +203,12 @@ class MobDefense extends SectionChallenge
}
Location location = _ghast.getLocation().add(0, 0.5, 0);
if (UtilMath.offset2dSquared(location, _ghastSpawn) > 25)
{
_ghast.teleport(_ghastSpawn);
}
Fireball fireball = _ghast.launchProjectile(LargeFireball.class);
fireball.setBounce(false);
@ -211,8 +217,6 @@ class MobDefense extends SectionChallenge
eFireball.dirX = direction.getX();
eFireball.dirY = direction.getY() - 0.005;
eFireball.dirZ = direction.getZ();
UtilEnt.CreatureMoveFast(_ghast, _ghastSpawn, 1);
}
@EventHandler