本文整理汇总了Java中net.minecraft.entity.EntityLivingBase.isOnSameTeam方法的典型用法代码示例。如果您正苦于以下问题:Java EntityLivingBase.isOnSameTeam方法的具体用法?Java EntityLivingBase.isOnSameTeam怎么用?Java EntityLivingBase.isOnSameTeam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.EntityLivingBase
的用法示例。
在下文中一共展示了EntityLivingBase.isOnSameTeam方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isOnSameTeam
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public boolean isOnSameTeam(EntityLivingBase otherEntity)
{
if (this.isTamed())
{
EntityLivingBase entitylivingbase = this.getOwner();
if (otherEntity == entitylivingbase)
{
return true;
}
if (entitylivingbase != null)
{
return entitylivingbase.isOnSameTeam(otherEntity);
}
}
return super.isOnSameTeam(otherEntity);
}
示例2: func_190551_c
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
private void func_190551_c(EntityLivingBase p_190551_1_)
{
EntityLivingBase entitylivingbase = this.func_190552_j();
if (p_190551_1_.isEntityAlive() && !p_190551_1_.func_190530_aW() && p_190551_1_ != entitylivingbase)
{
if (entitylivingbase == null)
{
p_190551_1_.attackEntityFrom(DamageSource.magic, 6.0F);
}
else
{
if (entitylivingbase.isOnSameTeam(p_190551_1_))
{
return;
}
p_190551_1_.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this, entitylivingbase), 6.0F);
}
}
}
示例3: isOnSameTeam
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
* Returns whether this Entity is on the same team as the given Entity.
*/
public boolean isOnSameTeam(Entity entityIn)
{
if (this.isTamed())
{
EntityLivingBase entitylivingbase = this.getOwner();
if (entityIn == entitylivingbase)
{
return true;
}
if (entitylivingbase != null)
{
return entitylivingbase.isOnSameTeam(entityIn);
}
}
return super.isOnSameTeam(entityIn);
}