本文整理匯總了Java中com.stormister.rediscovered.EntityPigman類的典型用法代碼示例。如果您正苦於以下問題:Java EntityPigman類的具體用法?Java EntityPigman怎麽用?Java EntityPigman使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EntityPigman類屬於com.stormister.rediscovered包,在下文中一共展示了EntityPigman類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: shouldExecute
import com.stormister.rediscovered.EntityPigman; //導入依賴的package包/類
@Override
public boolean shouldExecute() {
if (this.villagerObj.getGrowingAge() != 0) {
return false;
} else if (this.villagerObj.getRNG().nextInt(500) != 0) {
return false;
} else {
this.villageObj = this.worldObj.getVillageCollection().getNearestVillage(new BlockPos(this.villagerObj), 0);
if (this.villageObj == null) {
return false;
} else if (this.checkSufficientDoorsPresentForNewVillager() && this.villagerObj.getIsWillingToMate(true)) {
Entity entity = this.worldObj.findNearestEntityWithinAABB(EntityPigman.class,
this.villagerObj.getEntityBoundingBox().expand(8.0D, 3.0D, 8.0D), this.villagerObj);
if (entity == null) {
return false;
} else {
this.mate = (EntityPigman) entity;
return this.mate.getGrowingAge() == 0 && this.mate.getIsWillingToMate(true);
}
} else {
return false;
}
}
}
示例2: giveBirth
import com.stormister.rediscovered.EntityPigman; //導入依賴的package包/類
private void giveBirth() {
EntityPigman entityvillager = this.villagerObj.createChild(this.mate);
this.mate.setGrowingAge(6000);
this.villagerObj.setGrowingAge(6000);
this.mate.setIsWillingToMate(false);
this.villagerObj.setIsWillingToMate(false);
entityvillager.setGrowingAge(-24000);
entityvillager.setLocationAndAngles(this.villagerObj.posX, this.villagerObj.posY, this.villagerObj.posZ, 0.0F, 0.0F);
this.worldObj.spawnEntityInWorld(entityvillager);
this.worldObj.setEntityState(entityvillager, (byte) 12);
}
示例3: EntityAIPigmanMate
import com.stormister.rediscovered.EntityPigman; //導入依賴的package包/類
public EntityAIPigmanMate (EntityPigman pigmanIn){
this.villagerObj = pigmanIn;
this.worldObj = pigmanIn.worldObj;
this.setMutexBits(8);
}