Java Code Examples for net.minecraft.entity.player.EntityPlayer#getArmorVisibility()
The following examples show how to use
net.minecraft.entity.player.EntityPlayer#getArmorVisibility() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EntityEndermanFighter.java From enderutilities with GNU Lesser General Public License v3.0 | 5 votes |
@Nullable protected EntityPlayer getClosestVulnerablePlayer(double x, double y, double z, double distance) { double closest = -1.0d; EntityPlayer player = null; List<EntityPlayer> players = this.getEntityWorld().getPlayers(EntityPlayer.class, EntitySelectors.NOT_SPECTATING); for (EntityPlayer playerTmp : players) { if (playerTmp.capabilities.disableDamage == false && playerTmp.isEntityAlive() && this.isPlayerHoldingSummonItem(playerTmp) == false) { double distTmp = playerTmp.getDistanceSq(x, y, z); double distSight =playerTmp.isSneaking() ? distance * 0.8d : distance; if (playerTmp.isInvisible()) { float f = playerTmp.getArmorVisibility(); if (f < 0.1f) { f = 0.1f; } distSight *= (0.7d * f); } if ((distance < 0.0d || distTmp < (distSight * distSight)) && (closest == -1.0d || distTmp < closest)) { closest = distTmp; player = playerTmp; } } } return player; }