if(!farm.hasHoe()) {
farm.setNotification(TileFarmStation.NOTIFICATION_NO_HOE);
return null;
}
World worldObj = farm.getWorldObj();
List<EntityItem> result = new ArrayList<EntityItem>();
ArrayList<ItemStack> drops = block.getDrops(worldObj, bc.x, bc.y, bc.z, meta, farm.getMaxLootingValue());
farm.damageHoe(1, bc);
farm.actionPerformed(false);
boolean removed = false;
if(drops != null) {
for (ItemStack stack : drops) {
if(!removed && stack.isItemEqual(getSeeds())) {
stack.stackSize--;
removed = true;
if(stack.stackSize > 0) {
result.add(new EntityItem(worldObj, bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, stack.copy()));
}
} else {
result.add(new EntityItem(worldObj, bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, stack.copy()));
}
}
}
if(removed) {
if(!plant(farm, worldObj, bc)) {
result.add(new EntityItem(worldObj, bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, getSeeds().copy()));
worldObj.setBlock(bc.x, bc.y, bc.z, Blocks.air, 0, 1 | 2);
}
} else {
worldObj.setBlock(bc.x, bc.y, bc.z, Blocks.air, 0, 1 | 2);
}
return new HarvestResult(result, bc);
}