Example usage for net.minecraftforge.common ForgeHooks onCropsGrowPre

List of usage examples for net.minecraftforge.common ForgeHooks onCropsGrowPre

Introduction

In this page you can find the example usage for net.minecraftforge.common ForgeHooks onCropsGrowPre.

Prototype

public static boolean onCropsGrowPre(World worldIn, BlockPos pos, BlockState state, boolean def) 

Source Link

Usage

From source file:com.plutomc.core.common.blocks.BlockCrocoite.java

License:Open Source License

@Override
public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) {
    if (ForgeHooks.onCropsGrowPre(worldIn, pos, state, rand.nextInt(2) == 0)) {
        worldIn.setBlockState(pos, state.withProperty(GROWTH, state.getValue(GROWTH) + 1));
        ForgeHooks.onCropsGrowPost(worldIn, pos, state, worldIn.getBlockState(pos));
    }//from  ww w. ja v  a  2 s  .c  o  m
}