本文整理匯總了Java中net.minecraft.client.entity.EntityPlayerSP.getTeam方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityPlayerSP.getTeam方法的具體用法?Java EntityPlayerSP.getTeam怎麽用?Java EntityPlayerSP.getTeam使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.entity.EntityPlayerSP
的用法示例。
在下文中一共展示了EntityPlayerSP.getTeam方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: canRenderName
import net.minecraft.client.entity.EntityPlayerSP; //導入方法依賴的package包/類
protected boolean canRenderName(T entity)
{
EntityPlayerSP entityplayersp = Minecraft.getMinecraft().thePlayer;
if (entity instanceof EntityPlayer && entity != entityplayersp)
{
Team team = entity.getTeam();
Team team1 = entityplayersp.getTeam();
if (team != null)
{
Team.EnumVisible team$enumvisible = team.getNameTagVisibility();
switch (team$enumvisible)
{
case ALWAYS:
return true;
case NEVER:
return false;
case HIDE_FOR_OTHER_TEAMS:
return team1 == null || team.isSameTeam(team1);
case HIDE_FOR_OWN_TEAM:
return team1 == null || !team.isSameTeam(team1);
default:
return true;
}
}
}
return Minecraft.isGuiEnabled() && entity != this.renderManager.livingPlayer && !entity.isInvisibleToPlayer(entityplayersp) && entity.riddenByEntity == null;
}
示例2: canRenderName
import net.minecraft.client.entity.EntityPlayerSP; //導入方法依賴的package包/類
protected boolean canRenderName(T entity)
{
EntityPlayerSP entityplayersp = Minecraft.getMinecraft().player;
boolean flag = !entity.isInvisibleToPlayer(entityplayersp);
if (entity != entityplayersp)
{
Team team = entity.getTeam();
Team team1 = entityplayersp.getTeam();
if (team != null)
{
Team.EnumVisible team$enumvisible = team.getNameTagVisibility();
switch (team$enumvisible)
{
case ALWAYS:
return flag;
case NEVER:
return false;
case HIDE_FOR_OTHER_TEAMS:
return team1 == null ? flag : team.isSameTeam(team1) && (team.getSeeFriendlyInvisiblesEnabled() || flag);
case HIDE_FOR_OWN_TEAM:
return team1 == null ? flag : !team.isSameTeam(team1) && flag;
default:
return true;
}
}
}
return Minecraft.isGuiEnabled() && entity != this.renderManager.renderViewEntity && flag && !entity.isBeingRidden();
}
示例3: canRenderName
import net.minecraft.client.entity.EntityPlayerSP; //導入方法依賴的package包/類
@Override
protected boolean canRenderName(AbstractClientPlayer entity) {
EntityPlayerSP entityplayersp = Minecraft.getMinecraft().player;
if (TF2Util.isOnSameTeam(entity, entityplayersp))
return super.canRenderName(entity);
else {
boolean flag = !entity.isInvisibleToPlayer(entityplayersp);
if (entity != entityplayersp) {
Team team = Minecraft.getMinecraft().world.getScoreboard().getPlayersTeam(
WeaponsCapability.get(entity).getDisguiseType().substring(2));
Team team1 = entityplayersp.getTeam();
if (team != null) {
Team.EnumVisible team$enumvisible = team.getNameTagVisibility();
switch (team$enumvisible) {
case ALWAYS:
return flag;
case NEVER:
return false;
case HIDE_FOR_OTHER_TEAMS:
return team1 == null ? flag
: team.isSameTeam(team1) && (team.getSeeFriendlyInvisiblesEnabled() || flag);
case HIDE_FOR_OWN_TEAM:
return team1 == null ? flag : !team.isSameTeam(team1) && flag;
default:
return true;
}
}
}
return Minecraft.isGuiEnabled() && entity != this.renderManager.renderViewEntity && flag
&& !entity.isBeingRidden();
}
}
示例4: canRenderName
import net.minecraft.client.entity.EntityPlayerSP; //導入方法依賴的package包/類
protected boolean canRenderName(T entity)
{
EntityPlayerSP entityplayersp = Minecraft.getMinecraft().thePlayer;
boolean flag = !entity.isInvisibleToPlayer(entityplayersp);
if (entity != entityplayersp)
{
Team team = entity.getTeam();
Team team1 = entityplayersp.getTeam();
if (team != null)
{
Team.EnumVisible team$enumvisible = team.getNameTagVisibility();
switch (team$enumvisible)
{
case ALWAYS:
return flag;
case NEVER:
return false;
case HIDE_FOR_OTHER_TEAMS:
return team1 == null ? flag : team.isSameTeam(team1) && (team.getSeeFriendlyInvisiblesEnabled() || flag);
case HIDE_FOR_OWN_TEAM:
return team1 == null ? flag : !team.isSameTeam(team1) && flag;
default:
return true;
}
}
}
return Minecraft.isGuiEnabled() && entity != this.renderManager.renderViewEntity && flag && !entity.isBeingRidden();
}