本文整理汇总了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"));
}
}