This repository was archived by the owner on Jan 3, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/main/java/org/devinprogress/autoharvest Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 9
9
import net .minecraft .init .Blocks ;
10
10
import net .minecraft .init .Items ;
11
11
import net .minecraft .item .ItemStack ;
12
+ import net .minecraft .util .EnumActionResult ;
12
13
import net .minecraft .util .EnumFacing ;
13
14
import net .minecraft .util .EnumHand ;
14
15
import net .minecraft .util .math .AxisAlignedBB ;
@@ -269,12 +270,14 @@ private void feedTick() {
269
270
p .posX + range , p .posY + range , p .posZ + range );
270
271
for (Class <? extends EntityAnimal > type : animalList ) {
271
272
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
274
275
.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
+ }
278
281
}
279
282
}
280
283
}
You can’t perform that action at this time.
0 commit comments