本文整理匯總了Java中net.minecraft.entity.passive.EntityTameable.getOwner方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityTameable.getOwner方法的具體用法?Java EntityTameable.getOwner怎麽用?Java EntityTameable.getOwner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.entity.passive.EntityTameable
的用法示例。
在下文中一共展示了EntityTameable.getOwner方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: func_142018_a
import net.minecraft.entity.passive.EntityTameable; //導入方法依賴的package包/類
@Override
public boolean func_142018_a(EntityLivingBase target, EntityLivingBase owner) {
if (!(target instanceof EntityCreeper) && !(target instanceof EntityGhast)) {
if (target instanceof EntityTameable) {
EntityTameable entityTameable = (EntityTameable) target;
if (entityTameable.isTamed() && entityTameable.getOwner() == owner) {
return false;
}
}
return target instanceof EntityPlayer && owner instanceof EntityPlayer
&& !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) target) ? false
: !(target instanceof EntityHorse) || !((EntityHorse) target).isTame();
} else {
return false;
}
}
示例2: mountTamedPet
import net.minecraft.entity.passive.EntityTameable; //導入方法依賴的package包/類
private boolean mountTamedPet(AxisAlignedBB petArea, Class petClass) {
List<EntityTameable> petsList = this.worldObj.getEntitiesWithinAABB(petClass, petArea);
if (!petsList.isEmpty()) {
Iterator<EntityTameable> it = petsList.iterator();
EntityTameable pet;
while (it.hasNext()) {
pet = it.next();
if (pet != null && pet.isTamed() && pet.getOwner() != null && pet.getOwner().equals(this.riddenByEntity) && pet.ridingEntity == null) {
pet.setSitting(true);
mountMob(pet);
return true;
}
}
}
return false;
}
示例3: process
import net.minecraft.entity.passive.EntityTameable; //導入方法依賴的package包/類
@Override
public void process(List<String> list, Entity entity) {
if (entity instanceof EntityTameable) {
EntityTameable tame = (EntityTameable) entity;
if (tame.isTamed()) {
if (tame.getOwner() != null) list.add(StatCollector.translateToLocal("smartcursor.mob.tamedBy") + tame.getOwner().getCommandSenderName());
else list.add(StatCollector.translateToLocal("smartcursor.mob.tamed"));
} else list.add(StatCollector.translateToLocal("smartcursor.mob.notTamed"));
if (tame.isSitting()) list.add(StatCollector.translateToLocal("smartcursor.mob.isSitting"));
}
}