File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
src/main/java/net/wurstclient/hacks/autofarm/plants Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -57,14 +57,19 @@ public Item getSeedItem()
5757 @ Override
5858 public boolean shouldHarvestByMining (BlockPos pos , BlockState state )
5959 {
60- if (state .isOf (Blocks .CHORUS_FLOWER )
61- && state .get (ChorusFlowerBlock .AGE , 0 ) == ChorusFlowerBlock .MAX_AGE )
62- return true ;
60+ if (state .isOf (Blocks .CHORUS_FLOWER ))
61+ return isFlowerFullyGrown (pos , state );
6362
64- if (! state .isOf (Blocks .CHORUS_PLANT ))
65- return false ;
63+ if (state .isOf (Blocks .CHORUS_PLANT ))
64+ return ! hasAttachedFlowers ( pos , state , new HashSet <>()) ;
6665
67- return !hasAttachedFlowers (pos , state , new HashSet <>());
66+ return false ;
67+ }
68+
69+ private boolean isFlowerFullyGrown (BlockPos pos , BlockState state )
70+ {
71+ return state .get (ChorusFlowerBlock .AGE , 0 ) == ChorusFlowerBlock .MAX_AGE
72+ || !BlockUtils .getState (pos .up ()).isAir ();
6873 }
6974
7075 private boolean hasAttachedFlowers (BlockPos pos , BlockState state ,
You can’t perform that action at this time.
0 commit comments