當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。