本文整理汇总了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();
}