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


Java EntityLivingBase.getTeam方法代码示例

本文整理汇总了Java中net.minecraft.entity.EntityLivingBase.getTeam方法的典型用法代码示例。如果您正苦于以下问题:Java EntityLivingBase.getTeam方法的具体用法?Java EntityLivingBase.getTeam怎么用?Java EntityLivingBase.getTeam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.EntityLivingBase的用法示例。


在下文中一共展示了EntityLivingBase.getTeam方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isDisguised

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public static boolean isDisguised(EntityLivingBase living, EntityLivingBase view) {
	if(!living.hasCapability(TF2weapons.WEAPONS_CAP, null) || !WeaponsCapability.get(living).isDisguised() 
			|| (living.getCapability(TF2weapons.WEAPONS_CAP, null).invisTicks != 0 && !(view instanceof EntityBuilding)))
		return false;
	String disguisetype=WeaponsCapability.get(living).getDisguiseType();
	if(disguisetype.startsWith("M:") || disguisetype.startsWith("T:"))
		return true;
	if(disguisetype.startsWith("P:")) {
		return living.world.getScoreboard().getPlayersTeam(disguisetype.substring(2)) == view.getTeam();
	}
	return false;
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:13,代码来源:ItemDisguiseKit.java

示例2: getTeam

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public Team getTeam()
{
    if (this.isTamed())
    {
        EntityLivingBase entitylivingbase = this.getOwner();

        if (entitylivingbase != null)
        {
            return entitylivingbase.getTeam();
        }
    }

    return super.getTeam();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:EntityTameable.java

示例3: continueExecuting

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean continueExecuting()
{
    EntityLivingBase entitylivingbase = this.entityLiving.getAttackTarget();

    if (entitylivingbase == null)
    {
        return false;
    }
    else if (!entitylivingbase.isEntityAlive())
    {
        return false;
    }
    else if (entitylivingbase instanceof EntityPlayer && ((EntityPlayer)entitylivingbase).capabilities.disableDamage)
    {
        return false;
    }
    else
    {
        Team team = this.entityLiving.getTeam();
        Team team1 = entitylivingbase.getTeam();

        if (team != null && team1 == team)
        {
            return false;
        }
        else
        {
            double d0 = this.maxTargetRange();
            return this.entityLiving.getDistanceSqToEntity(entitylivingbase) > d0 * d0 ? false : !(entitylivingbase instanceof EntityPlayerMP) || !((EntityPlayerMP)entitylivingbase).interactionManager.isCreative();
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:36,代码来源:EntityAIFindEntityNearestPlayer.java

示例4: continueExecuting

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean continueExecuting()
{
    EntityLivingBase entitylivingbase = this.field_179434_b.getAttackTarget();

    if (entitylivingbase == null)
    {
        return false;
    }
    else if (!entitylivingbase.isEntityAlive())
    {
        return false;
    }
    else if (entitylivingbase instanceof EntityPlayer && ((EntityPlayer)entitylivingbase).capabilities.disableDamage)
    {
        return false;
    }
    else
    {
        Team team = this.field_179434_b.getTeam();
        Team team1 = entitylivingbase.getTeam();

        if (team != null && team1 == team)
        {
            return false;
        }
        else
        {
            double d0 = this.func_179431_f();
            return this.field_179434_b.getDistanceSqToEntity(entitylivingbase) > d0 * d0 ? false : !(entitylivingbase instanceof EntityPlayerMP) || !((EntityPlayerMP)entitylivingbase).theItemInWorldManager.isCreative();
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:36,代码来源:EntityAIFindEntityNearestPlayer.java

示例5: shouldContinueExecuting

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * A method used to see if an entity is a suitable target through a number
 * of checks. Args : entity, canTargetInvinciblePlayer
 */
@Override
public boolean shouldContinueExecuting() {
	EntityLivingBase entitylivingbase = this.taskOwner.getAttackTarget();

	if (entitylivingbase == null)
		return false;
	else if (!entitylivingbase.isEntityAlive())
		return false;
	else if(!this.targetLock && this.taskOwner.ticksExisted % 13 == 0)
		return this.shouldExecute();
	else {
		Team team = this.taskOwner.getTeam();
		Team team1 = entitylivingbase.getTeam();

		if ((team != null && team1 == team) && !(this.taskOwner instanceof EntityMedic))
			return false;
		else {
			double d0 = this.getTargetDistance();

			if (this.taskOwner.getDistanceSqToEntity(entitylivingbase) > d0 * d0)
				return false;
			else {
				if (this.shouldCheckSight)
					if (this.taskOwner.getEntitySenses().canSee(entitylivingbase))
						this.targetUnseenTicks = 0;
					else if (++this.targetUnseenTicks > 60)
						return false;

				return !(entitylivingbase instanceof EntityPlayer)
						|| !((EntityPlayer) entitylivingbase).capabilities.disableDamage;
			}
		}
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:39,代码来源:EntityAINearestChecked.java

示例6: isSuitableTarget

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@Override
protected boolean isSuitableTarget(EntityLivingBase target, boolean includeInvincibles) {
	if (target == null)
		return false;
	else if (target == this.taskOwner)
		return false;
	else if (!target.isEntityAlive())
		return false;
	else if (!this.taskOwner.canAttackClass(target.getClass()))
		return false;
	else {
		Team team = this.taskOwner.getTeam();
		Team team1 = target.getTeam();

		if ((team != null && team1 == team) && !(this.taskOwner instanceof EntityMedic))
			return false;
		else {
			if (this.taskOwner instanceof IEntityOwnable
					&& ((IEntityOwnable) this.taskOwner).getOwnerId() != null) {
				if (target instanceof IEntityOwnable && ((IEntityOwnable) this.taskOwner).getOwnerId()
						.equals(((IEntityOwnable) target).getOwnerId()))
					return false;

				if (target == ((IEntityOwnable) this.taskOwner).getOwner())
					return false;
			} else if (target instanceof EntityPlayer && !includeInvincibles
					&& ((EntityPlayer) target).capabilities.disableDamage)
				return false;

			return !this.shouldCheckSight || this.taskOwner.getEntitySenses().canSee(target);
		}
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:34,代码来源:EntityAIOwnerHurt.java

示例7: isSuitableTarget

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@Override
protected boolean isSuitableTarget(EntityLivingBase target, boolean includeInvincibles) {
	if (target == null)
		return false;
	else if (target == this.taskOwner)
		return false;
	else if (!target.isEntityAlive())
		return false;
	else if (!this.taskOwner.canAttackClass(target.getClass()))
		return false;
	else{
		Team team = this.taskOwner.getTeam();
		Team team1 = target.getTeam();
		boolean medic = (this.taskOwner instanceof EntityMedic);
		if ((team != null && team1 == team) && !medic)
			return false;
		else {
			if (!medic && this.taskOwner instanceof IEntityOwnable
					&& ((IEntityOwnable) this.taskOwner).getOwnerId() != null) {
				if (target instanceof IEntityOwnable && ((IEntityOwnable) this.taskOwner).getOwnerId()
						.equals(((IEntityOwnable) target).getOwnerId()))
					return false;

				if (target == ((IEntityOwnable) this.taskOwner).getOwner())
					return false;
			} else if (target instanceof EntityPlayer && !includeInvincibles
					&& ((EntityPlayer) target).capabilities.disableDamage)
				return false;

			return !this.shouldCheckSight || this.taskOwner.getEntitySenses().canSee(target);
		}
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:34,代码来源:EntityAINearestChecked.java

示例8: canHit

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public static boolean canHit(EntityLivingBase shooter, Entity ent) {
	// System.out.println("allowed: "+isOnSameTeam(shooter,ent)+"
	// "+!(shooter.getTeam()!=null&&shooter.getTeam().getAllowFriendlyFire())+"
	// "+(ent!=shooter)+" "+!(shooter instanceof
	// EntityBuilding&&((EntityBuilding)shooter).getOwner()==ent));
	return ent.isEntityAlive() && !(ent instanceof EntityLivingBase && isOnSameTeam(shooter, ent) && !(shooter.getTeam() != null && shooter.getTeam().getAllowFriendlyFire())
			&& (ent != shooter) /*&& !(shooter instanceof IEntityOwnable && ((IEntityOwnable) shooter).getOwner() == ent)*/);
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:9,代码来源:TF2Util.java

示例9: continueExecuting

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean continueExecuting()
{
    EntityLivingBase entitylivingbase = this.taskOwner.getAttackTarget();

    if (entitylivingbase == null)
    {
        return false;
    }
    else if (!entitylivingbase.isEntityAlive())
    {
        return false;
    }
    else
    {
        Team team = this.taskOwner.getTeam();
        Team team1 = entitylivingbase.getTeam();

        if (team != null && team1 == team)
        {
            return false;
        }
        else
        {
            double d0 = this.getTargetDistance();

            if (this.taskOwner.getDistanceSqToEntity(entitylivingbase) > d0 * d0)
            {
                return false;
            }
            else
            {
                if (this.shouldCheckSight)
                {
                    if (this.taskOwner.getEntitySenses().canSee(entitylivingbase))
                    {
                        this.targetUnseenTicks = 0;
                    }
                    else if (++this.targetUnseenTicks > 60)
                    {
                        return false;
                    }
                }

                return !(entitylivingbase instanceof EntityPlayer) || !((EntityPlayer)entitylivingbase).capabilities.disableDamage;
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:52,代码来源:EntityAITarget.java

示例10: isSuitableTarget

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * A static method used to see if an entity is a suitable target through a number of checks.
 */
public static boolean isSuitableTarget(EntityLiving attacker, EntityLivingBase target, boolean includeInvincibles, boolean checkSight)
{
    if (target == null)
    {
        return false;
    }
    else if (target == attacker)
    {
        return false;
    }
    else if (!target.isEntityAlive())
    {
        return false;
    }
    else if (!attacker.canAttackClass(target.getClass()))
    {
        return false;
    }
    else
    {
        Team team = attacker.getTeam();
        Team team1 = target.getTeam();

        if (team != null && team1 == team)
        {
            return false;
        }
        else
        {
            if (attacker instanceof IEntityOwnable && StringUtils.isNotEmpty(((IEntityOwnable)attacker).getOwnerId()))
            {
                if (target instanceof IEntityOwnable && ((IEntityOwnable)attacker).getOwnerId().equals(((IEntityOwnable)target).getOwnerId()))
                {
                    return false;
                }

                if (target == ((IEntityOwnable)attacker).getOwner())
                {
                    return false;
                }
            }
            else if (target instanceof EntityPlayer && !includeInvincibles && ((EntityPlayer)target).capabilities.disableDamage)
            {
                return false;
            }

            return !checkSight || attacker.getEntitySenses().canSee(target);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:54,代码来源:EntityAITarget.java

示例11: isValidTarget

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public boolean isValidTarget(EntityLivingBase living) {
			return ((living.getTeam() != null) && !TF2Util.isOnSameTeam(EntityTF2Character.this, living))
					&& (!(living instanceof EntityTF2Character && TF2ConfigVars.naturalCheck.equals("Never"))
							|| (!((EntityTF2Character) living).natural || !natural));
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:6,代码来源:EntityTF2Character.java

示例12: continueExecuting

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean continueExecuting()
{
    EntityLivingBase entitylivingbase = this.taskOwner.getAttackTarget();

    if (entitylivingbase == null)
    {
        entitylivingbase = this.target;
    }

    if (entitylivingbase == null)
    {
        return false;
    }
    else if (!entitylivingbase.isEntityAlive())
    {
        return false;
    }
    else
    {
        Team team = this.taskOwner.getTeam();
        Team team1 = entitylivingbase.getTeam();

        if (team != null && team1 == team)
        {
            return false;
        }
        else
        {
            double d0 = this.getTargetDistance();

            if (this.taskOwner.getDistanceSqToEntity(entitylivingbase) > d0 * d0)
            {
                return false;
            }
            else
            {
                if (this.shouldCheckSight)
                {
                    if (this.taskOwner.getEntitySenses().canSee(entitylivingbase))
                    {
                        this.targetUnseenTicks = 0;
                    }
                    else if (++this.targetUnseenTicks > this.unseenMemoryTicks)
                    {
                        return false;
                    }
                }

                if (entitylivingbase instanceof EntityPlayer && ((EntityPlayer)entitylivingbase).capabilities.disableDamage)
                {
                    return false;
                }
                else
                {
                    this.taskOwner.setAttackTarget(entitylivingbase);
                    return true;
                }
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:65,代码来源:EntityAITarget.java


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