changed crop logic a bit

if crop havest is not possible at the optimal state, just harvest, ffs.

Signed-off-by: bartimaeusnek <[email protected]>
This commit is contained in:
bartimaeusnek committed 2019-03-23 23:29:26 +01:00
1 parent abcb180689
commit 855d359b02
2 files changed
+8 -2

No files matched your search

@@ -400,7 +400,13 @@ public class PluginIC2 extends ForestryPlugin {
public ArrayList<ItemStack> getCropDrops(TileEntity tileEntity) {
if (isIC2Crop(tileEntity)) {
ICropTile crop = (ICropTile)tileEntity;
ItemStack[] cropDrops = crop.harvest_automated(true);
if (crop == null || crop.getCrop() == null)
return null;
ItemStack[] cropDrops;
if ((crop.getCrop().canGrow(crop) && crop.getSize() < crop.getCrop().getOptimalHavestSize(crop)) || crop.getSize() == crop.getCrop().getOptimalHavestSize(crop))
cropDrops = crop.harvest_automated(true);
else
cropDrops = crop.harvest_automated(false);
if (cropDrops != null) {
return new ArrayList<>(Arrays.asList(cropDrops));
}