Made worms fertilize more often

This commit is contained in:
Ellpeck 2016-07-23 13:43:43 +02:00
parent 1fd25ec885
commit 43229f2d20

View file

@ -75,17 +75,21 @@ public class EntityWorm extends Entity{
}
}
if(isFarmland && this.worldObj.rand.nextFloat() >= 0.95F){
if(isFarmland && this.worldObj.rand.nextFloat() >= 0.8F){
BlockPos plant = pos.up();
if(!this.worldObj.isAirBlock(plant)){
IBlockState plantState = this.worldObj.getBlockState(plant);
Block plantBlock = plantState.getBlock();
plantBlock.updateTick(this.worldObj, plant, plantState, Util.RANDOM);
IBlockState newState = this.worldObj.getBlockState(plant);
if(newState.getBlock().getMetaFromState(newState) != plantBlock.getMetaFromState(plantState)){
this.worldObj.playEvent(2005, plant, 0);
}
}
}
}
else if(isMiddlePose){
this.setDead();
}