Skip to content
This repository was archived by the owner on Jan 3, 2020. It is now read-only.

Commit 8bbf9b9

Browse files
committed
bug fix
1 parent bfbe41d commit 8bbf9b9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/main/java/org/devinprogress/autoharvest/TickListener.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import net.minecraft.init.Blocks;
1010
import net.minecraft.init.Items;
1111
import net.minecraft.item.ItemStack;
12+
import net.minecraft.util.EnumActionResult;
1213
import net.minecraft.util.EnumFacing;
1314
import net.minecraft.util.EnumHand;
1415
import 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
}

0 commit comments

Comments
 (0)