当前位置: 首页>>代码示例>>Java>>正文


Java EntityPlayerSP.getTeam方法代码示例

本文整理汇总了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;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:36,代码来源:RendererLivingEntity.java

示例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();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:37,代码来源:RenderLivingBase.java

示例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();
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:36,代码来源:RenderPlayerDisguised.java

示例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();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:33,代码来源:RenderLivingBase.java


注:本文中的net.minecraft.client.entity.EntityPlayerSP.getTeam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。