Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public EntityPlayer getClosestVulnerablePlayer(double p_72846_1_, double p_72846_3_, double p_72846_5_, double p_72846_7_)
- {
- double d4 = -1.0D;
- EntityPlayer entityplayer = null;
- for (int i = 0; i < this.playerEntities.size(); ++i)
- {
- EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i);
- if (!entityplayer1.capabilities.disableDamage && entityplayer1.isEntityAlive())
- {
- double d5 = entityplayer1.getDistanceSq(p_72846_1_, p_72846_3_, p_72846_5_);
- double d6 = p_72846_7_;
- if (entityplayer1.isSneaking())
- {
- d6 = p_72846_7_ * 0.800000011920929D;
- }
- if (entityplayer1.isInvisible())
- {
- float f = entityplayer1.getArmorVisibility();
- if (f < 0.1F)
- {
- f = 0.1F;
- }
- d6 *= (double)(0.7F * f);
- }
- if ((p_72846_7_ < 0.0D || d5 < d6 * d6) && (d4 == -1.0D || d5 < d4))
- {
- d4 = d5;
- entityplayer = entityplayer1;
- }
- }
- }
- return entityplayer;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement