This repository was archived by the owner on Jan 3, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/java/org/devinprogress/autoharvest Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import net .minecraft .init .Blocks ;
1010import net .minecraft .init .Items ;
1111import net .minecraft .item .ItemStack ;
12+ import net .minecraft .util .EnumActionResult ;
1213import net .minecraft .util .EnumFacing ;
1314import net .minecraft .util .EnumHand ;
1415import net .minecraft .util .math .AxisAlignedBB ;
@@ -269,12 +270,14 @@ private void feedTick() {
269270 p .posX + range , p .posY + range , p .posZ + range );
270271 for (Class <? extends EntityAnimal > type : animalList ) {
271272 for (EntityAnimal e : p .getEntityWorld ().getEntitiesWithinAABB (type , box )) {
272- if (e .getGrowingAge () = = 0 && !e .isInLove ()) {
273- FMLClientHandler .instance ().getClient ().playerController
273+ if (e .getGrowingAge () > = 0 && !e .isInLove ()) {
274+ EnumActionResult result = FMLClientHandler .instance ().getClient ().playerController
274275 .interactWithEntity (p , e , handItem , EnumHand .MAIN_HAND );
275- lastUsedItem = handItem ;
276- minusOneInHand ();
277- return ;
276+ if (result == EnumActionResult .SUCCESS ) {
277+ lastUsedItem = handItem ;
278+ minusOneInHand ();
279+ return ;
280+ }
278281 }
279282 }
280283 }
You can’t perform that action at this time.
0 commit comments