cweckerl / simplefarming

https://www.curseforge.com/minecraft/mc-mods/simple-farming
38 stars 38 forks source link

IndexOutOfBoundsException on CropHarvest#onCropHarvest() #94

Closed Elenterius closed 3 years ago

Elenterius commented 4 years ago

When the list of block drops has a size of 1 this error is thrown: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0

This is caused by removing the stack on line 72 causing the list to be empty before the stack can be retrieved on line 76. https://github.com/cweckerl/simplefarming/blob/e8fd2d55c3d2fe081a709f6d00c7f0f52a92f240/src/main/java/enemeez/simplefarming/events/harvest/standard/CropHarvest.java#L69-L77

Luckly this exception fails silently and only crops that have their loot modified are likely to not be harvestable with right click.

Elenterius commented 4 years ago

issue #71 is the same bug