本文整理匯總了Java中net.minecraft.entity.passive.EntityVillager.setGrowingAge方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityVillager.setGrowingAge方法的具體用法?Java EntityVillager.setGrowingAge怎麽用?Java EntityVillager.setGrowingAge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.entity.passive.EntityVillager
的用法示例。
在下文中一共展示了EntityVillager.setGrowingAge方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: convertToVillager
import net.minecraft.entity.passive.EntityVillager; //導入方法依賴的package包/類
/**
* Convert this zombie into a villager.
*/
protected void convertToVillager()
{
EntityVillager entityvillager = new EntityVillager(this.worldObj);
entityvillager.copyLocationAndAnglesFrom(this);
entityvillager.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityvillager)), (IEntityLivingData)null);
entityvillager.setLookingForHome();
if (this.isChild())
{
entityvillager.setGrowingAge(-24000);
}
this.worldObj.removeEntity(this);
entityvillager.setNoAI(this.isAIDisabled());
if (this.hasCustomName())
{
entityvillager.setCustomNameTag(this.getCustomNameTag());
entityvillager.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag());
}
this.worldObj.spawnEntityInWorld(entityvillager);
entityvillager.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0));
this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1017, new BlockPos((int)this.posX, (int)this.posY, (int)this.posZ), 0);
}
示例2: convertToVillager
import net.minecraft.entity.passive.EntityVillager; //導入方法依賴的package包/類
@Override
protected void convertToVillager() {
EntityVillager villager = new EntityVillager(worldObj);
villager.copyLocationAndAnglesFrom(this);
villager.onSpawnWithEgg((IEntityLivingData) null);
villager.setLookingForHome();
villager.setProfession(getType());
if (isChild())
villager.setGrowingAge(-24000);
worldObj.removeEntity(this);
worldObj.spawnEntityInWorld(villager);
villager.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0));
worldObj.playAuxSFXAtEntity(null, 1017, (int) posX, (int) posY, (int) posZ, 0);
}
示例3: func_190738_dp
import net.minecraft.entity.passive.EntityVillager; //導入方法依賴的package包/類
protected void func_190738_dp()
{
EntityVillager entityvillager = new EntityVillager(this.world);
entityvillager.copyLocationAndAnglesFrom(this);
entityvillager.setProfession(this.func_190736_dl());
entityvillager.func_190672_a(this.world.getDifficultyForLocation(new BlockPos(entityvillager)), (IEntityLivingData)null, false);
entityvillager.setLookingForHome();
if (this.isChild())
{
entityvillager.setGrowingAge(-24000);
}
this.world.removeEntity(this);
entityvillager.setNoAI(this.isAIDisabled());
if (this.hasCustomName())
{
entityvillager.setCustomNameTag(this.getCustomNameTag());
entityvillager.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag());
}
this.world.spawnEntityInWorld(entityvillager);
entityvillager.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 200, 0));
this.world.playEvent((EntityPlayer)null, 1027, new BlockPos((int)this.posX, (int)this.posY, (int)this.posZ), 0);
}
示例4: giveBirth
import net.minecraft.entity.passive.EntityVillager; //導入方法依賴的package包/類
private void giveBirth()
{
EntityVillager 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);
}
示例5: convertToVillager
import net.minecraft.entity.passive.EntityVillager; //導入方法依賴的package包/類
/**
* Convert this zombie into a villager.
*/
protected void convertToVillager()
{
EntityVillager entityvillager = new EntityVillager(this.worldObj);
entityvillager.copyLocationAndAnglesFrom(this);
entityvillager.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityvillager)), (IEntityLivingData)null);
entityvillager.setLookingForHome();
if (this.isChild())
{
entityvillager.setGrowingAge(-24000);
}
this.worldObj.removeEntity(this);
entityvillager.setNoAI(this.isAIDisabled());
if (this.getVillagerTypeForge() != null)
entityvillager.setProfession(this.getVillagerTypeForge());
else
entityvillager.setProfession(0);
if (this.hasCustomName())
{
entityvillager.setCustomNameTag(this.getCustomNameTag());
entityvillager.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag());
}
this.worldObj.spawnEntityInWorld(entityvillager);
entityvillager.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 200, 0));
this.worldObj.playEvent((EntityPlayer)null, 1027, new BlockPos((int)this.posX, (int)this.posY, (int)this.posZ), 0);
}