本文整理匯總了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);
}