Changes
From Forge Community Wiki
515 bytes added
, 18:20, 20 April 2021
Line 166: |
Line 166: |
| { | | { |
| event.setResult(Event.Result.DENY); // make bamboo grow less often | | event.setResult(Event.Result.DENY); // make bamboo grow less often |
| + | } |
| + | } |
| + | } |
| + | |
| + | public void onCropsGrowPost(final BlockEvent.CropGrowEvent.Post event) |
| + | { |
| + | IWorld world = event.getWorld(); |
| + | if (!world.isClientSide() && event.getState().is(Blocks.WHEAT)) // check wheat |
| + | { |
| + | BlockState newState = event.getState(); |
| + | if (newState.is(Blocks.WHEAT)) // defensive check to make sure we can do this |
| + | { |
| + | world.setBlock(event.getPos(), newState.setValue(CropsBlock.AGE, 7), 3); // set max growth wheat |
| } | | } |
| } | | } |