Added events for crop growth (#3320)

This commit is contained in:
Draco18s authored and LexManos committed 2016-11-07 14:40:44 -08:00
1 parent 42e0fbbb02
commit 998a78c3c1
9 files changed
+191 -14

No files matched your search

@@ -1163,4 +1163,16 @@ public class ForgeHooks
{
return MinecraftForge.EVENT_BUS.post(new ThrowableImpactEvent(throwable, ray));
}
public static boolean onCropsGrowPre(World worldIn, BlockPos pos, IBlockState state, boolean def)
{
BlockEvent ev = new BlockEvent.CropGrowEvent.Pre(worldIn,pos,state);
MinecraftForge.EVENT_BUS.post(ev);
return (ev.getResult() == Event.Result.ALLOW || (ev.getResult() == Event.Result.DEFAULT && def));
}
public static void onCropsGrowPost(World worldIn, BlockPos pos, IBlockState state, IBlockState blockState)
{
MinecraftForge.EVENT_BUS.post(new BlockEvent.CropGrowEvent.Post(worldIn, pos, state, worldIn.getBlockState(pos)));
}
}