@Override public boolean isItemValidForSlot(int index, @Nonnull ItemStack stack) { Item item = stack.getItem(); ItemCropProduct.ProductType cropProduct = ItemCropProduct.ProductType.byItemStack(stack); return (item instanceof ItemSeeds || item instanceof ItemSeedFood || item == ModItems.CROP_SEEDS || item == ModItems.CROP_FOOD && cropProduct.canPlantCrop()) && item instanceof IPlantable; }