本文整理汇总了Java中net.minecraftforge.common.ForgeModContainer.zombieBabyChance方法的典型用法代码示例。如果您正苦于以下问题:Java ForgeModContainer.zombieBabyChance方法的具体用法?Java ForgeModContainer.zombieBabyChance怎么用?Java ForgeModContainer.zombieBabyChance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.ForgeModContainer
的用法示例。
在下文中一共展示了ForgeModContainer.zombieBabyChance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onInitialSpawn
import net.minecraftforge.common.ForgeModContainer; //导入方法依赖的package包/类
@Override
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData par1EntityLivingData)
{
Object data = super.onInitialSpawn(difficulty, par1EntityLivingData);
setShoggothType(0);
if(world.provider.getDimension() == ACLib.abyssal_wasteland_id)
setShoggothType(1);
if(world.provider.getDimension() == ACLib.dreadlands_id)
setShoggothType(2);
if(world.provider.getDimension() == ACLib.omothol_id)
setShoggothType(3);
if(world.provider.getDimension() == ACLib.dark_realm_id)
setShoggothType(4);
if (data == null)
data = new EntityLesserShoggoth.GroupData(world.rand.nextFloat() < ForgeModContainer.zombieBabyChance, null);
if (data instanceof EntityLesserShoggoth.GroupData)
{
EntityLesserShoggoth.GroupData groupdata = (EntityLesserShoggoth.GroupData)data;
if (groupdata.isBaby)
setChild(true);
}
return (IEntityLivingData)data;
}
示例2: onSpawnWithEgg
import net.minecraftforge.common.ForgeModContainer; //导入方法依赖的package包/类
public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_)
{
Object p_110161_1_1 = super.onSpawnWithEgg(p_110161_1_);
float f = this.worldObj.func_147462_b(this.posX, this.posY, this.posZ);
this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * f);
if (p_110161_1_1 == null)
{
p_110161_1_1 = new EntityClown.GroupData(this.worldObj.rand.nextFloat() < ForgeModContainer.zombieBabyChance, this.worldObj.rand.nextFloat() < 0.05F, null);
}
if (p_110161_1_1 instanceof EntityClown.GroupData)
{
EntityClown.GroupData groupdata = (EntityClown.GroupData)p_110161_1_1;
if (groupdata.field_142046_b)
{
this.setVillager(true);
}
if (groupdata.field_142048_a)
{
this.setChild(true);
if ((double)this.worldObj.rand.nextFloat() < 0.05D)
{
List list = this.worldObj.selectEntitiesWithinAABB(EntityChicken.class, this.boundingBox.expand(5.0D, 3.0D, 5.0D), IEntitySelector.field_152785_b);
if (!list.isEmpty())
{
EntityChicken entitychicken = (EntityChicken)list.get(0);
entitychicken.func_152117_i(true);
this.mountEntity(entitychicken);
}
}
else if ((double)this.worldObj.rand.nextFloat() < 0.05D)
{
EntityChicken entitychicken1 = new EntityChicken(this.worldObj);
entitychicken1.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
entitychicken1.onSpawnWithEgg((IEntityLivingData)null);
entitychicken1.func_152117_i(true);
this.worldObj.spawnEntityInWorld(entitychicken1);
this.mountEntity(entitychicken1);
}
}
}
this.func_146070_a(this.rand.nextFloat() < f * 0.1F);
this.addRandomArmor();
this.enchantEquipment();
if (this.getEquipmentInSlot(4) == null)
{
Calendar calendar = this.worldObj.getCurrentDate();
if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F)
{
this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin));
this.equipmentDropChances[4] = 0.0F;
}
}
this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0));
double d0 = this.rand.nextDouble() * 1.5D * (double)this.worldObj.func_147462_b(this.posX, this.posY, this.posZ);
if (d0 > 1.0D)
{
this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", d0, 2));
}
if (this.rand.nextFloat() < f * 0.05F)
{
this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0));
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2));
this.func_146070_a(true);
}
return (IEntityLivingData)p_110161_1_1;
}
示例3: onSpawnWithEgg
import net.minecraftforge.common.ForgeModContainer; //导入方法依赖的package包/类
public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_)
{
Object p_110161_1_1 = super.onSpawnWithEgg(p_110161_1_);
float f = this.worldObj.func_147462_b(this.posX, this.posY, this.posZ);
this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * f);
if (p_110161_1_1 == null)
{
p_110161_1_1 = new EntityZombie.GroupData(this.worldObj.rand.nextFloat() < ForgeModContainer.zombieBabyChance, this.worldObj.rand.nextFloat() < 0.05F, null);
}
if (p_110161_1_1 instanceof EntityZombie.GroupData)
{
EntityZombie.GroupData groupdata = (EntityZombie.GroupData)p_110161_1_1;
if (groupdata.field_142046_b)
{
this.setVillager(true);
}
if (groupdata.field_142048_a)
{
this.setChild(true);
if ((double)this.worldObj.rand.nextFloat() < 0.05D)
{
List list = this.worldObj.selectEntitiesWithinAABB(EntityChicken.class, this.boundingBox.expand(5.0D, 3.0D, 5.0D), IEntitySelector.field_152785_b);
if (!list.isEmpty())
{
EntityChicken entitychicken = (EntityChicken)list.get(0);
entitychicken.func_152117_i(true);
this.mountEntity(entitychicken);
}
}
else if ((double)this.worldObj.rand.nextFloat() < 0.05D)
{
EntityChicken entitychicken1 = new EntityChicken(this.worldObj);
entitychicken1.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
entitychicken1.onSpawnWithEgg((IEntityLivingData)null);
entitychicken1.func_152117_i(true);
this.worldObj.spawnEntityInWorld(entitychicken1);
this.mountEntity(entitychicken1);
}
}
}
this.func_146070_a(this.rand.nextFloat() < f * 0.1F);
this.addRandomArmor();
this.enchantEquipment();
if (this.getEquipmentInSlot(4) == null)
{
Calendar calendar = this.worldObj.getCurrentDate();
if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F)
{
this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin));
this.equipmentDropChances[4] = 0.0F;
}
}
this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0));
double d0 = this.rand.nextDouble() * 1.5D * (double)this.worldObj.func_147462_b(this.posX, this.posY, this.posZ);
if (d0 > 1.0D)
{
this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", d0, 2));
}
if (this.rand.nextFloat() < f * 0.05F)
{
this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0));
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2));
this.func_146070_a(true);
}
return (IEntityLivingData)p_110161_1_1;
}
示例4: onSpawnWithEgg
import net.minecraftforge.common.ForgeModContainer; //导入方法依赖的package包/类
@Override
public IEntityLivingData onSpawnWithEgg(
IEntityLivingData par1EntityLivingData) {
Object par1EntityLivingData1 = super
.onSpawnWithEgg(par1EntityLivingData);
float f = this.worldObj.func_147462_b(this.posX, this.posY, this.posZ);
this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * f);
if (par1EntityLivingData1 == null)
par1EntityLivingData1 = new FrankensteinMob.GroupData(
this.worldObj.rand.nextFloat() < ForgeModContainer.zombieBabyChance,
this.worldObj.rand.nextFloat() < 0.05F, null);
if (par1EntityLivingData1 instanceof GroupData)
groupdata = (GroupData) par1EntityLivingData1;
this.func_146070_a(this.rand.nextFloat() < f * 0.1F);
this.addRandomArmor();
this.enchantEquipment();
if (this.getEquipmentInSlot(4) == null) {
Calendar calendar = this.worldObj.getCurrentDate();
if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31
&& this.rand.nextFloat() < 0.25F) {
this.setCurrentItemOrArmor(
4,
new ItemStack(
this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin
: Blocks.pumpkin));
this.equipmentDropChances[4] = 0.0F;
}
}
this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance)
.applyModifier(
new AttributeModifier("Random spawn bonus", this.rand
.nextDouble() * 0.05000000074505806D, 0));
double d0 = this.rand.nextDouble() * 1.5D
* this.worldObj.func_147462_b(this.posX, this.posY, this.posZ);
if (d0 > 1.0D)
this.getEntityAttribute(SharedMonsterAttributes.followRange)
.applyModifier(
new AttributeModifier("Random zombie-spawn bonus",
d0, 2));
if (this.rand.nextFloat() < f * 0.05F) {
this.getEntityAttribute(field_110186_bp).applyModifier(
new AttributeModifier("Leader zombie bonus", this.rand
.nextDouble() * 0.25D + 0.5D, 0));
this.getEntityAttribute(SharedMonsterAttributes.maxHealth)
.applyModifier(
new AttributeModifier("Leader zombie bonus",
this.rand.nextDouble() * 3.0D + 1.0D, 2));
this.func_146070_a(true);
}
return (IEntityLivingData) par1EntityLivingData1;
}